Live data from Hacker News

Angular 2 – Best Practises

blog.budacode.com

51–60 of 94 posts

Re: Angular 2 – Best Practises

#51
post #4

Could someone tell me one-or-more reasons to choose Angular for a new project, now that the React ecosystem is mature enough to compete with it? As I feel that from a conceptual/architectural point of view Angular is simply on a loosing path. https://www.google.com/trends/explore#q=angular%20tutorial%2...

Essentially it boils down to whether you prefer a cohesive all-in-one framework/platform (angular2) or a collection of semi- and fully-independent libraries (react). Pretending that one of those options is the right fit for everyone is not productive.

The only thing really missing from Angular 2 compared to the React ecosystem is jsx. Angular 2 and RxJS (and if you want throw in ngrx/store) allows a heavy focus on immutability, unidirectional data flow, centralized state, etc. that ends up very similar to the React ecosystem conceptually.

Both allow native cross-platform mobile with React Native (react) and NativeScript (angular2), and Angular 2 also gives you a nice hybrid/webview option with Ionic 2. Angular 2 also gives you a bit tighter integration with TypeScript, if that is your preference (which it is mine).

Personally, for me, I like both a lot but the full-framework and tight TypeScript integration fit my use cases and personality better.

Re: Angular 2 – Best Practises

#52
post #45

Earlier quoted context omitted.

> We need some more software engineering in the javascript space instead of cowboy hacking Are you saying that the ability to write entreprise java code is what separates "software engineers" from "cowboy hackers" ? That statement is arrogant. My point is the use of Typescript doesn't produce idiomatic Javascript code, since it encourages writing front-end code a certain way. You might like it, fine, I'm personally n…

Have you used TypeScript? I thought the very same things until I started using it. TS does a great job of maintaining the spirit and feel of JS. It's not a "C# for the web", it really is "JavaScript with types"

It is C# for the web, of which a small subset is great and can be used to make "JavaScript with types".

Or rather, TypeScript isn't bad, but the way it is documented might convince people to do bad things. It took forever to get "the good parts" of JavaScript in people's head, and that doc is really a step backward.

If you just use TypeScript's types and run away with that though, it's pretty good. If you start using classes all over, rely on private/protected/public like crazy to make complicated domain models, abuse decorators to hell, enums, etc... then it's C# for the web.

It doesn't have to be used that way, but those features made available and having a high focus in the official doc is causing a lot of issues when people coming from Java/C# hop in a TypeScript code base.

We don't use TS here, but when we hire people who come from TS companies, we have to tie them down for them not to start writing C#-like code, and remind them that it's structural typing, etc.

Re: Angular 2 – Best Practises

#53
post #10

Earlier quoted context omitted.

My impression is that a lot of "mature" (aka boring old) companies like Angular 1 and the sound of Angular 2 over React. For a number of reasons: - In general Java and C# programmers like it. - It is made by Google (perceived as more "mature", business like) rather than Facebook (young kids). - It takes a lot of inspiration from server side development with its dependency injection and general terminology. - And Type…

> - And TypeScript is very similar to Java and C#. react and typescript go hand in hand, now that typescript has .jsx support (as .tsx files)

Typescript really has more to offer with react. It type checks the jsx(tsx), Offers code completion on components and their properties, you can refactor/rename properties and components throughout your project without side effects. Typescript is kind of blind to angular templates.

React offers ability to use same code on server side and client side. Easier to test a Vdom library. It's a lot less complex, it's perf is a lot better, you can live edit. The biggest selling point is you can create native apps using native ui with a lot of code re-use.

React + ts definitely give you a bigger bang for buck. I spent 2.5 years of my life writing angular code. It definitely has some good ideas but I won't be investing so much of my time in angular 2 anymore.

Re: Angular 2 – Best Practises

#54

For what it's worth, Google's engineering director for Angular has said that Angular 1 was a framework -- "something you could just drop into a web page and get going". Angular 2 was supposed to be a "platform of capabilities." "We're still doing the framework, but we're improving our ability to handle different languages. Our plan is to have versions that will work with many server-side technologies, from Java to Py…

I like the ambition there. Something as complex as angular will definitely require updates. Let's hope they actually walk the talk.

Re: Angular 2 – Best Practises

#55
post #4

Could someone tell me one-or-more reasons to choose Angular for a new project, now that the React ecosystem is mature enough to compete with it? As I feel that from a conceptual/architectural point of view Angular is simply on a loosing path. https://www.google.com/trends/explore#q=angular%20tutorial%2...

