3 ms·
The idea of a one-liner is sort of silly when applied to functional programming. Every lisp expression, for example, no matter how long in editor space, is logi
by abrax3141 7y ago
The idea of a one-liner is sort of silly when applied to functional programming. Every lisp expression, for example, no matter how long in editor space, is logically a single line.
- jmnicolas 7y agoTo me all (complex) one liners are bad : they're hard to read and they don't manage errors. I'd rather go through 5 lines of simple statements than try to decipher a "clever" one liner. From the fine article : > Open a GUI, read web page, sent it as email You really want to do that in one line ?
- glofish 7y agosending someone a link via email is a relatively common task. why would it be undesirable to write short code that can do that?
- abrax3141 7y agoNot undesirable, just odd to make a big deal about it. Like making a big deal about Unix pipes. Yeah, when they were invented, okay. Nowadays ... old hack.
- samatman 7y agoIt's only silly if you don't apply a reasonable character limit in your definition. I would say < 80 is definitely a one-liner, < 100 is more-or-less a one-liner, < 120 is really pushing it. After that, you're cheating. Even Java style guides cut you off after 120. 12 of these "one-liners" fail even the most permissive of these criteria, but, y'know, YMMV. None are over 140.
- Izkata 7y ago> None are over 140. Their limit is at the top of the page: > 2. How long is a line? Here, we limited users to 132 chars. It's the old line printer standard.