Content deleted Content added
farther for physical distance, not further |
Rewrote most of the sentences to be clearer |
||
Line 1:
{{Orphan|date=February 2009}}
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 has overlooked some fundamental issues at the very [[High and low level|lowest levels]] of [[software design]].
__TOC__
==Spolsky's analogy==
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
The inefficiency Spolsky was drawing an analogy to
Spolsky condemned such inefficiencies as typical for programmers who had not been taught basic programming techniques before they began programming using higher level 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" />
Line 14:
==Spolsky's example==
The programming practice that Spolsky used to make his point was repeated [[concatenation]] of [[C (programming language)|C]]-style null-terminated character arrays ("strings").<ref name="basics" />
The first step in every implementation of the [[C standard library|standard C library]] function for [[concatenation|concatenating]] strings is
In Spolsky's example, the "Schlemiels" occur when multiple strings are being concatenated together:
# <code>[[strcat]]( buffer, "John" ); </code>/* Here, the string "John" is appended to the buffer */
# <code>strcat( buffer, "Paul" ); </code>/* Now the string "Paul" is appended to ''that'' */
# <code>strcat( buffer, "George" ); </code>/* ... and the string "George" is appended to ''that'' */
# <code>strcat( buffer, "Ringo" ); </code>/* ... and the string "Ringo" is appended to ''that'' */
The problems illustrated by Spolsky's example
== References ==
|