Hacker News new | ask | show | jobs
by smokel 686 days ago
Hm, I don't think the "one way of doing things" koan holds up in practice, other than being a nice narrative.

Nearly all other languages strive for doing things in one way, it is not something that makes Python unique. In fact, Python typically offers a complete mess of ways in which to solve something. Classes are sometimes good, sometimes they're not. Lists or Numpy arrays or Torch tensors, the choice depends mostly on performance, not on style.

And Python is evolving. There is optional type checking for instance.

1 comments

The 'one way of doing things' mantra must be seen against the crazy ways of Perl (and later Ruby).
Just so. Code written in Python has always had the virtue of being _incredibly boring_, which is a virtue that, at the time of its inception, was criminally undervalued; this was, after all, the heyday of C++, and if you weren't bringing operator overloading and multiple inheritance and generics to the table, the hipsters sniffed.

For example, no one complained that Python had multiple inheritance; instead, we thought this was _a point in its favour_, over and against Java. (I imagine Guido added it grudgingly as a vox-populi.)

Thus, the Pythonic mindset emerged as a sort of 'refusal of the call', sort of like Indiana Jones shooting the sword guy (https://www.youtube.com/watch?v=kQKrmDLvijo). You could be against the hermetic complexity of Perl, but do it better than Java! Neat!

These days, however, I suspect that Python, while still boring, is boring in the _wrong_ way, leaving opportunities for concision, clarity and performance on the table -- now-basic stuff like immutable datatypes, monads, tail recursion, concatenative programming, and so on.

Python is the hobbit that stayed in Hobbiton.