Python handles globals badly.

Steven D'Aprano steve at pearwood.info
Wed Sep 9 13:55:54 EDT 2015


On Wed, 9 Sep 2015 11:09 am, Mario Figueiredo wrote:

> You know, it is a pointless exercise to try and downplay programming
> languages (any programming language) that has proven its worth by being
> generally adopted by the programming community. Adoption is the sign of
> a respected and well designed language.

Counter-examples: PHP and C.

Adoption of programming languages is driven by many things, technical
excellence and careful design are not even in the top 10. Most of them are
social in nature, particularly "what is everyone else using?". Network
effects dominate: you could design the perfect language, but if nobody else
uses it, nobody will use it.

Sometimes a language will actually gain a kind of technical excellence
despite some really shitty design decisions -- but usually at great cost
elsewhere. C is a good example of that. Due to lousy decisions made by the
designers of C, it is a language really well suited for writing fast,
incorrect code. Since programmers benefit from writing fast code, but
rarely suffer from writing incorrect code (it's mostly users who suffer the
consequences of security holes), we have ended up in the situation we live
in now, where compilers compete to write faster and faster code that has
less and less relation to what the programmer intended.

(I wanted to link to the "Everything Is Broken" essay on The Medium, but the
page appears to be gone. This makes me sad. BTW, what's the point of
Google's cache when it just redirects to the original, missing, page?)

In fairness to the C creators, I'm sure that nobody back in the early
seventies imagined that malware and security vulnerabilities would be as
widespread as they have become. But still, the fundamental decisions made
by C are lousy. Assignment is an expression? Lack of first-class arrays?
The C pre-processor? They're pretty awful, but *nothing* in the entire
history of computing, not even Intercal and the COMEFROM command, comes
even close to the evil that is C "undefined behaviour".

I believe that the computing industry may never recover from the harm done
to it by the widespread use of C.



-- 
Steven




More information about the Python-list mailing list