News for hackers. Stuff that matters.
Re:Why I Prefer Functional Programming by fnord123 on Thursday September 19, 2019 @05:51PM (#21021077)
This looks like the Java if the Java was written by someone who knows Java:

    List<String> alignText(List<String> texts) {
      int maxLength = texts.stream().mapToInt(String::length).max().orElse(0);
      return texts.stream().map(text -> {
        var spaceCount = (maxLength - text.length()) / 2;
        return " ".repeat(spaceCount) + text;
      }).collect(Collectors.toList());
    }
Re:Why I Prefer Functional Programming by p2t2p on Friday September 20, 2019 @03:46AM (#21024144)
/nit Move the lambda to private method and replace it with method reference and it’ll be just perfect
Re:Why I Prefer Functional Programming by fnord123 on Friday September 20, 2019 @05:36AM (#21024827)
Good feedback. +1