News for hackers. Stuff that matters.
Re:Angular 4.0.0 Now Available by tomelders on Thursday March 23, 2017 @11:27PM (#13946368)
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.

Re:Angular 4.0.0 Now Available by yulaow on Friday March 24, 2017 @04:19AM (#13947445)
Is 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.

Re:Angular 4.0.0 Now Available by agumonkey on Friday March 24, 2017 @05:09AM (#13947613)
All 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).

Re:Angular 4.0.0 Now Available by bigmanwalter on Friday March 24, 2017 @08:34AM (#13948452)
Never forget "Transclusion" and "Prototypical Scope Inheritance"

The angular team seems to hate simplicity and love made up words.

Re:Angular 4.0.0 Now Available by agumonkey on Saturday March 25, 2017 @08:43AM (#13955351)
PSI looks like a fabulous alias for inheritance.
Re:Angular 4.0.0 Now Available by bunkat on Friday March 24, 2017 @02:44AM (#13947144)
Totally agree. I really don't get how anybody can take a look at the mess at 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.

Re:Angular 4.0.0 Now Available by jmfayard on Friday March 24, 2017 @08:02AM (#13948311)
> I really don't get how anybody can take a look at the mess at 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.

Re:Angular 4.0.0 Now Available by jamra on Friday March 24, 2017 @05:31AM (#13947684)
Angular 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.

Re:Angular 4.0.0 Now Available by Hurtak on Friday March 24, 2017 @09:30AM (#13948757)
The 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.
Re:Angular 4.0.0 Now Available by thewhitetulip on Friday March 24, 2017 @02:37AM (#13947122)
I 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) , 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/).

Vue is amazing.

edit: link

Re:Angular 4.0.0 Now Available by kitsune_ on Friday March 24, 2017 @03:26AM (#13947267)
I 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.
Re:Angular 4.0.0 Now Available by sadok on Friday March 24, 2017 @03:40AM (#13947307)
As someone who is new to React, Angular, Vue, etc., he/she is in the PERFECT position to judge them. Libraries/frameworks are not just about performance, but how you learn them as well.

Those frameworks/libraries don't write themselves.

Re:Angular 4.0.0 Now Available by mhd on Friday March 24, 2017 @04:31AM (#13947479)
Frameworks are also about comprehensiveness. The start of the learning curve is not the sine qua non. That always reminds me of those complaints that writing a "Hello World" application in your GUI library of choice requires plenty of boiler plate etc., but you're probably not going to spend your developer life doing that. Often benefits for larger apps aren't obvious for the neophyte.

This is really aggravated that -- as opposed to native GUI libraries -- frontend requirements vary wildly. You might just need it to embellish some elements (i.e. the jquery level), you might also use it to build some large desktop app replacement.

Which is why I take most comparisons with a large grain of salt. In this regard, "JS framework XYZ sucks/rules" is the new "PHP is great/awful".

Re:Angular 4.0.0 Now Available by thewhitetulip on Friday March 24, 2017 @05:05AM (#13947596)
I agree with your points, I'd like to make one small point, Vue is not a framework per se, it is a library. That puts the responsibility of everything else on the programmers shoulders.
Re:Angular 4.0.0 Now Available by mhd on Friday March 24, 2017 @05:22AM (#13947650)
Well, with a lot of the light ones, you're buying into an ecosystem, not a framework.

Which often has the same end result, with a bit of added customization and some hard choices way too early.

Re:Angular 4.0.0 Now Available by thewhitetulip on Friday March 24, 2017 @03:33AM (#13947284)
Despite 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.

Re:Angular 4.0.0 Now Available by kitsune_ on Friday March 24, 2017 @04:46AM (#13947531)
Yes and no. It says as much about you as it says about Angular or Vue. Look, Angular is far from being my favorite framework, and I have nothing against Vue, I'm more of a ClojureScript / om.next guy myself. I'm just really allergic to brash statements about frameworks, or hype in general.

How easy it is to get up and running with a framework doesn't actually tell me that much about the framework. Is the apparent simplicity simply an artefact of a huge layer of magic that I will end up fighting 4 months down the row?

A good example for this is actually the much maligned Angular 1, two-way data binding looks easy on the surface, but it comes with a cost. And guess what, two-way data binding was all the rage for a while in the HN echo chamber during the early days of Ember, Angular and Knockout.

In the end, whether you use Angular, React or Vue is really secondary to what you build with it. You can create shitty and good code with all of them.

Now, specifically about Angular2+. People act as if its approach was this awful, monstrous abomination. This all really depends on your circumstance tho, or not? There are instances where it makes perfect sense to tailor your setup and use a libraries-first approach. But if you do this, let's say in React, you need to make a lot of decisions up front. Do you want manage state? How? Redux? MobX? What about message buses? Do you want to use Flow? Just ES6 / Babel? TypeScript? What about routing? Lazy-loading? What about bundling? Webpack? Rollup? And so on.

Now, if you are part of a heterogenous developer team working in an enterprise shop, maybe you are happy to know that there is a framework that has made a lot of decisions already for you and prevents you from having to discuss the initial setup for 2 months, but at the same time is flexible enough to be adapted to your needs (I mean, this even applies to experienced front-end shops, there's nothing more horrible than endless discussions about shit like pure ES6 vs Flow vs TypeScript from senior devs). On top of that it uses patterns that you already know, such as dependency injection and annotations. While you personally might not feel at ease with this, many developers do.

Re:Angular 4.0.0 Now Available by nogridbag on Friday March 24, 2017 @12:30PM (#13950072)
Having used Vue for a month or so and Angular now for only a short period, I can easily say Vue is easier to learn for two reasons (neither of them being magic):

1. The documentation is excellent. It's short enough to read in one sitting and comprehensive in that every option is documented without needing to resort to third party websites. When a new feature is added even in a minor version upgrade, that new feature is in the documentation (and marked as NEW). The search is also great and separates results into "Guide" and "API" categories.

2. Vue itself is extremely cohesive and user friendly. User friendly can mean many things. One of those is simply terminology. For example, in both Angular and Vue, templates can have child content. AngularJS and Angular use the terms Transclusion and Content Projection while Vue templates can have "slots": a term which doesn't require a CS degree to understand the intent.

The Angular documentation is simply not good: the organization, navigation, search, and writing style are vastly inferior to Vue's docs. Many sections are written in tutorial form repeating the same information (or mentioning important information in an unrelated section). It's hard to find what you're looking for and in many cases things simply aren't documented. For instance, speaking of Content Projection, it's a major feature and it's nearly impossible to find in the docs unless you already know ahead of time that it's called "Content Projection". I had to learn about it from a third party blog which made me question if it was even safe to use. There's even an open JIRA item noting this:

https://github.com/angular/angular.io/issues/3099

Other things that bit me recently were key modifiers in which the possible options are only mentioned on the github issue page (not in the docs).

Re:Angular 4.0.0 Now Available by thewhitetulip on Friday March 24, 2017 @04:56AM (#13947569)
True, I didn't mean to sound brash, I have edited out the statement, I wasn't belittling Angular, neither did I intend to say that Vue is the way better in it's internals over Angular. I wanted to share my experience that learning how to write an app in Vue was faster than Angular.

> In the end, whether you use Angular, React or Vue is really secondary to what you build with it.

yes and no, you are also making a tradeoff at the learning curve of the chosen framework.

Re:Angular 4.0.0 Now Available by minhoryang on Friday March 24, 2017 @06:03AM (#13947796)
+1
Re:Angular 4.0.0 Now Available by jholman on Friday March 24, 2017 @04:29AM (#13947474)
Meh, it says something, but not a lot.

Some tools are harder than others, sometimes because they accomplish more.

Imagine if you'd said "one day into learning about homeopathy, I was able to prescribe homeopathy-things, but after 4-5 weeks of med school I was still taking classes about blood cells."

I'm not actually defending Angular as such, because I am super ignorant about it. Perhaps Angular is a byzantine mess. But there are many great tools which do not have smooth onboarding procedures, which are still valuable because of how they work on complicated projects.

Of course, the BEST tools make easy things easy and hard things possible. Angular might (or might not) make hard things possible, but I think everyone agrees it's not particularly good at making easy things easy.

Re:Angular 4.0.0 Now Available by thewhitetulip on Friday March 24, 2017 @05:03AM (#13947590)
>Imagine if you'd said "one day into learning about homeopathy, I was able to prescribe homeopathy-things, but after 4-5 weeks of med school I was still taking classes about blood cells."

I get your point, I removed the last statement, it was incorrect. the thing is, I wanted to state that Vue is super easy to use, now, if it is a toy or a serious framework is upto the programmer to decide :-)

Re:Angular 4.0.0 Now Available by basdp on Friday March 24, 2017 @04:26AM (#13947467)
It says nothing more than Angular has a lot more documentation. Perhaps because Angular has a lot more features.
Re:Angular 4.0.0 Now Available by thewhitetulip on Friday March 24, 2017 @04:51AM (#13947545)
Please 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.

Re:Angular 4.0.0 Now Available by EugeneOZ on Friday March 24, 2017 @05:38AM (#13947708)
Try jQuery - even more simple.
Re:Angular 4.0.0 Now Available by thewhitetulip on Friday March 24, 2017 @06:11AM (#13947838)
I tried jQuery and found it to be more difficult to manage a single page app.
Re:Angular 4.0.0 Now Available by EugeneOZ on Friday March 24, 2017 @06:39AM (#13947972)
Same story with other "simple" frameworks - they are only simple while apps are simple.
Re:Angular 4.0.0 Now Available by randomThoughts9 on Friday March 24, 2017 @04:56AM (#13947568)
Some 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.

Re:Angular 4.0.0 Now Available by jamra on Friday March 24, 2017 @05:57AM (#13947772)
Observables are the most functional JavaScript library/mechanism I've worked with.
Re:Angular 4.0.0 Now Available by Uroboric on Friday March 24, 2017 @03:44AM (#13947323)
I 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.

Re:Angular 4.0.0 Now Available by kabes on Friday March 24, 2017 @05:10AM (#13947615)
Euhm. Jsx and vdom are exactly About abstracting away the browser environment...
Re:Angular 4.0.0 Now Available by marksomnian on Friday March 24, 2017 @05:52AM (#13947752)
Erm, 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.

Re:Angular 4.0.0 Now Available by ganarajpr on Friday March 24, 2017 @06:31AM (#13947927)
Ummm.. 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! ).
Re:Angular 4.0.0 Now Available by Uroboric on Friday March 24, 2017 @09:32AM (#13948772)
I 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.
Re:Angular 4.0.0 Now Available by acoard on Friday March 24, 2017 @11:43AM (#13949662)
> I 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.

He doesn't have it backwards.

He means they're "opaque" abstractions, in the sense that they're the opposite of a "Leaky Abstraction"[0]. A leaky abstraction is one wherein the abstractions below it "leak" up and you have to keep multiple abstractions in your head at once. This happens more with Angular than React.

I see what you mean by calling it a transparent abstraction though, since React's abstractions get out of your way and let you directly think about the lower level. This doesn't really fit with the Leaky abstraction analogy though, but it's a great point.

[0] https://www.joelonsoftware.com/2002/11/11/the-law-of-leaky-a...

Re:Angular 4.0.0 Now Available by hccampos on Friday March 24, 2017 @02:38AM (#13947125)
I 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.

Re:Angular 4.0.0 Now Available by cormacrelf on Friday March 24, 2017 @02:56AM (#13947190)
The 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.

Re:Angular 4.0.0 Now Available by hccampos on Friday March 24, 2017 @03:05AM (#13947213)
This makes me feel sad. As you said, maybe React could do more when it comes to packaging things up. I think Create React App is a good step in that direction but there is still work to be done.
Re:Angular 4.0.0 Now Available by stupidcar on Friday March 24, 2017 @05:38AM (#13947709)
React 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.

Re:Angular 4.0.0 Now Available by collyw on Friday March 24, 2017 @11:49AM (#13949707)
Having 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?).
Re:Angular 4.0.0 Now Available by avenoir on Friday March 24, 2017 @03:27AM (#13947268)
We 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.
Re:Angular 4.0.0 Now Available by gspetr on Friday March 24, 2017 @07:51AM (#13948267)
That 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.

Re:Angular 4.0.0 Now Available by hesarenu on Friday March 24, 2017 @01:58AM (#13946997)
As a longtime redux user i am all into Mobx now. It is simpler then redux.
Re:Angular 4.0.0 Now Available by uitgewis on Friday March 24, 2017 @03:16AM (#13947237)
Just 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

Re:Angular 4.0.0 Now Available by hccampos on Friday March 24, 2017 @03:23AM (#13947256)
Problem 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.

Re:Angular 4.0.0 Now Available by hccampos on Friday March 24, 2017 @02:50AM (#13947168)
For most apps, yes I think MobX is easier. However, both of them, combined with React/Preact are hugely superior to Angular.
Re:Angular 4.0.0 Now Available by jamra on Friday March 24, 2017 @05:55AM (#13947765)
Angular 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.

Re:Angular 4.0.0 Now Available by ergo14 on Friday March 24, 2017 @05:02AM (#13947585)
> 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).

Re:Angular 4.0.0 Now Available by jasim on Friday March 24, 2017 @06:32AM (#13947931)
Agree 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_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.

Re:Angular 4.0.0 Now Available by RandyRanderson on Friday March 24, 2017 @04:37AM (#13947505)
My 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.

Re:Angular 4.0.0 Now Available by humanrebar on Friday March 24, 2017 @05:50AM (#13947747)
Sorry, 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.

Re:Angular 4.0.0 Now Available by RandyRanderson on Friday March 24, 2017 @09:02PM (#13953471)
I 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.
Re:Angular 4.0.0 Now Available by humanrebar on Friday March 24, 2017 @11:42PM (#13953982)
The 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...

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.

Re:Angular 4.0.0 Now Available by throwaywgsid on Friday March 24, 2017 @04:22AM (#13947457)
Angular 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 :)

Re:Angular 4.0.0 Now Available by Retozi on Friday March 24, 2017 @06:21AM (#13947890)
I agree 100%.

TypeScript is an invaluable, mature technology that provides large productivity boosts to any team that maintains a mid-sized code base.

It plays extremely well with React too, and it's benefits are independent of the tech stack. If you are used to typed components/templates, you will NEVER want to go back.

I would argue that is more important to have static typing in the front-end compared to the back-end in a web-application context. There is more state, lot's of shared entities and unit tests are expensive to write and maintain.

Re:Angular 4.0.0 Now Available by gspetr on Friday March 24, 2017 @06:51AM (#13948021)
> There is more state, lot's of shared entities and unit tests are expensive to write and maintain.

Good point, but only to an extent: Unit tests boilerplate in dynamic languages that is redundant with static typing is only a (minor) subset of unit tests that you should be writing for your code. Static typing is not an excuse to skip unit tests altogether. I've unfortunately met people claiming exactly that...

Re:Angular 4.0.0 Now Available by gravlaks on Friday March 24, 2017 @08:11AM (#13948350)
In 2014 I used Typescript on a four month long project. I liked it alot compared to using just JS, however compiling was slow.

I retried using Typescript 1 month ago. Compiling took 6-7 seconds for about 8 files. I could not find a solution and gave up using TS. I hope that's just me doing not good enough research.

Re:Angular 4.0.0 Now Available by throwasehasdwi on Friday March 24, 2017 @10:47AM (#13949215)
Definitely something up with your environment. We compile hundreds of .ts files at my job each build and it only takes a few seconds
Re:Angular 4.0.0 Now Available by eljs on Friday March 24, 2017 @10:11AM (#13948984)
Must be something with your setup, tsc is known to be quite fast. Maybe try using it with the watcher? "tsc -w" and you'll never need to compile more than one file at a time.
Re:Angular 4.0.0 Now Available by Longwelwind on Friday March 24, 2017 @04:54AM (#13947557)
Typescript 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.

Re:Angular 4.0.0 Now Available by sundvor on Friday March 24, 2017 @06:35AM (#13947950)
I 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?

Re:Angular 4.0.0 Now Available by doczoidberg on Friday March 24, 2017 @08:17AM (#13948375)
I 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.

Re:Angular 4.0.0 Now Available by sundvor on Friday March 24, 2017 @07:36PM (#13953126)
Interesting; perhaps I ought to learn both, at least to a certain minimum level - to assess where I'm at with each as such.
Re:Angular 4.0.0 Now Available by throwaywgsid on Friday March 24, 2017 @11:20AM (#13949474)
I have heard the same from many people. Angular takes the web and makes it look like traditional event driven UI. This is not a bad thing at all, it's how UI works in everything that isn't web.

React is a lot less abstraction and feels more natural to people that started out making UI with plain HTML.

Each has its merits but Angular uses way too much magic for my taste to make the web seem like something it's not. Much like a client side re-imagination of webforms

Re:Angular 4.0.0 Now Available by lldata on Friday March 24, 2017 @08:18AM (#13948378)
Re:Angular 4.0.0 Now Available by sundvor on Friday March 24, 2017 @05:25PM (#13952346)
Thanks - that looks good, will check it out.
Re:Angular 4.0.0 Now Available by Vinnl on Friday March 24, 2017 @05:00AM (#13947581)
It's interesting how OP says people are moving towards more functional-style Javascript, but also dismisses statically typed Javascript. The two work really well together.
Re:Angular 4.0.0 Now Available by Fifer82 on Friday March 24, 2017 @05:10AM (#13947614)
(They don't understand TypeScript. The argument is as stale as the 0.8 release)
Re:Angular 4.0.0 Now Available by tomelders on Friday March 24, 2017 @08:23AM (#13948396)
Oh come on, that's a bit glib. I'm experienced with typed languages, it is possible to have a credible, critical opinion about TypeScript.
Re:Angular 4.0.0 Now Available by throwaywgsid on Friday March 24, 2017 @11:23AM (#13949486)
I'm convinced functional style is a fad and nothing will change my mind. The style has been around for forever and there's a good reason most languages are still OOP.

We're in the phase of the hype loop where everyone assumes language designers from 15 years ago are idiots. In another few years everyone will be talking about the revival of OOP

Re:Angular 4.0.0 Now Available by WorldMaker on Friday March 24, 2017 @12:20PM (#13949976)
Functional style programming is not a fad so much as a different taste. Not everyone will always have the same tastes. It's like peanut butter and chocolate: you can love only one or the other, you can also love both or know that each has different strengths for different needs (projects/desserts).
Re:Angular 4.0.0 Now Available by Vinnl on Friday March 24, 2017 @11:44AM (#13949668)
I can understand if people think it's a fad, but I would expect people who _do_ like it to also like TypeScript :)

That said, if someone thinks language designers from the past are idiots, then they also shouldn't like functional programming, as it's at least as old.

Re:Angular 4.0.0 Now Available by abiox on Friday March 24, 2017 @12:16PM (#13949937)
> nothing will change my mind

you seem a bit committed. is this an emotional thing?

> there's a good reason most...

is there? is this reason related to languages themselves or their use? does it necessarily imply anything specific about "functional style"?

Re:Angular 4.0.0 Now Available by copperx on Saturday March 25, 2017 @12:34AM (#13954123)
> nothing will change my mind

This is a HUGE red flag if you're seeking employment long-term in the tech sector.

Re:Angular 4.0.0 Now Available by breakingcups on Friday March 24, 2017 @05:29AM (#13947675)
I'm a huge fan of Typescript and not a big fan of Angular. I'm in the same boat as you.

Anders Hejlsberg has done a brilliant thing.

I'm also always a bit sad that Knockout seems to be overlooked a lot. It is not as opinionated but often times exactly the right tool for the job.

Re:Angular 4.0.0 Now Available by agopaul on Friday March 24, 2017 @06:03AM (#13947799)
I feel like Typescript is the only thing that will stick around for sure in the coming years.

Frankly, I don't know if I can say the same about all the other libraries/frameworks/etc since every month there is something new that's supposed to make all the other competing tools part of ancient history.

Re:Angular 4.0.0 Now Available by throwasehasdwi on Friday March 24, 2017 @10:52AM (#13949252)
The best thing about Typescript is that if it dies one day you can compile down one last time to pure, human readable, JS and toss it out.

There's literally no reason to not use typescript

Re:Angular 4.0.0 Now Available by jug on Friday March 24, 2017 @07:25AM (#13948159)
I haven't dabbled too much with it, but as still an outsider, Typescript + React honestly seems like a great fit especially to make it even more approachable.

What I like most with React over Angular is that it seems like it cuts to the core of the problem I'm actually trying to solve here. It just feels like a lean, clean, proper solution to the main issue at hand. (this of course helps with dev adoption too because it's easier to find people knowledgeable in lean frameworks, or at worst much quicker to train them)

Re:Angular 4.0.0 Now Available by dsiegel2275 on Friday March 24, 2017 @02:22PM (#13951024)
I agree also.

I've been using TypeScript with React now for about six months - prior to that I was working on a large React/Redux app written in ES6 using Babel.

In my experience, I have seen a significant increase in my productivity after embracing TypeScript. With the static type support I am fixing/avoiding more errors at 'authoring' time due to intellisense and the VSCode editor flagging what will be compile errors. I am able to refactor across files with a lot less fear.

The advanced types in TS (specifically discriminated unions) make Redux actions and reducer code a lot more maintainable.

Overall I'm very pleased with the transition to TS. I spent time learning Elm last year and simply fell in love with that development experience. For reasons out of my control I cannot use it in production but with my current TS+React approach I can at least get close to what Elm offers.

Re:Angular 4.0.0 Now Available by hasenj on Friday March 24, 2017 @07:06AM (#13948082)
I've never seen anyone conflate TypeScript with angular before GP's comment.

(And I happen to agree with him on angular being confusing and not well designed)

Re:Angular 4.0.0 Now Available by throwaywgsid on Sunday March 26, 2017 @11:04AM (#13961126)
Unfortunately I've met some devs new to SPA stuff and they believe it's either react/flow or angular/typescript. They're being promoted this way in the intro docs on both sides.
Re:Angular 4.0.0 Now Available by markatkinson on Friday March 24, 2017 @04:10AM (#13947419)
Holy 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.

Re:Angular 4.0.0 Now Available by veeti on Friday March 24, 2017 @04:48AM (#13947536)
If 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.
Re:Angular 4.0.0 Now Available by markatkinson on Friday March 24, 2017 @07:42AM (#13948240)
Oh 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.

Re:Angular 4.0.0 Now Available by scanr on Friday March 24, 2017 @04:18AM (#13947443)
Typescript works quite well with React, redux etc.
Re:Angular 4.0.0 Now Available by ergo14 on Friday March 24, 2017 @05:58AM (#13947777)
Go 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.