Nir Alfasi
Dec 15, 2024

I too once cared that a function has only a single exit point, judiciously!

Then I saw that it doesn't conform to the "fail fast" principle...

Being a senior is not following rules judiciously, it's about understanding the tradeoffs and choosing wisely.

Returning a nullified object could work in some scenarios while in others it will be a disaster!

It's all about the task; there's no silver bullet.

But I think the most important point here is something that a Zen master once said: I point to the moon and you (my disciples) see my finger: that snippet of code was clearly a made-up snippet that was trying to pass a point and instead of focusing on the point it tried to pass you are nitpicking on the snippet :)

I liked the (mis)quotes BTW!

Nir Alfasi
Nir Alfasi

Written by Nir Alfasi

“Java is to JavaScript what Car is to Carpet.” - Chris Heilmann

Responses (1)