Hacker News new | ask | show | jobs
by qwertyuiop924 3815 days ago
Fair 'nuff. I probably fall into the "mimic FP" section above, as I REALLY like functional abstractions. Although I don't do much pure FP. And I don't look down on anybody who can't ELI5 monads and functors. Monads and functors are confusing.
1 comments

It's all good. My comment was more of a friendly jab than a direct criticism. I agree that FP concepts are amazing.

I just don't see the utility in trying to translate pure FP concepts directly to JS. Same goes for the Typescript folks with OOP abstractions and design patterns. It's like watching a pissed off New Yorker rant about how the pizza shops in LA suck. Live a little and try a California burrito. It might change your life.

The point being, neither approach has provides measurable benefit to runtime performance/stability. They're nothing but really complicated abstractions whose sole intent is to protect devs from themselves. Why don't we build better tools to assist devs instead of inventing yet-another-feature-specific-language?

I think FP abstractions translated to JS could work as amazingly useful design patterns. Hopefully, decorators will make it a lot less painful to define higher order functions in JS.

Likewise, static type alike languages are very useful as a bridge to traditional OOP devs. I think gradual typing is a better long term approach.

...Don't you mean arrow functions? Decorators don't seem like they'd help with that.

And yeah, I don't think that monads are that useful JS. And OO is different in JS. Deal with it.

Also, if you use Strategy, Iterator, or Visitor patterns in JS by writing classes for said things, you deserve to be punched in the face really hard. Repeatedly.