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
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
- If the mod doesn't find it funny, you're banned. Ha-ha!... For real: do not use the community for "statements". There are other places for such content. Keep it chill and funny.
founded 3 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
A bunch of weeks ago the CTO of my company calls me up to ask about my prejudice against the
useStatehook, 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
thisas 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.