5 ms·
Where are good examples of clean, well-implemented React code by your definition? Because your comment perfectly encapsulates my experiences and frustrations in
by pdntspa 4y ago
Where are good examples of clean, well-implemented React code by your definition? Because your comment perfectly encapsulates my experiences and frustrations in learning and using React off-and-on over the past 8 years or so.
React is the one tech that really freaks me out because every time I have to dive into it, it's a completely different beast and it feels like so many people actually writing in React are just effing CRAZY
Years ago I wrote a 12-line-or-so JS "framework" that did one-way databinding, it accepted a fragment of HTML with template strings and replaced those with the data you wanted... it could handle thousands of updates without falling over (though updating the whole table would freeze the browser for a half second) and last I checked was still in production doing fine. But now nobody understands it and I'm fielding weird questions about why X framework wasn't being used in 2015 when I wrote it. And it feels like 90% of what I do in React is the same thing! (Simplifying, sure, but my point is that React feels bloated as hell and reinvents the wheel way too much)
- not_kurt_godel 4y ago> your comment perfectly encapsulates my experiences > feels like so many people actually writing in React are just effing CRAZY Same here. We had an experienced-but-batshit-crazy dev create a React site with approximately 250,000 LOC to support 3 forms with a max of 4 simple inputs and a 3-column data table view. To this day it makes my head spin how it is even theoretically possible to write that much code for so little functionality - much less _actually do it_. And don't even get me started on how unmaintainable it is - IIRC I tried to update the string content of an error message once and it required changing something like 57 lines in 10 files (or maybe it was 1 line in 57 different files? something like that...).
- molszanski 4y agoSweet pumpkins, I feel the pain. Architecture astronaut combined with a spaghetti aficionado. When one talks to people who have been around you hear amazing stories like that. thedailywtf material
- pdntspa 4y ago> We had an experienced-but-batshit-crazy dev create a React site with approximately 250,000 LOC to support 3 forms Holy moly. I've seen some bloat but that takes the cake.
- not_kurt_godel 4y agoThey essentially created a unique type for every. single. variable. I'm talking like, if you needed string constant for an error message on Input 1 on Form 3, there was an ErrorLoadingMessageForInput1OnForm3 type declared for that instead of defining it as a string. The types were never reused - like if you had the same error message on Form 2, there'd be a separate ErrorLoadingMessageForInput1OnForm2 type for the same string. And then every interaction between any 2 variables had its own type of types. Like if Form 3 was displaying the error message, there'd be a type for Form3DisplayingErrorLoadingMessageForInput1OnForm3. Which of course, is distinct from Form3DisplayingErrorLoadingMessageForInput1OnForm3AndErrorLoadingMessageForInput2OnForm3. And then those types were combined to create even more types, and so on until you had literally tens of thousands of lines of _just_ type declarations for variables and every possible permutation of UI state sitting atop a recursive pyramid of smaller subsets of the permutations (and so on until it eventually got to actual variable declarations). An then all that was piped through the craziest clusterfuck of redux butchery imaginable with a similar dynamic of explosively exponential growth of references and types and states and properties and so on. Like I said, it still hurts my brain thinking about it.
- sph 4y agoThat's not code written by an experienced dev like you said. They might have worked long enough to think they're experienced, but this is proof they're just terrible if not a complete hack that's in the wrong line of business.
- not_kurt_godel 4y agoYeah...unfortunately they managed to fool me (and the rest of the team) in the hiring process. It was a nice day when they were finally forced off but also unfortunately it's been an ongoing, multi-year scourge dealing with the codebase they left behind. It works just well enough that it's not worth scrapping and totally replacing yet (at least as far as management is concerned) but it's virtually impossible to make changes/updates to it and maintain your sanity.
- selfmodruntime 4y agoSo you're using the code of a maniac to judge an entire framework?
- molszanski 4y agoI created a blog and wrote a post as a longer version of a reply: https://dinosaurs-with-jetpacks.com/posts/react-problems.html https://dinosaurs-with-jetpacks.com/posts/react-problems.htm...
- molszanski 4y agoMy god, I've been writing a response and it is already 5K chars.. I need to make a blog post of it or something... I would love to point to a good repo, but all the apps I’ve worked with are closed source. And I haven't seen a good open one :/ Pinky promise to finish a response here or write a blog post and post a link here. But have to go now to get some sleep
- molszanski 4y agoHi there. I am sorry for a delay, but a promise is a promise. I created a blog and wrote a post as a longer version of-a reply https://dinosaurs-with-jetpacks.com/posts/react-problems.html https://dinosaurs-with-jetpacks.com/posts/react-problems.htm...