Home

Advertisement

Mon, Mar. 2nd, 2009, 02:59 pm
Standards Failure

No project has EVER failed for lack of a coding standard! Not one ever! Coding standards are what you do instead of something. They do nothing to resolve the problems with the structure of the code, but they allow incompetent programmers to feel as though they are successful and have written good code because they've "followed the standard". I've seen plenty of code that was incomprehensible and wrong but followed the standard to a T. I've never seen a standard (and I've seen plenty) that does anything to enforce locality of reference, maintain cohesion, or reduce coupling. I've seen a couple that said anything about function length. I've seen lots that go on at length about commenting the code. Why isn't it obvious what is happening in the code that you feel you need to add explanatory text? A bad programmer will fill his code with pointless drivel that's at best redundant and at worst wrong. The best use of comments that I've found was to identify the requirement from the requirements document which the code fulfilled.

Here's about all the coding standard you need:
  • No routines that won't fit on a single screen, unless you have a very, very, very good reason.
  • Use descriptive names for everything.
  • Try to maintain consistency with code that you're modifying.
  • Comment where necessary and only where necessary.
.

Mon, Mar. 2nd, 2009 10:15 pm (UTC)
[info]patrick___

Good points!

Mon, Mar. 2nd, 2009 10:17 pm (UTC)
[info]robkeeney

Thank you. You can guess what I've been looking at lately.

Advertisement