Schlemiel the Painter's algorithm: Difference between revisions

Content deleted Content added
Wookie2u (talk | contribs)
No edit summary
Line 1:
In software development, a '''Schlemiel the Painter'''['s]<!-- Spolsky uses it both with and without the possessive 's -->''' algorithm''' denotes any methodology that is inefficient because the programmer whohas wroteoverlooked itsome had an incomplete understanding of basicfundamental issues at the very lowest levels of [[software design]], or because those basic issues were overlooked. The term was coined by software engineer and essayist [[Joel Spolsky]].
 
__TOC__
Line 5:
Spolsky used a [[Yiddish]] joke to illustrate a certain poor programming practice. In the joke, Schlemiel (also rendered Shlemiel) has a job painting the dotted lines down the middle of a road. Each day, Schlemiel paints less than he painted the day before. When asked how that could possibly be, Schlemiel complains that it is because each day he gets further away from the paint can.<ref name="basics">{{citation|last=Spolsky|first=Joel|title=Back to Basics|date=December 11, 2001|series=Joel on Software|url=http://www.joelonsoftware.com/articles/fog0000000319.html|publisher=joelonsoftware.com}}.</ref>
 
The inefficiency Spolsky was drawing an analogy to was the poor programming practice of repeated [[concatenation]] of [[C (programming language)|C]]-style null terminated character arrays (in general computing parlance known as "[[String (computer science)|strings]]")&mdash; in which the length of the destination string has to be recomputed each time because it is not carried over from a previous concatenation.
 
Spolsky condemned such inefficiencies as typical for programmers thatwho had not been taught basic programming techniques before they were began programming inusing morehigher abstractlevel languages: "Generations of graduates are descending on us and creating ''Shlemiel The Painter algorithms'' right and left and they don't even realize it, since they fundamentally have no idea that strings are, at a very deep level, difficult."<ref name="basics" />
 
Coined in 2001, the term has since becoming part of the vernacular to denote inefficient programming techniques.<sup>''cf.'' </sup><ref>{{citation|title=Programming interview questions|last=Cox|first=William|date=November 19, 2005|url=http://discuss.techinterview.org/default.asp?interview.11.246942.7|publisher=techinterview.org}}.</ref>