5 ms·
To be fair, Python isn’t terrible, but throughout its lifetime, it made some incredibly poor design decisions Substitute {{x}} for Python and you have a templa
by stcredzero 10y ago
To be fair, Python isn’t terrible, but throughout its lifetime, it made some incredibly poor design decisions
Substitute {{x}} for Python and you have a template for a Hitchhiker's Guide entry for just about every programming language, ever.
- oxryly1 10y agoYup. And Python is certainly one of Stroustrup's two kinds of languages: "There are only two kinds of languages: the ones people complain about and the ones nobody uses." - Bjarne Stroustrup
- ezrast 10y agoI can't think of a language that belongs less in that dichotomy than Python. Programmers used to gush over it like crazy; they only stopped because it became ubiquitous enough that there was no point. Javascript, PHP, and C get an order of magnitude more hate.
- cat199 10y agobut lisp... (occasional lisper)
- oxryly1 10y agoYes lisp. (constant lisper)
- deleted 10y ago[deleted]
- djsumdog 10y agoI agree. The more mature developer understands all languages have their strengths and weaknesses. I really like Python myself, and it's in my top three list of languages I like (Scala, Ruby and Python -- not in any order). Even PHP, which is not a well designed language at all, has at least attempted to make core language improvements in PHP7 and has supersets like Hiphop/Hack which use the same syntax and avoid most of the insane typing pitfalls.
- ehsankia 10y agoAnd in this case, the reality is the ternary operator is just a pretty bad syntax. Most teachers generally tell you to stay away from them and a lot of style guides do too. Python tried to make it more english-like just like many other of it's syntax (using and/or/not instead of && || !) and in this case it feels strange to experienced programmers who are not used to it. That being said, if you show this and javascript one to someone who's new to programming, they'll for sure understand the Python one better. Still, again that's where style guides come in. I've been coding Python for years and rarely ever used the ternary.
- derefr 10y agoI've yet to see one of those "let me rant for ten pages about what's wrong with {{x}}" articles for Elixir, but it's probably just a matter of time.
- userbinator 10y agoThe difference to me about this is that it seems PEP308 was explicitly created to spite those wanting a conditional operator, whereas many other "incredibly poor design decisions" like e.g. PHP's conditional operator having the wrong/unintuitive associativity happened more accidentally/without explicit intent.