Re:Examples of Incorrect Abstractions in Other Languages
by oh_sigh on Tuesday May 19, 2020 @11:13PM
(#23242948)
But in almost all of the langauge, TOOWTDI is not strictly enforced, it is merely a highly encouraged convention. For example, why am I allowed to do
but also do
That's two ways to do the same thing, and I bet you would find a lot of the latter in beginner's python code. I think a better choice would to just have a linter which enforced the correct usage of sum() and join(), and not the implementation itself.
[ Parent
| on HN ]
Re:Examples of Incorrect Abstractions in Other Languages
by lgas on Wednesday May 20, 2020 @12:08AM
(#23243206)
There's probably a lot more than two ways too, eg.
mylist = map(lambda x: x * 2, range(1, 10))
Re:Examples of Incorrect Abstractions in Other Languages
by fractalb on Wednesday May 20, 2020 @02:53AM
(#23244022)
map will return an iterator, not a list