5 ms·
Any tips for a mere mortal who looks at Angular and finds it incomprehensible? React? Vue.js? Or just stick to good ole Rails/Python for now?
by pbreit 11y ago
Any tips for a mere mortal who looks at Angular and finds it incomprehensible? React? Vue.js? Or just stick to good ole Rails/Python for now?
- jashmenn 11y agoOne way to think about Angular is like this: Different modules on your page are broken down into components, which are like "regular" HTML tags except that they have JavaScript functionality attached to them. Your app is a tree of components. React is great as well, but if you find Angular incomprehensible it's not clear you'll find React much easier. One major difference between React and Angular is that the Angular community _tends_ to separate their templates from their "controller" code, whereas the React community _tends_ to intermix their templates with code ("PHP" style). The result is that in Angular you have a few funny characters in your HTML to learn (e.g. `*ngFor="let foo in bar"` for looping) whereas in React you'll use JSX and use JavaScript for loops. It's pretty clear to me that component-based webapps are here for the long haul. Even if WebComponents ends up being the future, the concepts you learn in using either Angular or React will be more-or-less transferrable. It seems to me that Angular and React are becoming more similar over time. For typing, Angular uses TypeScript and React uses Flow. For data architecture, both communities are gravitating towards some sort of Flux (redux / ngrx). You can even use JSX in Angular if you want to. Shameless plug: I've written a book on Angular 2 which talks through, step-by-step, how to understand Angular. The first chapter walks you through your first app and you can get it (for free) here: https://www.ng-book.com/2/ https://www.ng-book.com/2/
- nawitus 11y agoWhy use Angular 2 when you can use web components?
- zip1234 11y agohttp://caniuse.com/#search=components http://caniuse.com/#search=components Because you can't practically use web components. Only Chrome and Opera support them. Angular2 has support down to IE 9.
- rictic 11y agoThe web components polyfills have support down to IE 10: https://github.com/webcomponents/webcomponentsjs https://github.com/webcomponents/webcomponentsjs
- Touche 11y agoYeah but there's a separate "lite" version for a reason, Shadow DOM support requires wrapping nearly every DOM API. Web Components without Shadow DOM aren't that interesting.
- pfooti 11y agoStart with this: https://github.com/webcomponents/webcomponentsjs/issues/212 https://github.com/webcomponents/webcomponentsjs/issues/212 Which is why I stopped messing around with polymer. Basically adding the webcomponents polyfill to your DOM tree (because it touches so many things) breaks contenteditable in some weird ways. Which can be limiting to people who use rich text editors (many still decorate contenteditable divs) although iframe-wrapping the editor fixes the contenteditable breakage (at the expense of introducing other problems with extending your editor - try adding custom (say) atmention autocompletes to something in its own execution context). Also, webcomponents have had some pretty major syntax changes over time, especially when it comes to shadow-piercing styling vs other styling selectors. Ultimately, I'm looking forward to webcomponents. I can't wait to have proper namespaces and all that. In the short run, though, I've tried the webcomponents polyfill (I wrote a lot of polymer 0.X code for a webapp that I eventually ported to angular 1.x instead when the polymer 1.x syntax meant I'd have to rewrite a lot anyway), and it's not Enough.
- deleted 11y ago[deleted]
- nkw 11y agoLest anyone disregard the plug for the book because it comes from the author, I don't have any affiliation with the book or author, but can attest it is a very nice guide to Angular 2. During the alpha/beta process the angular developers have been making breaking API changes right and left (which is ok, they said they were going to during the development releases), but the ng-book 2 has been kept reasonably up to date through the process. I found it to be very helpful in getting a handle on angular2 -- much more so than all the sample projects or how-to pages mainly due to everyone preferring different tooling or build workflows which required more time to figure out what was going on there rather than learning the angular2 part. The book was much more pleasant to read and work through than all the how-to pages or seed projects on github. FWIW.
- overcast 11y agoVue.js - MUCH easier to get started with, and will have most everything you need without the complexity of Angular.
- spriggan3 11y agoTry Vue.js frankly it has an excellent documentation. And you'll get started in no time, no need for nodejs and zillion packages from npm, or even a cli tool and what not. it's one file you drop into your html page. Vue.js explains clearly how you should build a Vue application and is honest about its potential limitations. There is no surprise nor magics. No IoC container forced on you if you're not into that kind of voodoo. React is good too, I recommend either of them. I'd have recommended you Angular 1 3 years ago, now I can't, I have no idea if they'll stop developing that version at some point in time.
- deleted 11y ago[deleted]
- devNoise 11y agoAngular 1 is now up to 1.5.x and still has on going development. I think people have been scared away from learning Angular 1 because of the Angular 2 announcement. I'm trying to remember the details, but I believe support for Angular 1 will continue for a couple more years.
- Roboprog 11y agoWith any luck, Angular 1.x will be like Perl 5.x - still supported about 20 years later :-) Did I just compare Angular 2 to Perl 6? Alas, Angular 2 is threatening to actually roll out sooner rather than later.
- stephenhuey 11y agoI've been finding the beta 1 version of Aurelia to be quite comprehensible and do prefer it to Angular by a long shot. They're getting ready for a release candidate now and the 1.0 version will be out within a few months.
- eliben 11y agoCan you elaborate on how Rails/Python serves as an alternative to Angular?
- robotnoises 11y agoI don't think they were implying it's an alternative, but rather very foreign-feeling.
- pbreit 11y agoBoth enable building web sites. Granted SPAs and MPAs are different, at the end of the day it's just building things for users.
- deleted 11y ago[deleted]
- ufmace 11y agoMy usual tip for getting into something that seems incomprehensible: Just start building stuff in it. Start with Hello World or something else ridiculously simple. If it doesn't work, then debug and fix it until it does. If it works, then add some features until it stops working, then fix it. Repeat until it does something useful. Find some demo apps and examine them to give you some direction on how to do things. Work through any tutorials you find. Angular 1 seems like a good starting place to me. It has some complexities, but it's one file to use and is all bare Javascript. You can at least get something simple working before you have to figure out how to set up build pipelines for Typescript or JSX or something. You can even do some useful stuff in it with no Javascript at all - the default form validation stuff is pretty nice.
- dceddia 11y agoI'm a fan of React. Having used Angular 1.x for a few years professionally and spent some brief time with Angular 2, React seems like a much cleaner way to write view code. The biggest hangup people seem to have at first is JSX ("HTML") mixed in with JS, and I had that worry too but it vanished as I spent more time with React. It's just the view layer, and just a library, which can be a pro or con, depending on what you want from it.
- deleted 11y ago[deleted]
- huskyr 11y agoVue is awesome. It has the templating parts of Angular 1 (which are quite nice), but it doesn't have the Java enterprise-like mishmash of services, factories, providers, modules and what have you not. I'm not sure if you should build a big application in Vue (maybe you should use React for that), but for a small-to-medium size app, Vue is an excellent choice. Oh, and the documentation, a part so often neglected or written in a style that's for CS professors instead of mere mortals, is extensive, clearly written and full of examples. Lovely!
- posva 11y agoActually Vue works as well or better than React for Big applications. You can handle application state with Vuex or other flux like implementation and even combine with a bigger backend