Go rant
Nick Sabalausky
a at a.a
Mon Dec 21 13:41:09 PST 2009
"Andrei Alexandrescu" <SeeWebsiteForEmail at erdani.org> wrote in message
news:4B2FCF53.9050608 at erdani.org...
> Walter Bright wrote:
>> retard wrote:
>>> I have several imperative language programming books and instead of
>>> qsort they introduce the reader to the wonderful world of bubble sort!
>>
>> Bubble sort should be part of an introductory programming course, if only
>> because:
>>
>> 1. it's an algorithm that gets reinvented if one is not aware of it
>>
>> 2. one needs to be able to recognize it, as one will encounter it a lot
>> in production code
>>
>> 3. it's a great way to introduce concepts like big O
>>
>> 4. it's a great stepping stone to introducing better sorts
>>
>>
>> I've run into bubble sort reimplementations in production code written by
>> famous programmers who should know better. It happens all the time.
>
> Fro your arguments 1-4 and your conclusion, I infer you made a slight
> typo. Let me fix that for you.
>
> s/should be/should not be/
>
It should be "should be", for the same reason and in the same way that the
"waterfall" development model *should be* taught: Presenting it up front as
conceptually-easy-but-generally-a-bad-thing-to-do will help people identify
it and therefore avoid it. Not teaching about it increases the chances that
they'll either rediscover it or come across a usage of it without actually
noticing that there's a problem. It would be like selling sodium without
including a warning that it explodes upon contact with water (Or something
like that, anyway, I never actually took chemistry...).
More information about the Digitalmars-d
mailing list