News for hackers. Stuff that matters.
Re:The Hardest Program I've Ever Written (2015) by wheresvic1 on Monday August 21, 2017 @01:57PM (#15066299)
Why do you necessarily need a line limit?

I would simply indent all chained function calls and be done with it. Eg.

   return foo(param)
      .then(bar)
      .catch(err => {
         logger.error(err);
         return -1;
      });
Re:The Hardest Program I've Ever Written (2015) by skybrian on Monday August 21, 2017 @04:28PM (#15067581)
Some style guides have a line limit (including Dart). If you want to submit code without hand-editing, the formatter needs to do it.

On the other hand, Go's style guide doesn't have a line limit, so its formatter doesn't have to solve tricky problems like this. Programmers can add line breaks by hand if they get too long. (A nice side effect is that auto-formatting your code doesn't change line numbers.)

Re:The Hardest Program I've Ever Written (2015) by xeonoex on Monday August 21, 2017 @02:51PM (#15066735)
Or just have an allowed limit for 1 liners, then indent all of it the way you suggested if it is surpassed.