Hacker News new | ask | show | jobs
by ericand 2855 days ago
I recently went through a framework selection between React, Vue and Angular. I ended up with React for reasons typified by this post. There is a massive community and a great dev team (Facebook) interested in evolving and improving React over time.
3 comments

We use Angular a little bit at work, and I've been meaning to try Vue or React, but every time I start to setup the tooling, I get this sense of fatigue that's hard to describe. I feel like I have to throw away my Angular investment and start from scratch again. So, I continue to stick with Angular, which doesn't seem too bad.

On a side note, why is Angular CLI so big (71 MB)? Seems like I could write a couple hundred kilobyte python script that does the same thing (or maybe I'm only using like 10% of its features, idk).

You're asking about `angular-cli`, but I see the same question all the time in regards to Create-React-App. I'll paste in my standard answer on that topic:

The set of dependencies that CRA uses includes:

- A compiler

- A bundler/linker

- An optimizing minifier

- A linter

- A development server with live reloading

- A test runner

All of those are isolated and scoped to that one project, and they are all build-time dependencies only. It's also important to understand that Javascript packages are effectively distributed as source, which affects the number of files on disk. (Granted, many NPM packages do include unnecessary files in the published artifacts, but Javascript itself is a major factor there.)

Meanwhile, XCode is supposedly something like 8GB installed, Visual Studio is multiple gigs, and if you were to look at the actual file size on disk of any C++ compiler toolchain, that would be a minimum of several dozen megs - those are just usually preinstalled on Linux or Mac systems.

So, context is pretty important here. 70MB for a complete JS build toolchain is perfectly fine :)

For context CRA is 160 MB ish with all dependencies installed.
I worked with Angular 5 for about half a year. It get's the job done once you've learnt it — but the problem with Angular is that it has its own way of doing things and its own concepts. "The Angular investement" is an investment in just Angular, to me that felt like a dead end, it's not transferable knowledge. React is a much more lightweight library and you use mostly bare bones JS.

Though I actually wish React was more of a framework in the sense that it enforeced, or at least encouraged, a certain folder structure and a curation of state management, Ajax libs etc. A bit more standardization would make it more convenient to use in teams.

In some ways I would like react to be more of a complete framework like you, but I worry they would do it “wrong”. Wrong, of course, is defined as not what I want.

I’m a long-time Java developer but I’ve just started using React. I, for example, would like to have the file layout be much closer to the standard maven layout. It’s what I’m used to and it works extremely well. But I completely understand why other people don’t do it that way. And since you don’t have to 100% follow some official way I’m free to set things up in a method that’s more convenient for me if I need to.

Unlike other libraries I’ve come across in my career I do like that to react community seems to have settled pretty well. Straight react is there, and read access popular enough that it’s very easy to find what you nee unlike other libraries I’ve come across in my career I do like that to react community seems to have settled pretty well. Straight react is there, and redux is popular enough that it’s very easy to find what you want to know.

When it comes to tools you have a very large number of choices, but the existence of create-react-app makes things easy. Even if you don’t use it to setup your project Babel, Webpack, and Jest are pseudo-official tools that most people seem to use. You don’t have to use them, but you also don’t have to evaluate five choices and try and pick one.

Somethings aren’t quite as clear-cut, like flow versus typescript if you want type checking.

But by and large all seems to work very well, it’s FAR better than I was expecting from the JavaScript ecosystem based on past (and admittedly very old) experience.

I would recommend basing your frontend "investment" around webpack. It's the common denominator that all the frontend frameworks use, and while it's fairly complex, it's complexity that only needs to be learnt once, and unlocks a lot of powerful functionality.

The frameworks themselves aren't that difficult to learn. Since Angular 2, they all work in a pretty similar way...

If by similar you mean they all have some component paradigm...I guess. But the cost of learning Vue, React, and Angular to a high level of proficiency is significant.
I'm working on rewriting an application from a React-like VirtualDOM approach to "ordinary" React components for a similar reason in that while my original approach had many things going for it (was theoretically more performant than React DOM, at least some of the time, according to benchmarks), it really is hard to beat the overall ecosystem around React today. Some things I never got around to doing with the old approach have out-of-the-box React controls and I don't really have to do anything to get those behaviors versus feeling like I was writing the whole world from scratch.
I recently went through same thing at our company and decided on angular. I really appreciate the overall framework architecture angular provides. React doesnt really give that
Angular is a batteries-included full-fledged framework. React is a small view lib. Apples:oranges. Or, rather, apple orchard:orange.