Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
more consistent and readable chaining (#53748)
my goal with this commit is to make multiline chaining more consistent and readable. obviously there can be a subjective component to things like this, so I'll do my best to layout why I think these changes are objectively good. I have limited this first proof-of-concept commit to chaining on new `Collection`s, as they are a good simple example. what did I change: - convert closures to arrow functions for very simple expressions - always begin the start of a chained method (`->`) on a new line - use a single indent from the first line on new lines why I think this is better: - readability is better by not having multiple methods on a single line. no more hunting for the closing parentheses - each line serves a single grokable purpose. the first line instantiates the new `Collection` with some data. each following line runs an operation on that `Collection` - significantly improved GIT diffs. changes you see in the diff are more likely to be isolated to the purpose of the change - the single indent still gives us good alignment, without the pitfalls of trying to line it up with some arbitrary character or pattern in the starting line. it's very easy to apply consistently across many scenarios.
- Loading branch information