The proponents believe that 'shorter = more readable'.
And if they would try to make it more readable it would start looking like Scala and C# (hence their popularity).
Keeping names informative is a good thing. Keeping names small enough that you don't have to scan across half a page when they are used is a good thing. Keeping thunk definition separate from control structures where it is used, when it's more than a line or two is generally a good thing. Finding the sweet spot when these and many other rules conflict is where experience comes in, and is part of the art of programming.
Haskell syntax works great for Haskell, because the whole language has consistent syntax for things like lazy evaluation and lambda functions. The problem is when people try to tack on those features to Swift or C++ and make it work with the ugly syntax from those languages, it ends up making it even uglier.
To me, the sample code looks like a bastardized mix of C++ and Haskell, and it's pretty hard to figure out what it's doing, even in the toy code samples.
Edit: Doug was of course also the principal author of the failed C++11 Concepts proposal
It's OK to wonder "Can I do this one one line?" as long as you can step back and say "Yes but I'm not going to" sometimes.
Simple is better than complex.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
I too have a tendency to overuse list comprehensions over regular loops, but when they start nesting I know it's almost always time to break it up. for view in sequence(first: someView, next: { $0.superview }) {
// someView, someView.superview, someView.superview.superview, ...
}
Seems rather handy.[1]: https://github.com/apple/swift-evolution/blob/master/proposa...
https://gist.github.com/austinzheng/dbee353163eb22920d7a567c...
To be quite honest, I've found in the last 5 years a lot of professional developers have lost sight of the maxim that brevity is not better than clarity.
http://ctarda.com/2016/05/clarity-is-more-important-than-bre...
Is it just me, or is that code example incredibly byzantine? I know I'm only a Swift dilettante, but that struck me as the kind of code we want to actively avoid building.
The conceptual grouping, the syntactic grouping and the line layout grouping seem to be carrying three contradictory messages about structure, requiring careful parsing to grok.