3 ms·
I can see the argument for terseness in source, particularly in domains where the terseness in code reflects well-understood shorthand in the actual problem spa
by jfb 10y ago
I can see the argument for terseness in source, particularly in domains where the terseness in code reflects well-understood shorthand in the actual problem space. But stuff like that makes me itch, to be honest.
- rvense 10y agoThe alternative would be something like l.prepend(a).append(b) Horrible. Ghastly. Can't see anybody tolerating a language that looked like that.. /s
- jfb 10y agoWhat? Mutating a list? DISGUSTING!
- speedkills 10y agoIt's not mutating, its returning a new list with elements prepended and appended.
- yawaramin 10y agoIt gets even worse. Because Scala has infix syntax for method calls, you can do l prepend a append b
- snoman 10y agoDon't know Scala but why wouldn't it be a.append(l).append(b) ?
- rvense 10y agoThat would only work if a was itself a list..