Experiences/guidance on teaching Python as a first programming language
Steven D'Aprano
steve+comp.lang.python at pearwood.info
Thu Dec 19 16:31:34 EST 2013
On Thu, 19 Dec 2013 04:50:54 +0000, Mark Lawrence wrote:
> If C is such a crap language, what does it says for the thousands of
> languages that never got anywhere? Or did C simply have a far larger
> sales and marketing budget? :)
The sociology of computer languages is a fascinating topic. Like any
technology, it's a mix of factors. Why did VHS defeat Betamax when all
the experts agreed Betamax was the better system? How did Windows take
over IT? The advantages of C in the 1970s and 80s included:
- although "portable C code" is a sad joke, compared to most of the
languages that came before it, C *is* portable;
- C compilers can be small, efficient and fast, although they weren't as
small, efficient and fast as (say) TurboPascal;
- the machine code they generated was acceptably lightweight and fast,
although not as lightweight and fast as (say) Forth;
- C was an open standard at a time when computing was big enough that
open standards were becoming important;
- C did (and still does) have some areas where it is quite advantageous,
like systems programming;
- C benefited from it's close association with Unix, where Unix went, so
did C;
- Unix made some universities a lot of money, hence they had a motive to
support C with both money and attention;
- C was associated with universities, so people learned C and then taught
C to the next generation of students, who went on to introduce C to
industry; and
- C (like Perl) falls into the hacker-machismo sweet-spot, where it is
just challenging enough to still be fun without being either too easy or
too hard. It is low-level enough to allow premature optimization (without
being as low as assembly language, which is too low-level to be fun) and
gives the freedom to play code golf and write amazingly obfuscated code.
So C is a language that allows hackers to show off.
Some of those reasons also applied to Lisp, and remember that in the
1970s and even 80s Lisp compilers were at least as efficient as C
compilers. I believe there are two factors that lead to C becoming more
popular than Lisp. The first is Worse Is Better:
http://www.jwz.org/doc/worse-is-better.html
The second is that, despite all the weird punctuation and digraphs and
even trigraphs, C fits the mental space of English-speakers better than
Lisp. To the average programmer, C is a more natural syntax and
programming model than Lisp.
--
Steven
More information about the Python-list
mailing list