Someone needs to explain to me why Python is so highly rated …

Posted by Stu @ 11:17 PM, Tue 01 Jun 04

Filed under: Linux, Python, Software Engineering

No Comments

… because so far I\’m not particularly impressed. I thought Python was the scripting language for serious programmers, but it seems to favour the academic sterility of computer science over the practical needs of software engineering.

Let me take managing change as an example of what I mean.

As anyone with a Software Configuration Management (SCM) background will know, software defects (bugs to you and me) are caused by changes to the software source code. If you\’re changing a large file, there\’s more risk of introducing bugs than if you\’re changing a small file. The safest changes to manage are small, localised changes to code.

So why does Python not provide an easy way to store a class inside a separate .py file on disk?

Modules and packages are the way that Python provides basic namespace support - as I understand the language so far. So, the language allows me to have a class called gpfr.args.processor, but to do so I have to defined the class processor inside the file gpfr/args.py. And if I want to add any more classes to the gpfr.args namespace, they also have to into the file gpfr/args.py.

If I was using Python in a multi-user project, this apparent limitation in Python\’s design would soon lead to one of two situations. If checking out a file locked the file (which is what many source control tools do), then you\’re always going to have developers waiting for files to become available before they can do their work. (This gets to be an annoyance at the 20 developer mark from past experience.) Or, if checking out a file doesn\’t lock the file (the cvs approach to version control), then when changes are committed, you\’ve got larger files being merged, and increased risk.

I\’m trying to think of another object-orientated programming language that I use that has this limitation - and I can\’t think of one. Java, C#, VB - yes, even VB!!!, PHP, C++ … all of these languages allow you to put an individual class into a separate file if you wish.

So help me out here. What am I missing?

(And yes, I understand that modules are objects in Python, but a quick look at a module\’s __class__ attribute will tell you that modules are not classes - and sooner or later I\’m sure that\’ll matter)

And I haven\’t even begun to compare Python\’s online manual to the one provided for PHP ;-)

Be the first to leave a comment »

Setting About Python

Posted by Stu @ 8:30 PM, Fri 07 May 04

Filed under: Linux, Python

No Comments

Seeing as I will get lynched if I write webapp-config in PHP, the time has come to knuckle down and add Python to the list of languages I use regularly. The challenge is to try and find some good documentation about Python that doesn\’t send me to sleep. Just because Python is popular amongst computer scientists doesn\’t mean the documentaion has to be as dry as a finals exam :)

I was surprised to find that none of the bookshops that I visited in Cardiff stock any Python books. Java - yes. PHP - yes. Perl - yes. But Python? No.

So I\’m currently (between naps) browsing through Dive Into Python. Right now, the book kind of loses the plot just over half-way through, but at least it\’s getting me started. A big thanks to James Cox for pointing me in the right direction.

Wish me luck!

Be the first to leave a comment »

This Month

January 2009
S M T W T F S
« Jul    
 123
45678910
11121314151617
18192021222324
25262728293031