Jump to content

Code bloat

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 81.168.0.205 (talk) at 16:08, 19 September 2005 (Initial entry added). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Code bloat is the production of code that is nnecessarily long. An example of a bad coding habit that leads to bloated code would be copy and pasting a function into the peice of code you are writing instead of calling it. Bloated code is not good as it leads to increased usage of memory and hard drive space and as such is an example of inefficiency. It may also be slower. Many people might refer to code produced by microsoft as bloatware because of their low opinoin of Microsoft and its products.

Code bloat can also be caused by inadequacies in the language in which the code is written. An example of which would be the template system employed in C++. This is because templates cause a version of the function to be compiled for every type it is used with. A better solution to this particular problem is the typing system employed in many functional languages in example of which would be the Haskell programming language. Templates however do still produce neater source code than using overloading to manually write a version of the function for each possible parameter type.

See also