DISQUS

DISQUS Hello! Life is grand is using DISQUS, a powerful comment system, to manage its comments. Learn more.

Community Page

Jump to original thread »
Author

Return *

Started by paulmwatson · 10 months ago

Everything in moderation and moderation in everything. And with that in mind: Don’t return from multiple points in a method. ... Continue reading »

3 comments

  • I think this is correct to some extent, but as with most rules, the best coders, IMO, know when to break them. I'd probably re-define this to say "only have well-known and obvious return points".

    When tidying up some code that had seriously evolved beyond its original purpose recently, one of the most useful and important things I did was consolidate and audit the return and exit paths, and make them sane and obvious. This really helped the clarity of the code.
  • Absolutely right Andrew. That is why I said "in moderation." Got to know when to break your own rules.
  • If you're talking to idiots, use small words. If you're writing for idiots, use simple constructs.
    And that's enough about that.

Add New Comment

Returning? Login