cat brain.log | less

Getting it down on `paper`

Learning Python

I dove into Python yesterday. Today: I’m reading the tutorials. I like it. What did you expect? Everyone seems to like it, right? Have you met a person who learned Python that hates the language?

So, I’m still n00b status, but here’s the deal: It’s got all the things I love about Javascript, the good parts of Java (no bloat), and the fundamental simplicity of C. PHP is conspicuously absent here, but … now that I mention it, there’s something there too.

Let’s over go over those, since you may be flaming me already. Hey! I’m still a n00b.

Javascript I really like the function mapping aspects. Ok, so this is more of a jQuery-type thing. But it’s possible, and jQuery makes it obvious — in-your-face — how useful this feature is. I could care less about lambda functions right now, but I think they’re related. I like the way zip() works on arrays.

Java Ah, the language of verbosity. I’d rather dictate War and Peace, than write Java. What’s so good about Java? It’s got a great package system, and the try/catch/finally construct. Python’s equivalent: try/except/finally. Thumbs up! Java has a good class hierarchy that Python seems to duplicate (minus the Java overhead).

C There’s nothing more powerful than C. Assembly’s got nuthin’ on C. C is the ultimate speed-speed trade-off. The speed of code development vs the speed of execution. Everything else is derivative bloat that hinders performance. So, how does Python act like C? Well, the BDFL gives Python a coherent structure. The Java package sprawl problem is not present. Code bases are tight. Syntax is rigid. Writing Python is like clock-work — it must be precise.

PHP Don’t flame. Here it is. Python is extra-great because it’s interpreted. PHP is interpreted. That is all.

Confusion says: The n00b walks a fine line of asking and testing. Nobody ever said learning a language was easy. It should be fun (or interesting if you don’t like learning) though! So here’s the deal: I’m not flying yet. I’m tutorializing. Short programs are useful learning tools, but jumping in the deep end really makes you sink or swim — strangely, I’m trying to be trite right now. I don’t get lambda. I don’t know why there are so many different types of lists. I know I’ve had a need for sets, lists, hashes, tuples, queues, and the like, but is it really necessary that there be a specific data type for each? Whatever, I’m a n00b. I know performance is probably the real motivator, but c’mon! It’s interpretive. I was surprised to learn that compiled Python (.pyc) does not execute any faster than inline Python (.py) (Can’t find the reference). The .pyc files make the module load faster, not execute faster.

Anyway, right now, Python makes a great calculator. Anyone living in Hawai’i will tell you the numerous “spam and eggs” references make’s ’em hungry too!



No comments so far.

(comments are closed)