Method chaining: Difference between revisions

Content deleted Content added
Rationale: bizarrely misplaced S
Beroal (talk | contribs)
Rationale: Dead link deleted. The claim "the difficulty humans have with deeply nested method calls" is not substantiated by the link.
Line 16:
== Rationale ==
 
[[Local variable]] declarations are [[syntactic sugar]] because of the difficulty humans have with deeply nested method calls.<ref>{{cite web|url=http://cs.uni.edu/~wallingf/teaching/cs3540/sessions/session18.html|title=Session 18 Variable References|quote=Today you learn that variable names are not necessary: they are really syntactic sugar.}}</ref><ref>{{cite web|url=https://www.cs.umd.edu/class/spring2013/cmsc631/lectures/lambda.pdf|title=CMSC 631 – Program Analysis and Understanding|quote=• Syntactic sugar for local declarations - let x = e1 in e2 is short for (λx.e2) e1}}</ref>
Method chaining eliminates an extra variable for each intermediate step. The developer is saved from the cognitive burden of naming the variable and keeping the variable in mind.