By alashcraft
via blogs.msdn.com
Published: Jul 30 2008 / 22:13
What does it mean to make code more maintainable? Certainly obfuscated code is hard to understand, by definition.
A big part of maintainability is making it easier for others to read and understand what the code is doing. Your code may have been working for years, but then somebody comes along and wants to add a feature, which might break your code.
Comments
willcode4beer replied ago:
Every few months I switch between the idea of early returns wen appropriate and being strict about a single return......
chaves replied ago:
I got over the single exit point a long time ago and never went back...
,
zynasis replied ago:
single return point ftw
especially with a final value on the return, so that u know there is only ever going to be one setting of the return
mvonballmo replied ago:
I use a single return point for longer, more complex methods; however, most of my methods are short enough that you can easily see all the return points immediately. I generally code for readability and ease-of-entry, splitting things up for the debugger only if necessary.
Voters For This Link (9)
Voters Against This Link (0)