3 ms·
Definitely my experience. Implicit returns are just a breathtakingly bad idea and I have personally witnessed them cause countless bugs.
by agency 6y ago
Definitely my experience. Implicit returns are just a breathtakingly bad idea and I have personally witnessed them cause countless bugs.
- city41 6y agoI think they can be ok in a language where it’s been well thought out. Like implicit return in clojure has never bugged or surprised me.
- sullyj3 6y agoInteresting, I've never heard complaints about implicit returns before. I really enjoy them in languages like rust. What kind of bugs?
- agency 6y agoI recall several resulting from the fact that lodash's _.forEach terminates iteration early if the function you pass it returns a falsey value for any element. Most people (myself included) weren't aware of this functionality and thought of the callback as a void function and weren't even thinking of what the last expression in it would evaluate to.
- sullyj3 6y agoThat just seems like a poor choice of api design for forEach, rather than a fundamental problem with implicit returns.