Live data from Hacker News

An experienced Javascript developer’s account of learning React

medium.com

21–30 of 157 posts

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

#21
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?

I don't see where the parent suggested no framework. It's likely he or she prefers working a different framework or library, like vue.js or even jQuery.

For me, jQuery is the bare minimum requirement. I would never attempt to write a large app in pure JS, even with babel. You would definitely run into some of the problems you mentioned.

EDIT: I see now where he mentioned no-framework JS

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

#22

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.

You can have complex logic and functions in JSX but that doesn't mean that you have to, so the example is very contrived. That way of writing the code is completely discouraged in the documentation and I haven't run across it often or at all in the real world.

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

#23

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

No, you should be fine. If it starts to get painful to pass around props, investigate Redux or MobX rather than using context by hand.

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

#24

Earlier quoted context omitted.

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?

I don't see where the parent suggested no framework. It's likely he or she prefers working a different framework or library, like vue.js or even jQuery. For me, jQuery is the bare minimum requirement. I would never attempt to write a large app in pure JS, even with babel. You would definitely run into some of the problems you mentioned. EDIT: I see now where he mentioned no-framework JS

I really don't see how jQuery would help you much there. It doesn't provide any sort of common structure at all, and it's nowadays arguably not very helpful for its helpers either.

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

#25
post #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...

I've had the same experience. It took me about a week to "get" Redux as a new-ish dev back a year or so ago. Why do you think people have trouble with it?

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

#26
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 dislike being the guy who things that 'everything sucks' but the things I've seen come out of React have been horrifying. Very few websites even require anything that React provides nor do most webapps need to be webapps. I've come across bugs where simple text boxes were crashing the browser. Fixing that bug took the front end three days because they simply had no idea how to fix it because everything was buried i…

Sounds like a case of bad developers. Obviously, plenty of sites that use React do just fine.

That said, I've had those frustrations at work and wishing in my head that our SPA was a server-rendered app instead.

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

#28
post #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...

I've had the same experience. It took me about a week to "get" Redux as a new-ish dev back a year or so ago. Why do you think people have trouble with it?

I've found it really easy once I stopped thinking about it in the way it's presented at all. The use of the term "action" is especially misleading. Easier to think of it as two event dispatchers hooked together (which is more or less what it is).

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

#29
At our company, we have banned React, Angular and other "overengineered" JS frameworks.

Our HTML is rendered from a standard boring Groovy server page, with some vanilla-js for DOM manipulations here and there.

We have hired developers that were React fans, which quickly changed opinion that this old-school way for developing web applications is indeed better. It is faster to code, an order of magnitude easier to maintain, DOM rendering time is faster, so a click to open a new page/view happens instantly. Our web application is so fast, that non tech people and clients always comment how smooth and slick it behaves compared to Facebook or LinkedIn.

Our clients are very happy with our solution too, as it is very simple for their developers to integrate our solution into their web application since it doesn't mess up their existing web framework. It doesn't block their rendering time, and it is easy for them to override changes.

We also have one complex UI part in our application, which can consume some CPU. This part we render with canvas, and it feels like a native app as it runs stable at 60fps. Who wants to run a lot of slow DOM manipulations when canvas is a lot more efficient.

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

#30
post #24

Earlier quoted context omitted.

I don't see where the parent suggested no framework. It's likely he or she prefers working a different framework or library, like vue.js or even jQuery. For me, jQuery is the bare minimum requirement. I would never attempt to write a large app in pure JS, even with babel. You would definitely run into some of the problems you mentioned. EDIT: I see now where he mentioned no-framework JS

I really don't see how jQuery would help you much there. It doesn't provide any sort of common structure at all, and it's nowadays arguably not very helpful for its helpers either.

> write a bunch of code to deal for various browsers

jQuery helps here

Post reply on HN