Margaret Rouse is an award-winning technical writer and teacher known for her ability to explain complex technical subjects simply to a non-technical, business audience. Over…
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.
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.
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.
Techopedia’s editorial policy is centered on delivering thoroughly researched, accurate, and unbiased content. We uphold strict sourcing standards, and each page undergoes diligent review by our team of top technology experts and seasoned editors. This process ensures the integrity, relevance, and value of our content for our readers.
Margaret 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 IT definitions have been published by Que in an encyclopedia of technology terms and cited in articles by 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 helping IT and business professionals learn to speak each other’s highly specialized languages.
What is a RACI Chart? Its primary purpose is to clarify the duties and expectations of every team member, ensuring...
Aidan WeeksEngineering and Technology Expert
What is Cost Benefit Analysis? The primary purpose of this analysis is to facilitate more informed decision-making, particularly in business...
What is Agile Project Management? Agile project management is an iterative, dynamic approach to software development that works around several...
Alice MartinSenior Writer
Trending NewsLatest GuidesReviewsTerm of the Day