Down With Regions...And Comments

Jeff explains why regions are bad, and I'm in 100% agreement. Good classes and methods are short, sweet and to the point. Regions are a code smell that someone is hiding bad design (or a lot of code that should be broken up into smaller pieces).

I'll also say this: I'm not a big fan of comments either. In fact, I rarely, if ever, comment my code (at least it's not my default behavior). That forces me to think a lot about good names for methods, fields, etc. along with the readibility of the code. When someone says that one of the coding standards is "lots of comments" I have to wonder why it's a standard. Good developers write code that is easy to read. I'm not saying the implementation is easy - some problems are not easy to solve. But the effort isn't in reading the code and understanding the design and intent behind it.

* Posted at 07.07.2008 07:44:43 AM CST | Link *

Blog History