Posts

Flag Arguments

Passing a boolean as an argument into a method is not good practice. It complicates the method signature, indicating that this method does more than one thing. It does one thing if the flag is true and another if the flag is false! A method or function should do one thing and do it well. In order to avoid passing flag arguments you should split the method or function into two, using a very descriptive name for each of the methods. Try refactoring the code in your current project and see if this small change improves the readibility.

Change names when you find better ones

Names are everywhere in software. We name our classes, variables, namespaces, etc. The name should answer all the big questions about your code.  When I'm refactoring my code that is one of the first thing I look for: Does the name of this method reveal its intent? If at that point I can think of a better name then I change it right away.  Choosing good names can take a lot of time but it could save you more time in the future. 

PHP: One of the "Big Three"

I recently was reading TechRepublic article 10 skills developers will need in the next five years where Justin James uses the terminology the "Big Three" to refer to .NET, Java and PHP and I found interesting some of the comments regarding PHP. Some suggested that PHP does not really fall into the same category as .NET and Java. According to the PHP statistics for October 2008 report , PHP is found on 32,84% of the web sites. What do you think? Is there something wrong with PHP? Feel free to leave your comments.

Resharper 4.5

Finally, after being away for a couple days, I was able to upgrade to Resharper 4.5. After using Resharper for a couple years I'm so used to Resharper that it would be hard to use Visual Studio without it. The new version has been improved. I noticed right away that the solutions are loading faster and Visual Studio is more responsive. All licenses purchased after Dec 21, 2007 qualify for a free upgrade to ver. 4.5 If you haven't used Resharper I recommend to give it a try. ( http://www.jetbrains.com/resharper/download/ )

Fix bugs, then write new code

I have found this to be a good practice after finishing an Iteration. The code is fresh in your mind and you can fix the bugs faster than if you wait until a couple weeks later. Fixing those bugs should be included in your iteration planning. Back in 2000 Joel Spolsky wrote his well known 12 Steps to Better Code article and he makes some interesting comments regarding having your code ready to ship at all time. ( http://www.joelonsoftware.com/articles/fog0000000043.html )