Substitute {{x}} for Python and you have a template for a Hitchhiker's Guide entry for just about every programming language, ever.
Substitute {{x}} for Python and you have a template for a Hitchhiker's Guide entry for just about every programming language, ever.
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.
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.
"There are only two kinds of languages: the ones people complain about and the ones nobody uses." - Bjarne Stroustrup
(occasional lisper)
(constant lisper)