Code Bloat

What Does Code Bloat Mean?

Code bloat is code that is allegedly too long or slow on most computer systems. While the term usually refers to source code that is too long, it can also refer to executables that might be considered excessively large.

Advertisements

Causes of perceived code bloat might be use of object-oriented programming techniques where procedural techniques would do, inappropriate use of design patterns, declarative programming and loop unrolling. Solutions to code bloat can include refactoring and eliminating redundant calculations.

Techopedia Explains Code Bloat

Code bloat is a problem in software development where the length of the source code is believed to be excessively long. The term usually refers to the length of the source code itself, but can also be applied to the size of the executable files generated by a compiler if using a compiled language such as C.

Code bloat is often in the eye of the beholder, but it can cause real problems. Long, unclear code can be difficult to read and maintain. Programs that are too large are slow to run.

Code bloat can be caused by inadequate language features leading to excessively verbose code, use of object-oriented design principles where they’re not needed and using design patterns that are inappropriate to the problem being solved. Using declarative programming techniques where object-oriented or imperative techniques are warranted can also cause code to grow too large. Loop unrolling, which reduces instructions controlled by a loop, is a programming technique that can boost execution speed while causing code bloat.

Fortunately, there are solutions to code bloat. The first is to avoid it in the first place, by using minimalistic programming techniques, perhaps with software methodologies like Agile programming. The other is careful refactoring, which changes a program’s source code while leaving its outward functionality intact. Another good option is software re-use, using libraries to simply program.

Advertisements

Related Terms

Latest Project Management Terms

Related Reading

Margaret Rouse

Margaret Rouse is an award-winning technical writer and teacher known for her ability to explain complex technical subjects to a non-technical, business audience. Over the past twenty years her explanations have appeared on TechTarget websites and she's been cited as an authority in articles by the New York Times, Time Magazine, USA Today, ZDNet, PC Magazine and Discovery Magazine.Margaret's idea of a fun day is helping IT and business professionals learn to speak each other’s highly specialized languages. If you have a suggestion for a new definition or how to improve a technical explanation, please email Margaret or contact her…