Code bloat

code-bloatCode bloat is the result of complex application. All major software application suffers from this problem. As explained in the Enemy of Simple article.

Now, code bloat means there are a lot of code lines that are not optimized properly. It can also be extra codes that were built for a cancelled feature. Basically it grows the code base, but of no value to the entire application.

The common cause for code bloat are:

  • New features being added to the application. In the middle or after development has been completed.
  • Time constraint, everyone is in such a hurry these days, that not enough time are allocated for development.

New features are always going to be added to a software application. Without new features, the software is considered dead. And when a software is dead, no one is going to use it.

Thus, the code bloat problem is always going to be there.

Sometimes there is a window of opportunity to reduce code bloat. There is a name for code bloat reduction. Called Refactoring.

What refactoring means is : the code is revisited and rewritten to be better, in terms of performance and readability.

However, such chance are very rare. When a software application has grown so big, taking such as task is going to take a lot of effort and time. The two things that are very rare in software development world.

New programming method tries to address this problem, extreme programming principle is one of them. By utilizing test driven development, code bloat is supposed to be reduced from the beginning.

In reality, using test driven development is quite difficult. It has a steep learning curve. Unless someone has done test driven development, it is difficult to form into a habit.

What do you think of code bloat ? What is your experience with them ? How do you reduce them ?