9 ms·
I'll be that guy. I'm sure the Angular team are great people, and they're clearly talented devs... but stay away from Angular. It doesn't help with the proble
by tomelders 10y ago
I'll be that guy.
I'm sure the Angular team are great people, and they're clearly talented devs... but stay away from Angular.
It doesn't help with the problems you will actually face. Typed Javascript is a cargo cult. Angular just plain confusing for no apparent benefit. Dependency injection is bizarre. The distinction between modules, components, and directive is unnecessary. The Javascript community in general is moving away from OOP towards functional programming, but Angular has hitched it's wagon to OOP. It's reliance on the decorator pattern is maddening. It's view layer performance is sub standard. It's opinionated in all the wrong ways.
And I say this as someone with a lot of experience with Angular 1, Angular 2.
Trust me, go for libraries over frameworks every time. Redux, React, Immutable, Sagas, and reSelect. That's the future of web app development.
- hesarenu 10y agoAs a longtime redux user i am all into Mobx now. It is simpler then redux.
- hccampos 10y agoFor most apps, yes I think MobX is easier. However, both of them, combined with React/Preact are hugely superior to Angular.
- uitgewis 10y agoJust mentioning, there is ngrx^1 which is the redux pattern for Angular 2 apps. It also integrates with Observables. [1]: https://github.com/ngrx/store https://github.com/ngrx/store
- hccampos 10y agoProblem is you get a cumbersome templating language, extremely verbose component declarations, even more verbose dynamic components and a bunch of other horrible stuff. In React it is a breeze to make Higher Order Components to connect to a store and it also makes it much easier to separate those smart components from small reusable presentation components. I have seen people shy away from making smaller components just because Angular makes it so damned painful to make components. It is just easier to stuff everything in a template and copy paste everything around, which leads to a serious case of spaghetti code. I am happy for you if you don't have to work with something like that. I do, and I can tell you it is not nice in any way.
- thewhitetulip 10y agoI agree with this, few months ago I was trying to learn AJAX, I tried Angular (because it is backed by Google), few weeks into reading more about it, I was still reading the docs. Then, I read that VueJS was a somewhat better and lean version of React, so I skipped React and started with Vue, I was surprised that I wrote the complete app within a week of starting to learn Vue (https://github.com/thewhitetulip/Tasks-vue https://github.com/thewhitetulip/Tasks-vue) , of course, there were issues I faced, but they were solved quickly thanks to the amazing vue community. I saw that many many people who are trying Vue are facing the same problems as I was, thus, I started writing this guide (https://github.com/thewhitetulip/intro-to-vuejs/ https://github.com/thewhitetulip/intro-to-vuejs/). Vue is amazing. edit: link
- kitsune_ 10y agoI really don't want to sound like an ass, but if you were at the stage of 'learning AJAX' a couple of months ago you are probably not in a position to judge the merits of JS frameworks like React, Vue or Angular.
- thewhitetulip 10y agoDespite being new to AJAX, I wrote a Vue app within a week, 4-5 weeks into reading Angular, I was still reading the docs. Edit: removed a brash statement.
- basdp 10y agoIt says nothing more than Angular has a lot more documentation. Perhaps because Angular has a lot more features.
- thewhitetulip 10y agoPlease note that I didn't say Angular sucks. I merely pointed out that Vue is easy to learn. I am hardly an expert on either Angular/Vue to recommend them based on their internals, I stated my experience, of course, the final decision depends on those who choose one framework over another.
- hccampos 10y agoI have to agree with your general point. However, to me it's not really that Angular is bad in itself, it's more that the alternatives (React/Inferno/Preact combined with redux or MobX) are just superior in so many ways, and by a huge margin. Once you've done React with TS/TSX, with type checked components all the way, great code completion, incredible performance...it's hard to go back. Angular's components would be ok if React didn't allow you to declare functional components in just a few lines of code, create HOC to decorate exiting components, etc. Angular's components are certainly better than Angular 1's but when you compare it with what you can do with React it just can't compete. Honestly, from my experience, there is not a single thing that Angular does better than React and friends. Not a single one. It does things better than Angular 1/Ember/Backbone but that's it. I think this is a bit like the solar/renewables revolution that is happening in energy. There are more efficient combustion engines, filters and whatnot, but when you compare them with the other paradigm, it falls short.
- cormacrelf 10y agoThe definitive answer to this question is: it sells itself better to managers. The truth is that for many good and bad reasons, people with decision-making power are scared of dependencies. My company uprooted a few months of React development because Angular (2) comes with batteries included and we wouldn't have to rely on third-party stuff to fill in the gaps. The amount of stuff you get is... not actually that much, but it's enough to sell it. Of course, our new package.json is just as long, if not longer using Angular than it was before, and I've spent arguably more time doing setup (before @angular/cli stabilised) than I ever did with React. The whole @angular/router situation with module loading is silly, who wants to load modules via strings? Yes, the default batteries-included parts work with each other very well for the basics, but what about power and flexibility? React could go a long way in this regard just by having a few more official ways of doing things and offering a few tools straight up (a @react/router for instance) while still selling the just-part-of-a-wonderful-ecosystem thing. React is so much better at satisfying real development needs, like the hyper-extensibility via functional composition and the super-DRY code you can get out of it very quickly, that proving its worth in ways that are only superficially important would be well worth it.
- bunkat 10y agoTotally agree. I really don't get how anybody can take a look at the mess at https://angular.io/docs/js/latest/api/ https://angular.io/docs/js/latest/api/ and think to themselves, yep - that's for me! Our first version was done in Angular v1 and we bit the bullet and converted over to React and never looked back. No more factories, or dependency injection, or crazy template language that is never quite expressive enough, and no more digest cycles to optimize.
- jamra 10y agoAngular 2+ is very different than Angular 1.X. The single directional data flow removes the need for digest cycle tweaking. You only need services for data and components for rendering and business logic. The benefit over react is how you don't need anything additional to manage your workflow. It's nice to set up a project and not need to glue together libraries.
- jamra 10y agoAngular 2+ is very different than Angular 1.X. The single directional data flow removes the need for digest cycle tweaking. You only need services for data and components for rendering and business logic. The benefit over react is how you don't need anything additional to manage your workflow. It's nice to set up a project and not need to glue together libraries.
- jmfayard 10y ago> I really don't get how anybody can take a look at the mess at https://angular.io/docs/js/latest/api/ https://angular.io/docs/js/latest/api/ and think to themselves, yep - that's for me! ANY web developer is someone that once upon a time looked at an api that was a complete mess (javascript, dom, ...) and still said to himself - that's for me! Update : absolutely not saying they wrong to think so. Building the right things is more important than building the things right.
- Hurtak 10y agoThe website seems like a mess. The title of linked page changes from `(v4.X.Y)` to `(v)` to `(v4.0.0)`. At the start it displays empty page shell, then fires two ajax request, each causing the page to redraw. This all could have just been statically generated web page.
- avenoir 10y agoWe went from jquery to backbone to angular to react and every single time there is a post like yours telling everyone that the future of web development is this new thing. Get real... The future changes every 3 months.
- gspetr 10y agoThat used to be the case, but now the onus is on you to prove that it is still so. React is 4 years old. Vue is 3 years old.
- Uroboric 10y agoI have about two years of experience with both Angular 1 and React. What was truly astounding to me was how while Angular required months of continually poring docs and Stack Overflow threads for every new thing I wanted to do, React took all of a week or two to get pretty comfortable with, and after that minor investment of time I was rewarded with dramatically increased development speed. I will never go back to using a framework with an approach like Angular. Trying to abstract away the browser environment and have developers learn a whole new set of APIs with nearly the same level of complexity is just a fundamentally bad idea.
- kabes 10y agoEuhm. Jsx and vdom are exactly About abstracting away the browser environment...
- marksomnian 10y agoErm, what? JSX doesn't do any abstraction. Unless you're using React Native, you're writing HTML, just that JSX turns it into `React.createElement(...)` calls. The VDOM is kind of an abstraction, as React Native can use the same reconciler as React, but the React (web) VDOM is just a tree of HTML DOM nodes that gets diffed against the component rerender output and the changes are applied to the DOM.
- ganarajpr 10y agoUmmm.. kabes is right. React is an even bigger abstraction on the browser than angular 1 is. Its just that with React the abstractions are mostly opaque - and with Angular the abstractions are not so opaque ( and maybe sometimes leaky! ).
- Uroboric 10y agoI think you got that backwards. React's abstractions are transparent, as in the developer doesn't need to "see" them or be aware of them. Your existing web dev knowledge largely applies.
- markatkinson 10y agoHoly smokes, I can't believe how serendipitous this is. I am 5 minutes into a Pluralsight course on Angular 2. I really like the idea of Typscript, but now... now I guess back to the drawing board on what to learn.
- ergo14 10y agoGo with what you like. Take a look at Polymer documentation - it is very easy to pick up and works like a charm. I prefer it to react and angular nowdays. You will still be able to use redux/whatever with it.
- scanr 10y agoTypescript works quite well with React, redux etc.
- veeti 10y agoIf you're going to switch JS frameworks every time some hipster on HN tells you to, you're never going to get anything done. Use Angular/TS if you like it.
- markatkinson 10y agoOh no, I am a desktop and mobile developer, but a recent article on HN made me decide I should dip my toe in web dev just to get a better understanding, so I hit up Pluralsight and was recommended Angular and Typescript. Then 3 minutes into a Angular 2/Typescript lesson I read that. But point taken. I think I will stick with Angular and Typescript purely on the basis that it seems to have better integration with .Net core etc. I say all of this from a huge point of ignorance and just what I could gather from an hour or so of research online. Edit: Changed to single toe.
- yulaow 10y agoIs ironic just yesterday I read almost the same thing but trashtalking pseudofunctional programming in js, declarative components, microframeworks and dependency hell over all-in solutions, etc etc... The reality is you don't really have any idea of what future of web development is, as anyone has. The community is not oriented in any way... rather we are probably in the time of biggest uncertainty and most frequent change of ideas of the whole web dev history. Honestly the only and best suggestion I can make is "ignore everyone who try to say * this is how you should do things, the rest is shit * ", for the big part of the time they are just trying to self-justify an over investment on their own solution (or worst, ego), telling themselves they for sure had understood everything and the others are just wrong or "not there yet". They don't even know that they don't know.
- agumonkey 10y agoAll good points, but FP has been a solid paradigm for a very long time, from people that had time and wisdom. It reduces very quantifiable issues like shared mutations, lines of code. Now that doesn't make js revisitation of fp pristine but still it's quite a refreshing thing. I never used Ang2+ but Ang1 was such a heavy thing; it was a OOP theory in itself, flipped around the DOM (I forgot their terminology but basically, the DOM tree became the inheritance tree).
- deleted 10y ago[deleted]
- bigmanwalter 10y agoNever forget "Transclusion" and "Prototypical Scope Inheritance" The angular team seems to hate simplicity and love made up words.
- agumonkey 10y agoPSI looks like a fabulous alias for inheritance.
- throwaywgsid 10y agoAngular is a mess but typescript is alive and kicking on its own, even with react. Personally I'm one of the apparently rare breeds that hate angular but loves typescript. I wish there were more of us. They're really in different realms and please don't make them part of the same whole. Typescript is a transpiler but the transforms it does are designed to mimic accepted JavaScript idioms. When I'm debugging typescript it makes sense, it looks almost like JavaScript written by somebody that knows what they're doing. Contrast that to Babel, Closure compiler, and countless others that produce "JavaScript" that reads more like assembler. Typescript is easy to make back into human readable JS and it's equally easy to slowly transform your JavaScript into typescript. It's the most forward and backward compatible language transformer I've ran across so I don't appreciate you shitting on it :)
- Longwelwind 10y agoTypescript with React is necessary for me. I feel like it highly increases my productivity when coding, and it makes it easy to refactor the code. Plus you can do some cool things like Component inheritance. I've never tried Flow, but I guess it's practically the same.
- sundvor 10y agoI want to move on from Jquery... Have been learning C# on the back end for the past year and a bit, but now it's time to do the front end. Looking at both A1 and A2 has confused me, so might just try React and see if that is more compatible with my ageing me. :) Nevertheless, I also really like the looks of Typescript. Could your possibly recommend a(n opinionated) way to get started with the two?
- doczoidberg 10y agoI came from C# WPF/Winforms and have to say that Angular 2 is more familiar to me than react. Of course the whole web stack is a new thing. Angular makes web app development much more productive.
- RandyRanderson 10y agoMy guess would be that static-typing is what they're trying to add albeit in an OOP form. Javascript is more of a 'Prototype' based language. They call things 'Object's but I've seen few portions of JS code that actually use OOP in the traditional sense (encapsulation, polymorphism, etc)[0]. Mostly objects are just used for namespaces for finding vars and functions. Agreed on the frameworks versus libs. I would recommend that you work on a large codebase in a statically-typed language for a spell. Duck-typing is great for a shell script or blog post but things may be different when refactoring 100k lines of code, finding references, etc. [0] Yes I know about the JS 'library' 'pattern'. That's more gymnastics than encapsulation.
- humanrebar 10y agoSorry, but this is one of my technical pet peeves. Polymorphism isn't solely an OOP concept. Every language has polymorphism of some sort. Most have several. Duck typing is an example of polymorphism actually. You probably mean "inheritance", which is a way to achieve polymorphism, not a synonym for it.
- RandyRanderson 10y agoI think something must have a form before you can say it has many. By your definition a cloud is a polymorph instead of a random shape. If you weaken the definition that much, it takes on a lot less meaning.
- humanrebar 10y agoThe wikipedia page lists three types of polymorphism. Duck typing is linked in the page as another kind of polymorphism. I've seen several other types in the wild, such as link-time polymorphism. https://en.wikipedia.org/wiki/Polymorphism_(computer_science) https://en.wikipedia.org/wiki/Polymorphism_(computer_science... The general idea is that you can have one expression dispatch to many different concrete implementations depending on the context. Virtual function calls is one approach, but C uses function pointers, C++ uses templates, dynamic languages use duck typing, several languages use message passing, and so on.
- randomThoughts9 10y agoSome clarifications: 1. Angular 2 is not object oriented in the standard meaning of the term: it does not rely on inheritance or polymorphism that much. But it does rely on classes as the backing structure of your UI components. In other words, they tried to create a platform for creating widgets that compose. And more or less succeeded. This is a tried and true pattern that has been used to create complex user interfaces since forever. I would wait a while before claiming that this stile is obsolete. 2. Angular 2 is quite functional. Decorators in Javascript are just higher order functions (like python I guess). They look like like Java's annotations, but work in a completely different way. They made streams (RxJs) the standard way of working with data. And pipes are also a functional construct. 3. There are some good things to say about their routing module too, but I have to go. Anyway, my opinion is that Angular and React address different needs and there is definitely room for both of them.
- jamra 10y agoObservables are the most functional JavaScript library/mechanism I've worked with.
- ergo14 10y ago> Redux, React Golden cage then eh? Nah, I'd rather go with polymer instead which is much closer to DOM and is a small library indeed (It's not like redux is working only for react). And without polyfills I'm looking into 15kb download for users, instead of react + reactDOM behmoth. I can't wait for someone to add JSX+VDom support for polymer (for the folks who like that approach).
- stupidcar 10y agoReact is a framework. You can call it a library as much as you like, but that doesn't make it a fact. It comes down to this: What is the relationship between your code and the 3rd party code? Are you calling it, or is it calling you? If most of the code you write is extending some 3rd party code, e.g. React.Component, and most of the time your code is being executed by the 3rd party code, e.g. as render() calls, then what you have is a framework. React and its myriad extensions may be as great as people are saying, but this insistence that it is a "library" only serves to make the community look delusional.
- collyw 10y agoHaving toyed with React and Angular for similar amounts of time (~3 weeks of each), I found React whole lot simpler and more understandable. Probably because it only covers the V in MVC. There is so much stuff in Angular that seems like it belongs in the back end and is just duplicated unnecessary on the front end. (It's not like you are likely to write an application in Angular without a server based back end are you?).
- jamra 10y agoAngular isn't really OOP. ES6 made JavaScript more like OOP. Typescript just applies types so you can lint your code better. I am rewriting a React/Redux app I wrote to Angular 2. It's more readable, the control flow is easier to understand, and it's better to work on as a team. Instead of reducers and action creators, I have services separated into their own files. It's much easier for me to manage the work of others on the team.
- jasim 10y agoAgree generally, but the future of web app development is looking more and more like a hundred languages and frameworks. Here's someone who built a 50k LoC web app in Haskell - both client and server in the same codebase - and very happy about it: https://www.reddit.com/r/haskell/comments/610qp7/hiring_purescript_ui_developers_for_haskell/dfb1cmd/ https://www.reddit.com/r/haskell/comments/610qp7/hiring_pure... F# has Fable that compiles down to Javascript, OCaml has BuckleScript, and the new kid on the block, ReasonML. I've read about one or more production websites running in these what we'd call esoteric choices. (Add Elm and PureScript to the mix) There is increasing adoption in the web for both Typed FP through these languages and Untyped FP through ClojureScript. Non-FP communities on the other hand don't seem too keen on the web. Ruby for example has Opal, but with the pace at which Javascript is getting better, porting similar languages just for their familiarity doesn't seem to generate the same kind of excitement as transpiling from a more powerful one. And once Web Assembly becomes viable and browsers are free from Javascript (except for being the lowest common mass adoption denominator), we'll be able to choose our languages just like we can when programming for any other environment. It'll be a Wild West out there, but in a nice kind of way.