In love with Python

When I first heard of Python, and tried messing with it, I thought it a little bit strange. The way you declare variables, use objects, import modules etc is quite different from Perl (the language I’m used to code for a long time). I felt incomodated specially by not having brackets around my blocks of code.

Besides the natural (forced) code identation from Python (I like, but it’s tricky), I’m falling in love with it. It’s an elegant language (besides the fact that it’s a little confusing to find where a code block ends) and it’s quite easy to learn. The default modules that come with the basich package has been more than enough for my sys admin scripts until now, and I didn’t ever need to fetch any outside packages (CPAN really bothers me).

As always, each language has it’s pros and cons. But as of now Python has given me more pros. I would say that Python strongest features are speed, lesser code, and easy var handling (no need for $), while Perl works better for visual block recognition (because of the brackets) and better ways of handling text, specially with regexes (well, that’s the main focus of Perl).

I think now I can say I serve two masters. ;)

1 comment so far ↓ | 203 views |

#1 Leonardo Boiko on 02.10.06 at 16:18

I like ruby. It’s on the news currently thanks to Rails, which I don’t like, but I liked ruby ever since I first tried it. Python’s lack of conciseness is not for me. Ruby, “a better Perl”, is very much like Perl, except it’s properly object-oriented (I mean like Smalltalk, not like Python) and makes heavy use of functional programming techniques (mostly the closure-like code blocks, which I’m in love with).

Leave a Comment

Powered by WP Hashcash