4 ms·
> It's simple (or, at least, you can pretend it is, for casual use) I'm glad that caveat is there, because "Python is simple" is one of the biggest misconcepti
by pansa2 2y ago
> It's simple (or, at least, you can pretend it is, for casual use)
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.
[0] https://www.youtube.com/watch?v=SxdOUGdseq4 https://www.youtube.com/watch?v=SxdOUGdseq4
- poincaredisk 2y ago>It's actually a very complex language hiding behind pleasant syntax. 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.
- pansa2 2y agoThis sort of thing makes me think Python is very complex: What `instance.foobar` actually does: https://blog.ionelmc.ro/2015/02/09/understanding-python-metaclasses/#object-attribute-lookup 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-metaclasses/#class-attribute-lookup 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.
- epgui 2y ago> Python is just... complex, like every real world language is. 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.
- hollerith 2y agoScheme is famous for being "simple" where "simple" means that it takes a programmer only a few hours to learn it well enough that he can tell what a code snippet will do without running it.
- slensky 2y ago> at the expense of making difficult things even more difficult. Can you elaborate on this?
- pansa2 2y agoCompared to other languages, Python's biggest shortcomings are in the areas of packaging, performance, and parallelism. Large, complex projects are likely to run into issues with those things that could have been avoided by using a different language. 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.
- haunter 2y ago>It's actually a very complex language hiding behind pleasant syntax What are some actual simple modern languages then?
- epgui 2y agoClojure, Scheme, CL, Haskell, Lean, Janet... An argument could be made for Go, although personally I don't find it simple in the ways that matter most.
- pansa2 2y agoLua. Go (especially pre-generics). Even JavaScript is simple, compared to Python. I'd put Python in the second tier of complexity - below C++, but on par with languages like Rust and Swift.
- hulitu 2y ago> It's heavily used by non-programmers not because it's simple but because it's easy, which isn't the same thing 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.
- melodyogonna 2y agoYup. I've said multiple times that Python's superpower is in progressive disclosure of complexity. If it has better dependency story you could go a long while without being overburdened by complexity because you always learn a little more here and a little more there.