One specific reason I am personally choosing Angular 2, is that the Ionic2 Framework also uses Angular 2 [0]. So I can re-use code from my front end website on my native mobile apps for the new startup I'm launching. Much less code = quicker time to MVP, and lower cost of development. [0] http://blog.ionic.io/angular-2-ionic/

> So I can re-use code from my front end website on my native mobile apps for the new startup I'm launching.

Just to be clear, Ionic is _not_ native.

Re: Angular 2 – Best Practises

#56
post #4

Could someone tell me one-or-more reasons to choose Angular for a new project, now that the React ecosystem is mature enough to compete with it? As I feel that from a conceptual/architectural point of view Angular is simply on a loosing path. https://www.google.com/trends/explore#q=angular%20tutorial%2...

One specific reason I am personally choosing Angular 2, is that the Ionic2 Framework also uses Angular 2 [0]. So I can re-use code from my front end website on my native mobile apps for the new startup I'm launching. Much less code = quicker time to MVP, and lower cost of development. [0] http://blog.ionic.io/angular-2-ionic/

As did I and for the same exact reasons. I am the only dev on the project (it is a startup) and we need to get to MVP fast.

Re: Angular 2 – Best Practises

#57
post #10
post #4

Could someone tell me one-or-more reasons to choose Angular for a new project, now that the React ecosystem is mature enough to compete with it? As I feel that from a conceptual/architectural point of view Angular is simply on a loosing path. https://www.google.com/trends/explore#q=angular%20tutorial%2...

My impression is that a lot of "mature" (aka boring old) companies like Angular 1 and the sound of Angular 2 over React. For a number of reasons: - In general Java and C# programmers like it. - It is made by Google (perceived as more "mature", business like) rather than Facebook (young kids). - It takes a lot of inspiration from server side development with its dependency injection and general terminology. - And Type…

I totally agree on "mature" (aka boring old). I make my income on enterprise and recommending React here would be like recommending Rails over Java or C#. Meaning possibility of landing contract would be significantly lower.

Re: Angular 2 – Best Practises

#58
post #5

Earlier quoted context omitted.

> I also can see how Typescript features can shape a codebase and ultimately make it look like Enterprise Java, instead of making it easy to use and to learn. Meh, I don't see how this is a bad thing. We need some more software engineering in the javascript space instead of cowboy hacking.

> We need some more software engineering in the javascript space instead of cowboy hacking Are you saying that the ability to write entreprise java code is what separates "software engineers" from "cowboy hackers" ? That statement is arrogant. My point is the use of Typescript doesn't produce idiomatic Javascript code, since it encourages writing front-end code a certain way. You might like it, fine, I'm personally n…

Are you honestly comparing Typescript verbosity with Java type verbosity? It's an absolute joy to work with Typescript in an IDE from JetBrains.

Re: Angular 2 – Best Practises

#59
post #25
post #4

Could someone tell me one-or-more reasons to choose Angular for a new project, now that the React ecosystem is mature enough to compete with it? As I feel that from a conceptual/architectural point of view Angular is simply on a loosing path. https://www.google.com/trends/explore#q=angular%20tutorial%2...

https://www.google.com/trends/explore#q=react.js%2C%20angula...

Actually this seem to depend a lot on the exact search term, look: https://www.google.com/trends/explore#q=%2Fm%2F012l1vxv%2C%2...

Re: Angular 2 – Best Practises

#60
post #4

Could someone tell me one-or-more reasons to choose Angular for a new project, now that the React ecosystem is mature enough to compete with it? As I feel that from a conceptual/architectural point of view Angular is simply on a loosing path. https://www.google.com/trends/explore#q=angular%20tutorial%2...

Essentially it boils down to whether you prefer a cohesive all-in-one framework/platform (angular2) or a collection of semi- and fully-independent libraries (react). Pretending that one of those options is the right fit for everyone is not productive. The only thing really missing from Angular 2 compared to the React ecosystem is jsx. Angular 2 and RxJS (and if you want throw in ngrx/store) allows a heavy focus on im…

I don't think JSX fits Angular 2 - it sticks to "views are markup based and code is in controller" traditional MVC which I prefer to JSX.

You mentioned TS but I feel like you understated it - it's the selling point for me. I have used TS + React but it's not the same thing - Angular was written with/for TS and it uses it to leverage all the advantages. React migrated from ES5 to incrementally add ES6 support and it shows. Also nobody uses flow outside of React unlike TS which has a decent community even outside of Angular and plenty of 3rd party type definitions.

Post reply on HN