Code Bloat

Why Trust Techopedia

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

Margaret Rouse
Technology expert
Margaret Rouse
Technology expert

Margaret is an award-winning writer and educator known for her ability to explain complex technical topics to a non-technical business audience. Over the past twenty years, her IT definitions have been published by Que in an encyclopedia of technology terms and cited in articles in the New York Times, Time Magazine, USA Today, ZDNet, PC Magazine, and Discovery Magazine. She joined Techopedia in 2011. Margaret’s idea of ​​a fun day is to help IT and business professionals to learn to speak each other’s highly specialized languages.