▲ | slightwinder 8 days ago | |||||||
> Is this what idiomatic Python has become? What do you mean? Python has always been that way. "Explicit is better than implicit. [..] Readability counts." from the Zen of python. > By contrast, here's the equivalent Ruby: Which is awful to read. And of course you could write it similar short in python. But it is not the purpose of a documentation to write short, cryptic code. | ||||||||
▲ | pansa2 8 days ago | parent [-] | |||||||
> Readability counts Almost all Python programmers should be familiar with list comprehensions - this should be easy to understand:
Instead the example uses an explicit loop, coupled with the quirks of the `match` statement. This is much less readable IMO:
> [Ruby] is awful to readI think for someone with a basic knowledge of Ruby, it's more understandable than the Python. It's a combination of basic Ruby features, nothing advanced. I don't particularly love Ruby's syntax either, though - I think the ideal implementation would be something like:
| ||||||||
|