Thursday, September 8, 2011

You Want to Write Good Software

Before you do anything else promote all warnings as errors.

Do static code analysis. There is software for this, use it.

Try and optimize for readability but understand what is going on underneath. In other words, don't just write code that works, write code that is efficient. Every bit of extra overhead is extra clock cycles or memory that could be used for something else. Everything is going to mobile and extra CPU cycles is battery life.

Expect that your code will last a long time. Someone else will need to maintain the code. So write good clean readable code.

Only document the things that are difficult to understand. All too often I see comments such as "\\ copy this to that". Seriously this is a lame comment. If it is necessary explain why the copy is necessary, otherwise leave the comment out because the copy will be self documenting.

Format your code correctly for the project so someone else doesn't have to do it later which will make all the blames go to that person.

Just take some pride in your code. At the end of the day you'd rather people say "damn that's some nice formatted elegant clean code, I'd love to work with them again." Think of your code as your legacy.

No comments:

Post a Comment