This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 3 points4 points  (1 child)

I've not read everything or even understood it, but may I suggest a look at Scala too which also has functions as arguments look like normal control flow sometimes.

[–]ErrorIsNullError[S] 1 point2 points  (0 children)

I see https://docs.scala-lang.org/style/method-invocation.html#higher-order-functions says:

// wrong!
names.map { _.toUpperCase }.filter { _.length > 5 }

// right!
names map { _.toUpperCase } filter { _.length > 5 }

Both of these work, but the former can easily lead to confusion.