Python: the drain snake of programming.

May 25, 2006 14:04

Every once in a while, someone notices I don't like Python much and wants an itemized list of reasons. It's not very easy to come up with such a thing on demand. I don't usually sit around making lists of reasons I dislike a given programming language, believe it or not, so I don't usually have such reasons in front of me. The short, flippant answer I tend to give instead of an itemized list is usually "It makes my eyes bleed."

Here's a little bit of a reason, though, from a conversation in IMs today:

(13:59:59) ilcylic: holy crap python is way different from perl.
(14:00:29) @: What did you notice is "way different"?
(14:01:16) ilcylic: just all the stupid OO language.
(14:01:32) @: Scaffolding an' stuff? Egregious overuse of "self"?
(14:01:46) ilcylic: yeah.
(14:01:49) ilcylic: Oh yeah.
(14:02:06) ilcylic:
template = self.template('admin/article/index.pt')(context=self.context, **dict(self.options))
self.form = HTMLForm(template, ArticleFilterSchema)

def getDefaults(self):
defaults = {'active':self.request().field('active', 'true'),
'featured':self.request().field('featured', ''),
'categoryID':self.request().field('categoryID', ''),
'locationID':self.request().field('locationID', ''),
'year':self.request().field('year', str(DateTime.today().year)),
}

(14:02:30) @: OUCH.
(14:02:39) ilcylic: yeah.
(14:02:39) @: You're making my EYES BLEED!
(14:02:47) ilcylic: and the use of tabs instead of braces
(14:02:52) @: yeah
(14:02:56) ilcylic: for flow control.
(14:03:03) ilcylic: makes it hard for me to read what's going on.
(14:03:11) ilcylic: like reading a book without punctuation.
(14:03:16) @: There's a distinct lack of symmetry.

I particularly like the punctuation analogy. Tomorrow I may not like it as much, but for now, it just sounds right.

NOTE: I intentionally changed the indentation on the first line of that Python code to try to neaten it up a touch for LJ.
Previous post Next post
Up