5 ms·
tl;dr: If you think that var output = Sugarless(input)( sanitize , trim , truncate, "", 200 ); is more readable than
by mjijackson 15y ago
tl;dr: If you think that
var output = Sugarless(input)(
sanitize
, trim
, truncate, "", 200
);
is more readable than
var output = truncate(trim(sanitize(input)), 200)
than you may be interested in Sugarless. Call me old school, but I prefer the latter.
- switz 15y agoYeah, that looks confusing as heck. Also, if I can't tell the difference between a comma and a period on your _improved language syntax_ homepage, then you're doing something wrong.
- seliopou 15y agoWhat about something like this: fn = compose(truncate.flip().curry(20), trim, sanitize); output = fn(input); Better or worse?
- DougBTX 15y agoBetter, since it is clear how to pass a function as an argument.