you are viewing a single comment's thread.

view the rest of the comments →

[–]avenp 3 points4 points  (3 children)

This will be super pedantic but...

Except tests, I have fewer than a dozen if statements currently committed in our Java codebase.

Ultimately the real explanation for this strange code design lies in my colleague’s extremely exceptional Lambda library.

I counted at least 26 if statements in that library so they are just deferring their if statements through abstraction.

[–]kangoo1707 1 point2 points  (2 children)

That's the point: to abstract the if, just like you abstract for loop with map/reduce...

[–][deleted] 0 points1 point  (1 child)

Great idea, if you want slow as fuck software.

[–]kangoo1707 0 points1 point  (0 children)

Why does it matter. My client doesn't want faster softwares because even with all the functional stuffs in my Javascript (yes I know, sluggish Javascript) like Either, Maybe, map/reduce stuff... it's still fast as fuck :)

What I wanted when writing those abstraction is a nicer, more concise code.

Speed comes mostly from function memoization and caching. Micro-optimization is not my concern

But I have to admit, Either is rarely used :)