15 April, 2009

PhizzleDizzle Is Right

Python is a lot more intuitive than Perl. Perl is all twisted up in contractions and brackets and weird contractions whereas Python has just a few punctuation sets and very clear functional parsing. I spent 3h on a Python tutorial and have managed to write scripts that I haven't been able to write even after a couple months of casually studying Perl. The only non-intuitive thing I've found in Perl so far has been trying to link an operation inside of a "while" loop to a condition set outside the loop. With this, it took me about 40min to figure out what was wrong with my script to ask for numbers one at a time until the sum was 100 or greater, because the loop kept quitting after 2 numbers. I think I've got it now.

Bonus: Python can do more than just parse text files. This has been one of my frustrations with Perl so far, I could write a little script to change all the "ae" in a text document to "รค", but when it came to actual utility it was kind of limited. I have no doubt that Perl is useful for large-scale Internet applications, I now think that Python might be a more useful skill to develop. I'm not going to give up completely on Perl, but for the moment Python suits my curiosities much better. There's even a serial.py module that let's Python talk to micro-controllers!

So yes, Phizzle Dizzle was right. Python seems to be just as powerful, more intuitive, and offer a much shallower and less painful learning curve. Also, the IDLE Python GUI is quite nice.

4 comments:

PhizzleDizzle said...

Wow, an entire post titled about my correctness! :) Exciting.

I'm glad you like Python. I. Love. It.

My word verification is "inaries", which of course makes me think immediately of "binaries".

Anonymous said...

First an admission: I write a lot of Perl, I've not tried Python.

I'm mostly curious about what tutorials or similar you found for using Perl, and why they put you off it.

Apart from that, Perl can indeed (through many Perl modules on cpan.org) talk to serial ports, and indeed to an enormous amount more than just text-based things.

Toaster Sunshine said...

I don't doubt that Perl is more useful that I've so far found it to be. However, Python so far just seems much more intuitive. I have been using the O'Reilly Llama Book for Perl and it's just the incredibly dense symbologies of Perl that have turned me off of it.

Hermitage said...

Hmm, after spending eons in the morass of cryptic awesome that is C, PERL was like a shining light of simplicity. It also felt like cheating, or something, so I stopped using it. I will have to try this Python business.