Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That would make sense if you were executing code in your head, but if you're reading you want to read all of it anyway...


Not at all true, most of the time you are reading code with a specific goal or area of interest in mind, and thus are only interested in the subset of code related to that purpose.


But @OriginalSyn has a pont. If you are reading code because something is misbehaving on a given configuration and you read

  if (some condition that doesn't hold on that configuration) ...
You can avoid everything inside that if statement if you know that's not important for the case you're considering.


But if we want to avoid it, we would be required to already know what's inside the parenthesis. If we already knew what's inside it, putting condition before helps more as in that case (1) Either it's true and you have to parse the block or (2) It's false and you just jump to the end of it.




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

Search: