this post was submitted on 25 Oct 2026
371 points (95.1% liked)

Programmer Humor

33844 readers
1559 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 3 years ago
MODERATORS
 

Mine is that the useState hook is an actual plague on the entire React ecosystem. Regardless of your opinions of React, if you wanna use something then use it right.

you are viewing a single comment's thread
view the rest of the comments
[–] danhab99@programming.dev 3 points 2 days ago

A bunch of weeks ago the CTO of my company calls me up to ask about my prejudice against the useState hook, I'm guessing I've just been giving my team too much shit in code reviews about them using useState hooks and they went to complain to him and he asked me to explain what the value of the useReducer hook was.

His background is Java, Microsoft Java, C++, and not much else.

So I was able to explain to him the value of the useReducer hook is a lot like the common class object. In useReducer you're expected to write discreet state mutations and the state could potentially have more than 1 primitive field that gets mutated, and that's just what object classes are! In an object class you're writing methods for mutating the underlying state, the reason I think most people don't feel like these two things are the same is because of the functional appearance of the reducer function and how in object classes you have the this as a variable just like any other, so you're not returning a new state.

So just like in react where they're installing REDUX (like three generations of their families would be massacred if they didn't) just to write a switch case statement that puts the action in variables in the state. Bad programmers are just bad.