anonymous tech woman

Yet another woman in technology blog. I'm actually a developer who uses a variety of Java and database technologies on a variety of platforms.

Monday, May 29, 2006

Coding Standards Or Code Like A Girl

I was reading an article on Creating Passionate Users entitled "Code Like a Girl" it remained me of my university course where if you coded something that worked perfectly but your code was unreadable you either failed the assignment or your assignment got marked down. I had to make sure my code was readable whether it was C, C++, Java or Perl.

In my last company I was working on bug fixing a project where the code was nearly impossible to read. This varied from the simple no brackets around if/else statement to badly named variables, methods and classes to methods that were over a page long with repetitive blocks of code. (Badly named variables,methods and classes don't describe what their purpose is.)

I spoke to a guy in the company about the lack of coding standards and he replied that you can't expect good coding standards in industry. Strangely I have worked in more than one company with rigid coding standards and this lead to the code having fewer bugs to maintain. Writing nice code makes it a pleasure to read and easier for an observer who may have nothing to do with your code pointing out a flaw from just standing over your shoulder.

Java has coding standards which Sun wrote in 1999. Other Java sites have similar standards i.e. Java Ranch. Even in Perl where it's possible to write code on one line which can do a lot of damage to file systems, you should have coding standards. Perl.com has a nice article defending coding standards.

0 Comments:

Post a Comment

<< Home