Programming Wisdom

I skimmed through a compendium of 100 things programmers need to know. There was some good stuff in there. I will summarize the top 10 or so right here.

The first is that technical debt may be inevitable in the short term. Sometimes you just got to ship. Be quick to remove it though.

Automatically format code. Do it as part of the build. I like the sound of that. We have some nasty formatting in most of our code. We normally try to fix this manually. Ouch.

The best methods are about 10 lines of code each. You should also limit the number of parameters passed in to a max of 4.

Good programmers care about the code they produce. Great ones care about the entire team's code. I am not sure I am ready to be one of the great ones. Honestly.

The best programmers are great because of hard work. There are normally not any shortcuts. No pain, no gain here. Once again I doubt I am ready for any more pain that I am already enduring.

Here is a tip I like. If you try to be productive doing code for more than 30 hours a week, you are working too hard. Try telling that one to the management team. Hehe.

Thou shalt learn to use the command line version of your tools. Period. All great UNIX hackers already know this. Time for the Microsoft crowd to catch up.

Testing should be done on the weekend. That is, you should automate your testing. If it takes too long to run, run it overnight. The weekend is a great opportunity to run the full suite of tests.

Too much logging is no good. We suffer from this ailment on our project. I try to cut back on the logging. However I find programmers just go in behind me and want to add the massive logging back in. You know we are in trouble when the database blows up due to massive logging.

Finally you should test your unit tests by injecting an error and seeing if it is caught. I tried pitching this idea once before. Management was actually receptive. Then I got real busy and dropped the ball. Time to reintroduce this one to the project.