3 ms·
On the contrary, if early returns allow you to outdent a larger portion of code then it's quite a readability win. As long as all the early return cases are bi
by cryptonector 6y ago
On the contrary, if early returns allow you to outdent a larger portion of code then it's quite a readability win. As long as all the early return cases are bite-sized and the last case long-ish, it's a readbility win.
- jbverschoor 6y agoAnd certain languages allow: return nil if n.nil?
- sneak 6y agoI really miss postfix conditionals from perl/ruby/coffeescript in all of the other languages. (Along with until/unless, which are just while! and if!.) I asked on the go-nuts mailing list about perhaps including them in go2, but it seems many of the people who replied hate them.