Hacker News new | ask | show | jobs
by mjijackson 5299 days 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.
2 comments

Yeah, 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.

What about something like this:

  fn = compose(truncate.flip().curry(20), trim, sanitize);
  output = fn(input);
Better or worse?
Better, since it is clear how to pass a function as an argument.