Live data from Hacker News

An experienced Javascript developer’s account of learning React

medium.com

11–20 of 157 posts

Re: An experienced Javascript developer’s account of learning React

#11
post #2

React popularity seems to me the result of wrongly-headed thinking: that because facebook is popular, any technology behind it must be good, and because react is popular (allegedly), react must be good. I've always been very sceptical of react, and I'm glad I didn't invest too much time looking into it, as it seems both a time sink and a boilerplate-filled approach. I wonder why some people like it, writing no-framew…

I am not a js dev, but isn't the issue of no-framework that you have to write a bunch of code to deal for various browsers? And a bunch of more code to deal with basic web patterns that you'll end up copying from project to project?

Re: An experienced Javascript developer’s account of learning React

#12
The best explanation I've seen for why React is such a pleasant experience, is that it's a text-based version of the best parts of Visual Basic - you use React to lay out pre-built UI components, build your own new ones, and the UI behavior is a function of the properties you set.

React, and similar libraries, have the advantage of being parasitic - you can fit them in along with a lot of what's already out there, without necessarily having to rewrite what you've already build. I.e., you can easily use UI frameworks that are agnostic to Javascript library pairings.

As an example of this, I built https://www.findlectures.com/ with TypeScript + React, starting with no CSS library, then added bootstrap, then replaced Bootstrap with Semantic-UI. This makes me appreciate some of the flexibility of the ecosystem now, even though it comes with the pain of having too many options for a lot of the individual components.

Re: An experienced Javascript developer’s account of learning React

#13

I don't think the `className` argument sticks. `class` is reserved so you can't use it. It's annoying but not a difficult concept The other points are valid though. Mobx/Redux seems like a solution for big applications, but what's the alternative for small-to-medium React applications that still need to store state? I agree I had issues following the snippets (and for one snippet I would definitely have to check MDN…

It's valid. className was a frequent annoyance with React. That's one of the nice things about Vue. I can paste HTML snippets and they just work. I can't say it's the reason I switched, but it was some icing on the cake.

Re: An experienced Javascript developer’s account of learning React

#14
Regardless of these complaints, the job market for React is just too damn good to ignore. I bit the bullet and began learning. As a newbie, I understand the sentiment of this article. However, it's really not as bad as the author makes it out to be.

Also, className instead of class took all of 3 seconds to learn.

Re: An experienced Javascript developer’s account of learning React

#15
> Then imagine to meet a dev from the future telling you that in 10 years anyone will be writing their app routers in Javascript in this way

Yeah. The first time I saw JSX presented as something Super Serious and Obviously Fine, We Don't Even Need To Talk About It I thought I was being trolled.

I'd agree that if you'd floated this sort of syntax anonymously, even shortly before React came out, the overwhelming response would have been "LOL what talented but horribly misguided junior high student thought up this nightmare-haunting terror? Lurk moar n00b."

Re: An experienced Javascript developer’s account of learning React

#16

I don't think the `className` argument sticks. `class` is reserved so you can't use it. It's annoying but not a difficult concept The other points are valid though. Mobx/Redux seems like a solution for big applications, but what's the alternative for small-to-medium React applications that still need to store state? I agree I had issues following the snippets (and for one snippet I would definitely have to check MDN…

Am I doing something wrong on small-to-medium applications by simply using setState? I always worry about this, even if Dan Abramov blessed it.

Sometimes I need some more global stuff, which I have solved in the past using context but I feel like maybe I'll just hook up some small mobX store in the future... Not sure

Re: An experienced Javascript developer’s account of learning React

#17
post #2

React popularity seems to me the result of wrongly-headed thinking: that because facebook is popular, any technology behind it must be good, and because react is popular (allegedly), react must be good. I've always been very sceptical of react, and I'm glad I didn't invest too much time looking into it, as it seems both a time sink and a boilerplate-filled approach. I wonder why some people like it, writing no-framew…

I am working on a web application that is dynamic enough that the standard way to build websites makes it really hard. So I started building my own version of React. Found React some time later and switched because it was better than my crappy code.

Why was I trying to build React? I wanted a framework that behaved more like a video game render loop or a desktop UI framework. I wanted a framework where I could simply update the data and the complicated view would update itself efficiently (as few draw calls as possible). I wanted a framework that felt like those much better tools (in my opinion) I was used to on the desktop.

React is the very first web framework to do that and it was a huge breath of fresh air for me. However that does not mean every website needs to be built with React. In fact it is probably overkill for most websites.

Re: An experienced Javascript developer’s account of learning React

#18

Why is mixing HTML into your code in PHP bad? Because it mixes presentation and logic. Why is mixing HTML into your code in React good? Because it isolates all the view code for a single component in a single file.

In his example in the pre-preface there was quite a big amount of logic.. I don't really see the point in your post looking at that code.

Re: An experienced Javascript developer’s account of learning React

#19
post #2

React popularity seems to me the result of wrongly-headed thinking: that because facebook is popular, any technology behind it must be good, and because react is popular (allegedly), react must be good. I've always been very sceptical of react, and I'm glad I didn't invest too much time looking into it, as it seems both a time sink and a boilerplate-filled approach. I wonder why some people like it, writing no-framew…

I can only speak for myself, but I only use React because it solves massive problems with building complicated apps in Javascript. (This value has been explained in countless other places here, so I won't repeat it here.)

I actually use it in spite of Facebook, not because of it.

Re: An experienced Javascript developer’s account of learning React

#20
I am confused why people think Redux is complicated. Maybe you were trying to use React-Redux? Redux itself seems incredibly simple to me, so simple that I sometimes wonder if I need a library for the functionality at all.

This "Redux in a nutshell" sums up the simplicity nicely I think: https://gist.github.com/MarcoWorms/30758235f05faec844b8c06ce...

Post reply on HN