street work for cigarettes

CC BY-SAnks@nks.shwhat

python is like lisp

I didn't start programming with Python. In the small amounts of Python that I did do, I found the language clunky and confusing. How dare this language - a tool - try and tell me how to work?

While I'm ashamed to admit it, I was very critical of other people who used Python, and looked down on them as "lesser programmers".

I'd like to talk about how I've looked further into Python, and why I consider it to be rather like a lisp. This whole experience, whilst fairly shallow, has challenged my prejudices, and I'm striving to be less judgemental of other people's choices going forward.

In particular, I'm thinking of Scheme. Scheme is traditionally a fairly academic language. It was used in computer science courses to teach students how to program, because the syntax wasn't full of seemingly superfluous and cryptic symbols. Now, most courses choose to use Python instead, I suppose because the community is bigger and more people know how to use it. This is sad, because Scheme is a very nice language. But Python isn't that bad.

Python has a very predictable syntax. Scope is shown through indentation. This can be irritating because sometimes people use different amounts of spaces or tabs, and the very name "whitespace" gives an idea of how hard it can be to search for the issue. But it is also very predictable. Another language which shows scope in an obvious way is Scheme. The difference is, Scheme is cluttered with brackets (it's not so bad). But once I realised this similarity, I warmed to Python a fair bit.

Python also has lambdas. The Python lambda isn't quite the same as lambda in Lisp, but as far as I can tell, but it's pretty close. Anonymous functions are cool, and Python has that coolness.

Another reason that Python is desirable as a teaching language is because it has classes. Personally I'm not a fan of object-oriented programming, but it's a useful thing to teach. Python's OOP isn't the best implementation, but for teaching it works well enough.

Perhaps the biggest advantage of Python over a scheme is the ease of install for a new user. When it comes to Lisps, there are various implementations of different standards - do I use Common Lisp, Emacs Lisp? What version of Common Lisp? Python has one option which is available for most operating systems (although there's still the Python 2 vs Python 3 dispute).

I've started to ramble a bit, but my main point is this: Python is not a bad language, and has some similarities with Lisp languages. This is not to say that Python is really the same as a Lisp, just to point out to myself that judging people based on what language they are using is unpleasant and unnecessary.

That's all, really.