Code bloat
In computer programming, code bloat is the production of executable code (source code or machine code) that is unnecessarily long, slow, or otherwise wasteful of resources. Code bloat can be caused by inadequacies in the programming language in which the code is written, the compiler used to compile it, or the programmer writing it. Thus, while code bloat generally refers to source code size (as produced by the programmer), it can be used to refer instead to the generated code size or even the binary file size.
In computer programming, code bloat is the production of executable code (source code or machine code) that is unnecessarily long, slow, or otherwise wasteful of resources. Code bloat can be caused by inadequacies in the programming language in which the code is written, the compiler used to compile it, or the programmer writing it. Thus, while code bloat generally refers to source code size (as produced by the programmer), it can be used to refer instead to the generated code size or even the binary file size. ==Examples== The following algorithm is written in JavaScript, and can generate an HTML tag based on user input. It contains a large number of redundant code: unnecessary logic and variables, and inefficient string concatenation. // Complex function TK2getImageHTML(size, zoom, sensor, markers) { const strHTMLStart = ' '; var strFinalImage = ""; var strURL = "https://example.com/staticmap?center="; var strSize = '&size='+ size; var strZoom = '&zoom='+ zoom; var strSensor = '&sensor='+ sensor; strURL += markers[0].latitude; strURL += ","; strURL += markers[0].longitude; strURL += strSize; strURL += strZoom; strURL += strSensor; for (var i = 0; i The same algorithm above can be rewritten to be less redundant and more efficient as follows (although not as readable): // Simplified function TK2getImageHTML(sz, zm, sens, mks){ let url="" mks.forEach(mk => url += mk.addMarker()) return ` ` }
References
No reference rows published for this article.
Cite this article
MLA
"Code bloat." encyclopegia.org, 2026, https://encyclopegia.org/wiki/code-bloat. Accessed 24 November 2026.
Chicago
"Code bloat." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/code-bloat.
APA
encyclopegia.org. (2026). Code bloat. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/code-bloat
Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON