Took the words right out of my mouth…

Posted on Friday, March 4, 2005 in Uncategorized

Whilst I’m not a huge fan of his, I do have Rory as one of my subscriptions in Bloglines because a) he can be funny (not all the time though) and b) he comes out with some good observations.

Today was the latter of the two with his take on Python which he nicely sums up with:

Because I kind of think Python sucks and is as overrated as OS X and Pink Floyd.

Now, this is definitely going to upset some just for the Python comment alone. Others are already wading in on the OS X and Pink Floyd comparision.

Now I can’t comment on Pink Floyd as I’ve never conciously listened to any of their music, and I’ve commented about OS X before so I kind of agree with that statement, but – for me – Rory has got it dead right about Python.

Not so much that it “sucks” per se, but that it is overrated and has some very strange conventions. Everyone goes on and on about how good Python is – I’ve even found myself doing it, but if I’m truly honest I don’t really believe it. It is a nice language, it’s just not “all that”.

I do do Python occasionally because I have to (i.e. maintaining existing applications) but if I’m writing something new I’ll reach for C# first time every time1.

Update

As foretold, Aq has responded, so I’ll respond right back. :)

Not sure where his argument about self vs curly brackets is going, as the latter are code blocks (i.e. indenting in Python – how’s the ink on your tab key?) whereas the former is simply wasteful. If you have to pass self, why isn’t done for you?

Can’t comment on the 1.x/2.x and OO stuff as I don’t know enough about it.

He’s right about using Python for scripting – it’s great for that, but then so are Perl and a whole bunch of others2.

Here’s my argument:

A good scripting language does not make a good programming language.

Yes, you can write applications in Python, Perl etc. but that does mean you should. On the inverse, if you’re trying to use say, C#, to write procedural scripts then you should re-evaluate your needs.

As Aq says, Python is somewhere in the middle but you know what they say about “Jack of all trades”…

Conclusion

I already gave you one! OK, let me clarify and expand a bit.

Firstly: Python isn’t an inherently bad language – it’s just overrated.

Secondly: Use the language you want, how you want. Just use them wisely, don’t force them into situations they weren’t intended for, and (most importantly) don’t force your choices on others.


1 I can’t even remember the last time I wrote a Perl script now, and I used to work in that on a daily basis.

2 I’m actually in the sed and awk camp for doing stuff like this these days.

Related posts:

Perspective Following on from the Python is overrated stuff, I’ve been... BOO! …did I scare you? I’ve been aware of del.icio.us for... Knowing when to keep your mouth shut I’ve started working on a few OSS projects of my... Why .NET? I was speaking to Matt from LugRadio on Skype earlier... Words fail me The “Holiday 2005 Edition” Darth Vader action figure. I so...

Related posts brought to you by Yet Another Related Posts Plugin.

<em>If you have to pass self, why isn&#8217;t done for you?</em><br />
<br />
You <em>don&#8217;t</em> have to pass <code>self</code>. Methods of a class can be called as unbound methods, which aren&#8217;t associated with a particular instance.<br />
<br />
The point about the ink on tab/}/s,e,l,f keys is that yes, &#8220;self&#8221; seems like extra verbosity, but it&#8217;s essentially syntactic sugar. Curly brackets could be seen as the same thing: castigating Python because you have to throw those things in seems a bit unreasonable when C people don&#8217;t see that they add curly brackets all over the place that Python doesn&#8217;t require.<br />
<br />
The fact that Python can work procedurally as well as object-orientedly doesn&#8217;t seem to me an argument that it&#8217;s not a good programming language. The simple answer is: don&#8217;t do that, then. If you&#8217;re writing a program (rather than a script, to draw your programming/scripting distinction) then you should be doing it with OO, and Python happily supports that. If the argument is that Python shouldn&#8217;t allow procedural stuff at all because people might use it in large programs where it isn&#8217;t appropriate then, well, OK, but if you can show me a language which <strong>prevents</strong> you from writing code in bad ways then I&#8217;ll eat my hat. C# doesn&#8217;t do that any more than anything else does; you can claim, with some justification, that it eliminates certain classes of programming or style errors, but then Python eliminates some as well (just different ones).<br />
<br />
Conclusion<br />
Firstly: C# isn&#8217;t an inherently bad language &#8211; it&#8217;s just overrated.<br />
<br />
Secondly: Use the language you want, how you want. Just use them wisely, don&#8217;t force them into situations they weren&#8217;t intended for, and (most importantly) don&#8217;t force your choices on others.<br />
<br /> :-)

Err, how well does your C# code run on Linux or, dare I say it, Mac OSX? <br />
<br />
How about getting an application written in your language of choice to run on a small device like a Palm Pilot or a Nokia smart phone?<br />
<br />
But I&#8217;m with Aq, your choice of programming language shouldn&#8217;t affect anyone but yourself. <br />
<br />
And we haven&#8217;t even started on other paradigms like functional programming or design by contract.


Mobilized by Mowser Mowser
Mobilytics