Live data from Hacker News

Am I wrong in hating React JS?

medium.com

11–20 of 40 posts

Re: Am I wrong in hating React JS?

#11

What may help is to change your perspective, and to change your word choice. It's not hate. It's definitely not hate. You don't like React, and that's perfectly fine. "Hate" has some very specific, very negative connotations that make almost impossible to have a regular conversation. One of my mentors uses the term "stop words". Hate is on that list of words that, when used, stop the conversation in its tracks. It's…

Thank for the feedback. It might have not been obvious in my article but I am definitely open to changing my mind about stuff and I gave 2 examples: Ember & VIM. So just because I hate React now doesn't mean I will not be a fan later.

Re: Am I wrong in hating React JS?

#12

To reply to your complaints: > I hate html in javascript. I hate JSX. At least it's just HTML and JavaScript. In my opinion it's better than learning a new messy templating DSL, i.e. {{::item.name}} > I hate the lack of CLI. I hate the ridiculous amount of shit I have to do to simply get a project started. You can use the official Create React App CLI [1]. > I hate the sheer amount of boilerplate code and the verbosi…

You definitely have to learn a DSL - in JSX you have to use className instead of class for the HTML tag property. There are a few other examples of this, but the point is the argument doesn't hold water against Angular's templating language.

Re: Am I wrong in hating React JS?

#13
You're not wrong in hating React, but it is a fad as much as no one wants to believe it. The reason I believe is because no matter how strong the framework, eventually it will be adopted (to some extent) into the native language (which is a good thing). Think about these frameworks:

- jQuery

- Coffeescript

- Backbone

at the time, if I had asked you if those were a fad, you'd think I was crazy. And yet, because of native language enhancements, none of those frameworks are really needed anymore. And I'm sure in 5 years React, Angular, Vue, Ember...you name it, will also likely be a thing of the past.

The important thing that I've learned in my (so far very short) career is that it's always best to know the language first, and the framework second. Frameworks come and go, but the language is permanent. By knowing the language really well, it's strengths and weaknesses, it enables you to determine when a framework is helpful...and more importantly, when a framework is a hindrance.

As an anecdotal example, I had a client that was using a React boilerplate on NPM to do a Foursquare API request. React is like, 50k lines uncompressed? To do that? I was able to replace it with 22 lines of vanilla JS. If you don't know the base language, it's often easier to simply think in the framework and create a bloated environment for very basic things rather than just use what the language gives you. It's faster, it's cleaner, it's more widely supported in browsers, has a larger community, and is more defensible to use the base language than a framework, until the framework does more work to help you than harm you.

So my advice would be, if you're thinking about using React or Angular, think about why you need it. Are you doing heavy lifting on the front-end, like interactive graphics or a dashboard? Sure, those are probably pretty good choices. If not, and you're simply trying to make the front-end more RESTful, with some easier reasoning about your applications, you could probably get away with a lighter framework like Mithril, Elm, or another lightweight framework.

Re: Am I wrong in hating React JS?

#14
You are probably just experiencing change aversion, also known as "getting older". It's normal to have these feelings.

There were people who programmed in assembly and hated compilers and C. There were people who programmed in C and hated Perl. There were people who programmed in Perl and hated PHP. There were people who programmed in PHP and hated Ruby. There were people who programmed in Ruby and hated that JavaScript suddenly was a "real" programming language.

You'll probably be able to find work in your language/framework of choice for a long time, although as time progresses it will be less "hip startup" and more "enterprise" (look at C#/ASP.NET) and "banks" (look at COBOL).

Re: Am I wrong in hating React JS?

#15

To reply to your complaints: > I hate html in javascript. I hate JSX. At least it's just HTML and JavaScript. In my opinion it's better than learning a new messy templating DSL, i.e. {{::item.name}} > I hate the lack of CLI. I hate the ridiculous amount of shit I have to do to simply get a project started. You can use the official Create React App CLI [1]. > I hate the sheer amount of boilerplate code and the verbosi…

JSX can also be a hard sell for seasoned developers because they've been taught to avoid combining HTML and JS for so long. I initially disliked the Angular templating system because it felt like I was regressing to `on-click="javascript()` code.

While I prefer JSX now, mainly because it is just html/javascript, I sometimes feel that inline conditions/loops like `ng-if` are cleaner - I don't need yet another several lines of a `var` definition, condition, and assignment.

My biggest struggle with React was due to the fact it's a view-only library. Coming from Angular or similar projects you're suddenly in the dark on how best to manage ajax, forms, etc - yet when you power through, you realize it's actually freedom to do whatever you want. Done correctly, that's way more powerful.

Re: Am I wrong in hating React JS?

#16

To reply to your complaints: > I hate html in javascript. I hate JSX. At least it's just HTML and JavaScript. In my opinion it's better than learning a new messy templating DSL, i.e. {{::item.name}} > I hate the lack of CLI. I hate the ridiculous amount of shit I have to do to simply get a project started. You can use the official Create React App CLI [1]. > I hate the sheer amount of boilerplate code and the verbosi…

You definitely have to learn a DSL - in JSX you have to use className instead of class for the HTML tag property. There are a few other examples of this, but the point is the argument doesn't hold water against Angular's templating language.

Learning a few differences for attributes names isn't nearly as involved as learning angular's entire custom attribute and syntax support though.

I would also add that for any web app truly utilizing these libraries, you're going to have to know how they get compiled and where your data is coming from. With Angular you have to learn about scopes, digesting, linking/compiling, etc.

Two-way binding was amazing to me when I first took up Angular, it made common tasks so easy but on an enterprise-level application it's a nightmare because you're quickly dealing with digest/event cycle issues, especially during automated testing. The control over data flow that React prefers makes the easy, common tasks more time consuming, but overall saves a massive amount of complexity.

Re: Am I wrong in hating React JS?

#18

I'm with you on the embedded HTML in JavaScript files. There's a reason everyone went nuts for MVC, the seperation of UI code (in my opinion) just makes your life as a developer easier.

There is still a separation of UI code, though. React components are just your view layer.

Re: Am I wrong in hating React JS?

#19

You're not wrong in hating React, but it is a fad as much as no one wants to believe it. The reason I believe is because no matter how strong the framework, eventually it will be adopted (to some extent) into the native language (which is a good thing). Think about these frameworks: - jQuery - Coffeescript - Backbone at the time, if I had asked you if those were a fad, you'd think I was crazy. And yet, because of nat…

> at the time, if I had asked you if those were a fad

I still wouldn't call jquery a fad, just obsolete

Post reply on HN