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 ![]()
