Python handles globals badly.

jkn jkn_gg at nicorp.f9.co.uk
Thu Sep 10 11:09:00 EDT 2015


On Thursday, 10 September 2015 13:18:39 UTC+1, Steven D'Aprano  wrote:
> On Thu, 10 Sep 2015 05:18 am, Chris Angelico wrote:
> 
> > On Thu, Sep 10, 2015 at 5:14 AM, Laura Creighton <lac at openend.se> wrote:
> >> In a message of Thu, 10 Sep 2015 05:00:22 +1000, Chris Angelico writes:
> >>>To get started, you need some other sort of kick.
> >>
> >> Having Brian Kernighan write a really nice book about you, helps a lot.
> > 
> > It kinda does. And of course, it also helps to have a time machine, so
> > you can launch your language when there are less languages around.
> > Today, you compete for attention with myriad languages that simply
> > didn't exist when C was introduced to an unsuspecting world.
> 
> I don't think that's quite right. I think, if anything, there were more
> languages in the 1970s than now, it's just that they tended to be
> proprietary, maybe only running on a single vendor's machine. But even if
> I'm mistaken, I think that there is near-universal agreement that the
> single biggest factor in C's popularity and growth during the 1970s and 80s
> is that it was tied so intimately to Unix, and Unix was taking over from
> mainframes, VAX, etc.
> 
> 
> 
> -- 
> Steven

In 'The Design and Evolution of C++', Bjarne Stroustrup writes about a principle that was applied to C with classes (an early embodiment of C++):

"C with Classes has to be a weed like C or Fortran because we cannot afford to
take care of a rose like Algol68 or Simula. If we deliver an implementation and
go away for a year, we want to find several systems running when we come back.
That will not happen if complicated maintenance is needed or if a simple port
to a new machine takes longer than a week". (pp. 37)

I think the 'C is a weed' observation one is a good one to explain the
proliferation. I say this as a good thing, and as a programmer in C, C++ and Python.

    Jon N






More information about the Python-list mailing list