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

If you read this thread again, you'll see that someone recommended early returns to reduce nesting. I replied that some people are not allowed to do that (eg because they have to follow MISRA). There is no need to quote Wikipedia. None of the points raised in this thread pertains only to one programming language. I'm sure you'll find at least one style guide forbidding multiple returns for every language that has return statements.


This is getting ridiculous. The reason I quoted wikipedia was to explain why "MISRA wasn't written with java in mind". Will you argue otherwise?

> None of the points raised in this thread pertains only to one programming language.

Except you replied to a java problem with a C style guide.

> I'm sure you'll find at least one style guide forbidding multiple returns for every language that has return statements.

And if that guide can explain why java benefits from having a single return statement, I would consider it. Otherwise, I refuse to follow guidelines that were designed for different problems or cosmetic reasons.




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

Search: