Python is pseudocode

By Serdar Yegulalp | 2015/11/04 23:08

I have relatively few programming habits left over from other languages. Most of what I learned about C# is now stale and hasn't been used in years; before that was my high-school-level Pascal, and that was about it. I don't have years of bad Java habits to unlearn that don't really have a place in Python (e.g., habitually implementing getters and setters on classes), so I approached Python with fresh eyes. One of the first things I learned about it -- or rather, one of the first understandings I came to about it -- was that Python is like a sort of pseudocode. That insight right there helped shape a good deal of how I approached the language, and why I found it so much to my liking.

Software is written to get things done in the real world. Sometimes that real-world thing is hidden behind many levels of abstraction, but at the end of the day you're trying to do something that has real-world relevance. The less you have to deal with the programming language itself to get those things done, the better.

With Python, there's a lot less of the wading through the murk of the language to accomplish specific things that I'd come to associate with programming. There's little, if any, "magic" or "spooky action at a distance" of the kind I'd seen in PHP (e.g., the way error reporting works in that language). It's easy to get started, easy to ramp a project up to a more advanced level, and easy to make use of the powerful features in the language as you need them.

Under it all, though, it's the pseudocode-ness of the language that keeps me faithful to it. The plethora of libraries is wonderful; the way I can go from "something I threw together over lunch" to "actual application" without breaking too much of a sweat is nice. But code that's readable, concise, and doesn't trip me up with any hidden assumptions about itself is even more welcome.

Tags: Python programming

comments powered by Disqus