Hacker News new | past | comments | ask | show | jobs | submit login

If you know of any coding rule that is universally true, I'd like to hear.

Maybe... Don't use goto to jump to the middle of a different block of code? I don't know any exception to this one, but it's also prohibited on all modern languages, so I don't think it's a "coding rule" anymore.




Oftentimes if you have some hairy code, the best option is to use a goto, make a commit or leave a note, and then clean it up later, in a separate commit. It's more bisectable and leaves a more readable diff. I'm pretty sure I've had occasion to jump into the middle of a loop as the point of entry. Duff's device is a case of this.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: