2 ms·
I agree about Perl; haven't done a lot of one liners with Ruby when I was using the language. Perl was made to be really compact to the detriment of being hard
by abhgh 6y ago
I agree about Perl; haven't done a lot of one liners with Ruby when I was using the language. Perl was made to be really compact to the detriment of being hard to read. I think Python strikes a nice balance, and you can compress it to a point. In discussions like these I always like to bring out my one-liner k-nearest neighbor classifier [1]! Explanation here [2] (better on a desktop).
[1] https://twitter.com/AbhishekGhose/status/500564420733304833?s=20 https://twitter.com/AbhishekGhose/status/500564420733304833?...
[2] http://quipu-strands.blogspot.com/2014/08/knn-classifier-in-one-line-of-python.html http://quipu-strands.blogspot.com/2014/08/knn-classifier-in-...