Live data from Hacker News

For all React coders out there, why and how?

news.ycombinator.com

11–13 of 13 posts

Re: For all React coders out there, why and how?

#11
Money. Nothing about it annoys me really, but while React is easy to get started with, it’s full of pitfalls à la C. So much of time when dealing with others’s, you see bad patterns everywhere. But it can be quite nice to work with as long you tailor the abstractions to your usage.

Re: For all React coders out there, why and how?

#12
> how you all manage to keep your mental stability in balance?

I personally don’t anymore, and currently struggling to leave frontend development all together somewhere else (thinking of Golang). As other commenters have mentioned, React.js development wasn’t that complicated when it first was introduced to the public.

Re: For all React coders out there, why and how?

#13
React is a pretty substantial shift for a lot of programmers, because it's intended to be "reactive" (thus, the name) and not imperative. You have to learn to think about things in the React way, and if you don't you're going to be fighting it.

Worse: the benefits of thinking that way are not really visible with small programs. Anything you can do in the "hello, world" range will seem harder than doing it in a conventional way.

Worst: React has gone through several substantial revisions, leaving a confused mishmash on Stackoverflow. The new ways are genuinely better, and the first few iterations were kind of a travesty.

Having gone through that pain, I find React very natural. It aims to be side-effect-free, which substantially aids debugging -- the bigger the program, the harder it is to figure out where some side effect occurred.

JSX seems to strike the right balance between HTML and code. A program "is" a web page... except when you need to escape out to Javascript, and you do that with a simple {}. That maps to how I think of a web page. (In fact, JSX is not HTML; you don't need React to write JSX and you don't need JSX to write React. And the differences can be genuinely maddening. But the lie of "It's HTML with some JS" is good enough for most days, especially when you jut start.)

There remain plenty of things to criticize about React, but when you just get started with it, most of the pain you experience will be shifting to its mindset. You'll be tempted to do things in the conventional way, and that's not going to work. It does actually become very fast to develop in because it reduces certain kinds of errors that require a lot of discipline to avoid in conventional DOM manipulation.

Post reply on HN