Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> foo.map(|x| x + 1) is so much nicer than foo.map(|x| { return x + 1; })

"Nicer" is a subjective thing. BTW in the trivial case above one may judge this or that to be nicer, but in a large method, 'return func(a,b,c)' is obvious, whereas looking at 'func(a,b,c)' it is super non-obvious that the value is being returned.



It's not at all non-obvious if you learn the language. It's also not non-obvious if you learn any of the myriad other languages with the same semantics (including popular web languages like Ruby and CoffeeScript).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: