Hacker News new | past | comments | ask | show | jobs | submit login

Only if you weren't writing code for a bigco (imo) - hooks simplified a lot of enormous components to be almost readable



Can you give any example where hooks helped readability without trading it for extremely high complexity behind the scenes? I maintain a large React codebase part-time. The client is a very good friend of mine and I was the one who chose to make my own life miserable by selecting React. Needless to say I won't touch/introduce anything "new and/or popular" for customer projects with a ten-foot pole for the rest of my career.

I used both class-based (thank goodness?) and hooks based components but only coz React ecosystem forced me to, class-based were frozen and left in a sorry state - as if React's dictator-in-chief (forgot whoever they are/were, don't want to know - tried to engage once in writing the "beta" React docs but they were horribly toxic in response for no reason) is the only smart person(s) ever and all these OOP language designers are... No, dear Kim Jong(s), you were the ones abusing JS classes in strange counter productive ways and I easily found better OOP patterns for my class-based components. Then I met hooks - the definition of anti-productive. Not to say people don't have a right to write/reflect whatever madness in their code they want to but for me it's a tragedy their "work" became so popular. I don't mean to belittle people who actually have it but hooks is what comes to mind when I think of what PTSD must feel like. I no longer take up JS/TS SPA projects. For the mental strain - the pay feels peanuts compared to native mobile app development so why bother.


> enormous components

Sounds like an X/Y problem to me.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: