Hacker News new | ask | show | jobs
by yazzku 599 days ago
[num**2 for num in numbers]

There's no way that C implementation is easier to read than the Python one. There's no high-level abstraction going on there and the list comprehension reads like natural language.

I agree Rust often gets distracting with unwrapping and lifetime notation.

1 comments

I know it is easier to read, and it is not difficult to figure out what is going on (in this case), but many languages do not support list comprehensions (for example), so you have to implement it in a way that is similar to the C version, making the C version more helpful.

The example above may not highlight what I was trying to, however.

Perhaps Ada could work even better than C? It is verbose, yes, but you will immediately know what is going on.

My point is, that in my opinion verbosity is better than conciseness in cases of reference implementations.