Live data from Hacker News

React I love you, but you're bringing me down

marmelab.com

171–180 of 574 posts

Re: React I love you, but you're bringing me down

#172

Earlier quoted context omitted.

Step 1: The existing tooling is too clunky, big and a major PITA to work with, Developers spend most of their time fighting their framework and tooling to do simple things. Step 2: Someone gets fed up with this writes a framework that "does things right" and is designed for "simplicity" Step 3: People start loving the new tool because it is so much easier to work with. Step 4: People start to do things the tool wasn'…

This tired argument has been trotted out repeatedly, and isn't really funny anymore. It's just old and boring. For people like me who are new to JS and use these sorts of discussion to determine which technologies I should adopt first, it's really just pointless noise in the channel. The little I know about JS so far, I definitely know this joke is tired and played out. Step 2: Get a better joke please?

It is because its true and once you get through the endless cycles of your newly chosen framework you will adapt a similar mind.

Re: React I love you, but you're bringing me down

#173

As a developer who’s been working with React since the beta, I can confidently say that the author is speaking the truth. Especially so near the end of the article where they can’t seem to quit React. For all the annoyances of Hooks, they really are a godsend when it comes to composing state. And refs do indeed suck, but they sucked even more with class based components. I can’t tell you how many times I was able to…

I just use vanilla JS on the front-end just like I do with Node.

I have never understood why people find state management challenging. I suppose its because they are stuck in a framework or MVC mindset where everything is a separate component and each must have separate state models that must be referenced frequently and independently. I just put all my state data in one object, save it on each user interaction, and use it only on page refresh. I have an entire OS GUI working like this and the state management part is only a few dozen lines of code.

Frameworks are like being locked in an insane asylum. You may not be crazy, but everybody else is and you have to follow all these extra rules you would never follow with freedom in the real world. But, the insane asylum provides you meals and bedding and many people can't be bothered to figure that stuff out without necessary hand holding.

Re: React I love you, but you're bringing me down

#174
post #11

Maybe I’m a React apologist, but this list of complaints seems mostly self-inflicted. > Form libraries are portly maintained or documented The two-way data binding in Svelte saves ~4 lines of reusable hook function but doesn’t come close to covering defaults, validation, errors, dependent fields etc - all of that is essential complexity. Write your own form field hook. The state model for a form is simple - what is a…

To emphasize the dependency tracking part: being able to control when you want hooks to run is really powerful. Automatic isn’t always better

Re: React I love you, but you're bringing me down

#175
post #157

Earlier quoted context omitted.

I don't have a strong opinion either way but if you left React because you are frustrated with code becoming obsolete and picked up Hotwire, a significantly smaller framework, arnt you likely to run into the same problem if Hotwire doesnt end up being the next big framework? In 5 years if no one else is using Hotwire then your code is obsolete, no? I liked working in next.js in the past but my company was already tal…

In 5 years if no one else is using Hotwire I think that's the opposite of what he is saying. Because React is updated and changes frequently, your code becomes obsolete unless you update to follow the latest changes. In theory, if everyone abandoned Hotwire, your code would never be obsolete or need changes, because Hotwire would never change. In reality, as browsers and web standards change, frameworks need updating…

React doesn't change frequently though, that's the point. And it has always had excellent backwards compatibility. Class components are still fully supported, for example.

Re: React I love you, but you're bringing me down

#176

Earlier quoted context omitted.

No, you're not the only one. Apart from useState, which is elegant, I hate others with passion. How can a replacement for lifecycle methods be called useEffect? Seriously? Great article, couldn't agree more with them.

> How can a replacement for lifecycle methods be called useEffect? Seriously? Yes, seriously. Have you used it for more complex components? You can split your effects across multiple useEffects, and have a guarantee that they run completely independently of each other (especially since you know what their dependencies are). Compare that to lifecycle methods: you only have one per component. All your effects concerned…

That didn't require the meta language and rules of hooks though, they could have added this.addEffect(callback, deps) or something to class components. To preserve back compat they could have added a new base class you inherit from to get access to new APIs.

Most of hooks could have been done incrementally on top of classes.

Re: React I love you, but you're bringing me down

#177

I must be the only person in the world who likes class components in React. Sure, it's often overkill and a functional component does the same thing with less code. Use a functional component in these cases. But if you're doing something more complicated then stop treating class components like the fucking devil. They have their place.

They absolutely do not have their place. Just about everything is worse with class components. I’ll take a dozen useEffects over a single class component any day.

That said, the hooks model is far from perfect. They give you a lot of rope to hang yourself with and were badly introduced. Within weeks the internet was ablaze with terrible advice.

When so many people get it wrong, the library is to blame. And I wish hooks were as robust as Solid.js’ signals model.

Re: React I love you, but you're bringing me down

#178

Hmm… let me be frank about my experiences with React. I’ve been using React heavily for far over 6 or 7 years. React is amazing. And what I see is that people find so many ways to shoot themselves in the foot. At the same time, I understand that batteries-not-included approach will lead to that result. First of all, people get out of their skin and try to make it a complicated and entangled mess. In programming, ther…

I think this is a variation of Jevon's Paradox.

The more power we give to developers - by simplifying, abstracting, optimising - the more they want to achieve, the faster they want to do it, the less effort they want to spend.

Which puts them right back in the position of working under complexity.

The reason people are now complaining about React is that React made writing 2015 webapps extremely easy. The result was our appetite and ambition stretched to 2022 webapps and we blame the framework for making things harder, not ourselves.

Re: React I love you, but you're bringing me down

#179
post #77

Earlier quoted context omitted.

What is a teaspoon?

Yeah, I also didn't get the 'teaspoon' reference.

German word for teaspoon per googling it on the bing: Teelöffel

Seems like the obvious abbreviation for that is TL, so it's a joke on cross-language abbreviation collision.

Re: React I love you, but you're bringing me down

#180
post #157

Earlier quoted context omitted.

I don't have a strong opinion either way but if you left React because you are frustrated with code becoming obsolete and picked up Hotwire, a significantly smaller framework, arnt you likely to run into the same problem if Hotwire doesnt end up being the next big framework? In 5 years if no one else is using Hotwire then your code is obsolete, no? I liked working in next.js in the past but my company was already tal…

In 5 years if no one else is using Hotwire I think that's the opposite of what he is saying. Because React is updated and changes frequently, your code becomes obsolete unless you update to follow the latest changes. In theory, if everyone abandoned Hotwire, your code would never be obsolete or need changes, because Hotwire would never change. In reality, as browsers and web standards change, frameworks need updating…

All the class components people wrote still work and can be maintained. React doesn't overhaul everything like Angular did. You can have function components with hooks and also have your old class components in the same app.
Post reply on HN