Why I’m throwing out React and going back to Angular 1.x
medium.com
medium.com
"The stack you already know" is generally a good choice, yes. But the title is misleading and somewhat clickbait; he's not "throwing out" React; he's keeping Angular. He doesn't list any technical advantages Angular 1.x has, and in fact he labels it "obsolete" and says using it in the long term is "suicidal".
A better headline is "sometimes you gotta use the crap stack you have instead of learning a new one"; nothing he says has anything to do with specific frameworks.
Why? Most of the times is fad. Learning some select things well is way better (and more feature proof) than "learning new technologies and adapting to changing landscapes" (e.g. VB in the nineties, Java/C# later, Rails after that, Node now). One could have been a stable salaried top-end engineer in the same, non-shifting, niche the whole time...
Redux (and similar single unidirectional stores) is a paradigm shift, but seeing ever broadening adoption and similar ngrx/store for example in the angular side.
JSX as a compositional representation of a component tree is just plain useful... it's your component markup in your code, instead of code here, style there, markup over there... it's all on concern, the component. Many newer frameworks that differ from React on some technical reasons are using or suggest JSX transforms.
You get that in a more stable platform with React. Add in fetch, react-icons and material-ui you're pretty close to set... start with create-react-app and your off and running, not much, if at all harder than getting angular1 up.
And while Node is no longer growing exponentially, it's still one of the most prolific open communities around (including npm for client-side JS projects).
As to your list.. Java and C# are pretty firmly around today.
I think that's the future, not React.
Let's check back in 10 years.
>Redux (and similar single unidirectional stores) is a paradigm shift, but seeing ever broadening adoption and similar ngrx/store for example in the angular side.
And in a few years we could have another paradigm shift, with webassembly bringing about e.g. a nicer UI stack for web work.
>As to your list.. Java and C# are pretty firmly around today.
Speaking of Java, that I've followed best, where are Applets? Or J2EE? Or Swing? Or JS Faces? Or that java grid API that would revolutionize computing? Or lots of other Java-related fads du jour that history forgotten, but at the time had loads of adoption and were touted as the best thing since sliced bread?
Of all the above, React is the first paradigm (combined with a Node backend) that EVER felt like the right way to do things... all others were "Cool", then dig in and get really disappointed somewhere. The more I've gotten into React... (I didn't like a lot of the early flux-like frameworks, but enjoying Redux) the more I feel it's really close to the right way to build web applications.
Of the above, I really disliked PHP and didn't like RoR too much, mostly because I don't care for ORMs at all really, even Entity Framework irks me at times, but at least it's easier to manage than others I've worked with. I've done one-off things with other tools/frameworks, but none really felt right... And this is in two decades of web applications development.
Mongo and RethinkDB feel close to right similarly. Postgres + plv8 feels really close too, but for the clustering.
For now, Web Assembly can't touch the DOM. And I'm only guessing, but it's likely the first implementations that bridge the gap will be around React/JSX or a similar core for the communication, and representation of UI vdom. Soemthing using the `material-ui` package could be awesome.
These matter to him so I wouldn't just dismiss the article.
Angular 2 + tyepescript: Nope. All must be compiled on the fly from the node modules directory. So sayeth the Google.
---
Angular 1: Oh look, stable production ready versions of all the external libraries I need.
Angular 2: Coming soon...
---
Hacker News Comments: Oh somebody prefers Angular 1 to Angular 2? Must be because they're stupid and hate learning new things.
"Wants to move as fast as possible, spent too much time dealing with React tooling, picked Angular 1 from among what he sees as stable options [without a clear reason]".
Or "Angular 1 - the php of javascript frameworks". :-) (Although obviously the php of javascript is jQuery, right?)
Other than that, you can get started pretty damn fast with create-react-app.
1: they're too picky in what they want to use generators like this (or one of a billion Yeoman templates) - which then says don't complain something takes too long to set up when you're the one adding complexity
2: they count learning new methodologies/frameworks as part of the "setup"
In the case of #2, what you know is always going to be quicker than what you don't. Complaining that "it takes too long" should be rephrased to mean "I don't have the time to learn something new"
jQuery is more consistent and historically nicer to use than PHP... I think even comparing Angular to PHP is a disservice to PHP.
Good luck.
It all boils down to this.
> However the tooling is maddening. ... After I was setup (I chose the “stable” technologies) it wasn’t good enough. As soon as I started trying to bring in libraries to do what I needed, I found my chain wasn’t up to the task. Of course I couldn’t just follow the instructions on the CLI when there were errors… because there was a few levels of indirection in the tools. I’m losing time battling my stack. It should be helping me.
So this isn't "I hate React" it's more "I hate webpack/browserfy/babel/..." or whatever the hell he was trying to run with. And there's some truth to this, because the installation page of React is basically "try to get it going with your toolchain". And then a bunch of examples of working with different toolchains.
Basically, he probably felt the `create-react-app` approach wasn't stable, and did a bunch of google searches to figure things out, and jumped down a rabbit hole from a variety of blogs, etc that contradicted each other, etc. I've experienced this frequently with anything non-trivial in jS-land.
It's interesting, but in general, I suspect the React documentation would be better served with presenting fewer options in the early stages. "Installation" really should be "Getting Started" and that should only reference one thing, like `create-react-app`, and working with other toolchains should probably be more clearly separated out into other topics, like "Creating a production toolchain with webpack and babel".
Being able to expand on the toolchain is coming though... which I'm happy for... I want all the coming soon stuff babel can give me now, as well as my environment/test setup is different.. I want my test right next to the script that's under test for unit testing.
The reason why is the author's current level of proficiency for building something that he wants. For example, if he was an ace at Assembly (instead of familiar with Angular) he could've easily wrote an article titled "Why I'm throwing out Angular 1.x and going back to Assembly".
Its all relative. Some people can afford having the "most beautiful code", but that also goes with a budget and a group of people who can make it work (e.g. Steve Jobs ordering beautiful code/engineering for the Macintosh).
I would say the most logical route would be to "Build the Damn Thing". Facebook used that notion, got the product out, got ahead, and now can afford sound code. Heck, Zuckerberg doesn't even code on Facebook's source anymore. No one (besides us engineers) knows or cares what Facebook is running on. Same with many other productions (not only software) out there (when was the last time we cared exactly how an Oreo cookie was made?).
So to answer Steve's question "What am I supposed to do?", I would say "Just Do It! Make the product.".
Do the work and live the dream (Same with all of us dreamers).
Except for the people that complain about performance?
React + Redux, Go, Scala, Cassandra, micro-services, etc.. are all products made to solve Google and FB sized companies.
If you are an one man band, starting your own little startup or project, stick to Python or Rails or PHP or Node, jQuery and Mongo.
Your focus should be on getting something out there as soon as possible, not writing perfect software.
I agree with you on the scaling argument, but the OP is a single developer starting a new project from what I gathered, so IMHO the last thing he should worry about is scaling.
<Router ...>
<DefaultPageLayout path="/" component={DefaultPage} />
...
So the templating benefits to html/jquery are a bit of a mixed bag, and if you're doing React + Node, you can start off with your fallback route being the app, and later add server-side rendering if in a time crunch.I will say the initial setup can be higher, if you don't like the structure of create-react-app, but most people new to react coming from a PHP and Angular background probably should stick closer to as it comes in the box. Wiring up redux is the biggest paradigm shift though... unidirectional workflows mean much better predictability in terms of state with far fewer bugs. Most of the times I see weird state issues in websites/apps lately they're angular 1 though.
React was never meant to supplant the Ember/Angular world. Sure you can bolt on react router etc but it's Apples and Oranges. Even if he was okay with learning a new framework under that deadline, was it even the right choice in the first place?
One thing that I just can't stand about Angular 1 though, is dependency injection (which, ironically was one of their most touted 'features') - When working in a large team, I find that it's a hassle to figure out where a particular service was declared because they were magically injected into directives/controllers without any indication of where they came from; to get this workflow right requires a lot of discipline when it comes to folder structure and file naming conventions. I prefer to use the ES6 import statement as promoted by React or the tag-based module import promoted by Polymer.
Btw I'm working on a django/react application and I have yet to figure out how to not duplicate the react routes in django. It defeats the purpose of a single page app because I don't want to reload all the same resources because a small piece of the app changes...how do you fix this?
One caution since you seem to have fallen into the trap of not experimenting nor venturing out of your comfort zone -- it's a surefire way to learn nothing from this experience including what tools make you more productive...
Good luck
Please elaborate.
- Career growth: your team will be accruing experience in a technology the market does not need. That is not in their best interest, and they will not feel happy about it.
- Hiring: It becomes difficult to hire people when you decide to move away from what everyone else is doing.
- Sunk cost: As more code using old libraries is added, migration becomes more expensive.
I'm thinking in particular about Ember. I'm leaning toward Ember for our web apps because in some of our apps, any full framework is overkill and we are going with a combination of Jquery + Handlebars, but other times, we may want to use a full framework and Ember uses Handlebars for templating.
I'm not seeing any jobs for Ember.
e.g: the actor model, dataflow concurrency, logic programming and so many more stuff. Those are extreme examples of different paradigms.
So, the question now is: are you cultivating skills related to an obsolete paradigm, or a skill that you cannot trade in the market? If so, that's not good.
This wasn't a choice for any competitive reasoning... purely panic driven. As for fast react scaffolding, it doesn't get much easier than create-react-app, or whatever the angular2+ equivalent is.
Starting something new in a year, or 18 months can be dramatically different than the previous start.