Re:Ruby One-Liners
by stevebmark on Friday September 13, 2019 @09:16PM
(#20968263)
If you're going to write unreadable code why not use Perl? It's much faster than Ruby. Or Awk, even though it's one of the worst programming languages ever created?
[ Parent
| on HN ]
Why is awk one of the "worst programming languages ever created"?
.. because you know Ruby and not Perl of course.
Ruby (and Perl) can and probably should be used for many tasks where you might use awk and sed and don't particularly care about performance.
One liners are not necessarily part of a codebase; one might use them for text processing on the fly.
An argument "against readability" is culture. For sysadmins, Perl is a well-known language; it's not unreadable¹. Note that the same applies to Bash, and Bash scripts are still popular. This doesn't imply that Perl/Bash scripts should be universally used, but that within a certain culture, they make perfect sense.
¹=when talking about oneliners
Re:Ruby One-Liners
by aledalgrande on Friday September 13, 2019 @11:57PM
(#20968832)
That's what I was thinking. Free to use Ruby any way you want, but this is not code I would be happy to see in my codebase.