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

But it brought along its own footguns. The article has one example

> For example, we had a major production bug in the fall of 2013 due to a misplaced space character.



Definitely my experience. Implicit returns are just a breathtakingly bad idea and I have personally witnessed them cause countless bugs.


I 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.


Interesting, I've never heard complaints about implicit returns before. I really enjoy them in languages like rust. What kind of bugs?


I 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.


That just seems like a poor choice of api design for forEach, rather than a fundamental problem with implicit returns.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: