by pansa2 · 1y ago · 0 comments
I'm glad that caveat is there, because "Python is simple" is one of the biggest misconceptions about the language. It's actually a very complex language hiding behind pleasant syntax.
It's heavily used by non-programmers not because it's simple but because it's easy, which isn't the same thing [0]. More specifically, Python makes easy things very easy, at the expense of making difficult things even more difficult.
I'm not sure emphasis on very is justified. C++ is a very complex language. Python is just... complex, like every real world language is.
What `instance.foobar` actually does: https://blog.ionelmc.ro/2015/02/09/understanding-python-meta...
Unless `instance` is actually a class, in which case it does: https://blog.ionelmc.ro/2015/02/09/understanding-python-meta...
Unless it's looking up a special method (`__add__` etc), in which case it does something different again.
This is much more complex than say, Ruby, which does the same thing in all three cases.
No, there are many examples of extremely simple languages. A modern lisp like Clojure would be near the top of my list. Even Haskell, with all of its warts, is much simpler than python.
Can you elaborate on this?
Also, IMO Python's type system isn't robust enough for complex projects. Simple scripts manage fine with dynamic typing and/or ad-hoc type hints, but as a project grows there becomes a point where even `mypy --strict` is not enough and a proper statically-typed language would be a better choice.
I burned myself with Micropython. Sometimes the syntax was wrong but the worst was that reading an input did not gave the desired result. You had to run it twice.
What are some actual simple modern languages then?
I'd put Python in the second tier of complexity - below C++, but on par with languages like Rust and Swift.
An argument could be made for Go, although personally I don't find it simple in the ways that matter most.