Live data from Hacker News

Angular 2 Final Released

angular.io

311–320 of 452 posts

Re: Angular 2 Final Released

#311
post #208

Earlier quoted context omitted.

"Why would you consider JS to be a terrible language? " JS is kind of a 'bad language' because: 1) It's missing some pretty important things. Try to determine if a value is a number. Seriously. Look into that mess. Or anything else. Doing simple type-checking is crazy, and we basically are resigned to 'best practices' - which is crazy. 2) Prototype chaining is a neat idea and has some merits - but in reality it makes…

Es6 and typescript fixes all this.

"Es6 and typescript fixes all this."

ES6 doesn't fix any of it, typescript fixes some of it.

Re: Angular 2 Final Released

#312
post #77

Earlier quoted context omitted.

Any chance you can do a quick cons review too? Specifically comparing to the weakness of Angular 1 like bloated complexities, issue with custom directives or scope life-cycle.

The main con I can think of are all the extra tooling and dependencies required. However, even though angular-cli is yet another tool, it aims to solve the extra tooling problem so you don't have to know how the tools work and how to configure them. Managing third party dependencies with NPM still isn't fun and can be frusturating IMO, but it sure beats script tags.

BINGO! It smells like GWT all over again.

I love experimenting with ng-1: make a static HTML mockup; add a stub controller with a sample model and modify the HTML to insert the data and edit things as needed; add some event handlers with dummy actions. (add your REST calls later...)

All of the above can be done w/out any server or compile process - just keep reloading the page when you make changes (perhaps using something like python's SimpleHTTPServer module to serve files from your development directories). Once you get things about how you like them, start on the server side. This approach won't work for a page with a complicated workflow, but you can still prototype quite a bit for an initial learning experience.

Re: Angular 2 Final Released

#313

As someone who uses Angular 1 currently but would pick React for their next project, I'd love to see a list of reasons why I should use Angular 2 over React. If nothing else, Angular just stranded all their developers, while React has a huge head start on mindshare/plugins/tutorials/etc.

I recently started a new front-end-heavy project and ended up just using Angular 1 instead of React. The decider for me was the amount of tooling that React needs you to have in place just to get up and running. React expects you to do your development on some flavor of Unix, and really doesn't have a sane plan for Windows, so you lose VS.NET and its huge productivity gains. And it needs tools upon tools upon tools t…

Manually reload the page? No thanks, way too slow. Using React hot loader and can't go back.

Re: Angular 2 Final Released

#314
post #95

As someone who uses Angular 1 currently but would pick React for their next project, I'd love to see a list of reasons why I should use Angular 2 over React. If nothing else, Angular just stranded all their developers, while React has a huge head start on mindshare/plugins/tutorials/etc.

Why not choose Vue.js? It's extremely simple, fast, easy to get started with, and very similar to Angular.

I like vue.js, the only and biggest concern is that it is a single developer project, I'm deciding between react and ng2 now because of that concern, leaning towards react right now.

Re: Angular 2 Final Released

#315
post #301
post #26

Earlier quoted context omitted.

All three frameworks are excellent at helping us build ambitious front-end applications; you simply can't go _wrong_ by picking one over the other. If a particular framework's trade-offs don't for any part of the app (performance for example), you can always write just that part in a different way (manual DOM manipulation). But to contrast all three, I'll pick the area I'm most interested in - templating. The purpose…

Apologises if I'm miss reading this > Angular and Ember allows state and logic inside HTML. State updates do not occur in Ember templates. Templates specify the follow data from one component to another, as well as callbacks which are names of actions defined in a javascript portion of a component, or a parent component. But it does not allow you to specify how state is updated within the template. In terms of Logic,…

That is exactly what I meant, sorry for not being clear. State mutation definitely happen only in code everywhere, and not in templates (if we exclude two-way binding).

But by logic I meant all sorts of control structures, which though looks light-weight at first, needs a large number of language elements to function. To name a few: variables, expressions (which in turn need operator precedence rules), scoping, and even composition if we count partials/templates with it. Loops on the other hand requires not just simple array iteration syntax, but also over hashes, and it also needs other constructs like filtering (`todo in todos | filter:search`).

This is my biggest complaint with adding logic to text templates; behind the apparent simplicity there is always an entire language.

Re: Angular 2 Final Released

#316
post #287
post #192

Earlier quoted context omitted.

Having used TypeScript and also picked up recent projects where it is not being used, TS is definitely the way to go. The issue is that TS 1.8 doesn't support async/await in the browser until v2.0, but a ts -> babel transpile does the job nicely.

Microsoft stuff not allowed in my stack...

Why? It's Apache 2.0 licensed...

Re: Angular 2 Final Released

#317
post #109

I use Angular 2 in production since November 19, 2015 (alpha.46). Currently I've built 3 web apps (40, 60 and 20 components each), 3 mobile apps (with Ionic 2) and my employer have plans for more apps. Breaking changes during alpha stage were expected, so I didn't have issues with it. Most positive things I want to highlight: 1. Components are encapsulated and truly reusable (and without dependencies hell). 2. You do…

I really really really wish they'd called it something like Bosium just to make searching for issues a lot easier. I keep coming across angular 1 solutions.

I wonder if Angular will develop into a sort of "Perl 5 vs 6" thing? Perhaps if many people just aren't ready, willing and able to make the jump to the next version.

Re: Angular 2 Final Released

#318

Earlier quoted context omitted.

Do you know of any large projects that use Angular 2? I just want see how readable the projects are.

Not sure if this helps, but trying to learn Angular2 I wrote a weather app with it using RC5. It is not the cleanest and I never used Angular 1 so I can't do a comparison. https://github.com/mattsmithdev/weathercard.angular2

you can refactor those nested observables using mergeMap:

  this._settingsService.settings$.mergeMap(settings => {
  
          this.settings = settings;
          return this._weatherService.getLatestWeather(this._location, settings);
      })
      .subscribe(
          weather => this.weather = weather,
          error => this.errorMessage = error
      );

Re: Angular 2 Final Released

#319

Earlier quoted context omitted.

1) well look at that! I guess i've gotten a bit spoiled relying on lodash as much as I do! 2) There are aspects of prototypes that JS makes much worse (mainly the whole "this" clusterfuck), but the base is pretty sane and easy to understand. But at that point i'm not even talking about javascript any more, so I guess you are right here too. 3) I still disagree with you here. Yeah, there should be a way for the stdlib…

"But another benefit of multiple different implementations is they are free to optimize for different things." Every language has that. There are different JVM's, different C/C++ compilers, different python interpreters. JS is not 'at any advantage' here - and again - the drawback is the ridiculous fragmentation we see across browsers - which is ... bad - at least compared to other languages.

But I wouldn't even say that. Look at the C/C++ situation. Microsoft as a platform doesn't support a ton of C, every compiler has it's own ways of using undefined behavior, there are tons of extensions and "only works on compiler X". Look at python where even if you ignore the 2/3 split, you have ironpython, cpython, pypy, and more that all have their own quirks, differences, and incompatibilities. It's pretty often you see a python library that only works on cpython.

For all it's issues, JS has mostly moved past that. It's pretty rare to see a javascript program or library (that's not just a tech demo) that only works on one implementation. Hell Microsoft released a node.js fork that runs on chakra, and to my surprise every single one of our node applications runs on it without a single change or hitch. (i haven't looked up if this is "normal" or if i got lucky though, so take it with a grain of salt).

Now obviously it's not perfect, and we should strive to be better, to fix these issues, but it's not like javascript is in some unprecedented scenario here. I actually think that the IE6 days have pushed JS to fix a lot of the problems that are plaguing other languages in this area.

Re: Angular 2 Final Released

#320

Earlier quoted context omitted.

1) Isn't it just (!isNaN(num) && isFinite(num))? I know that's pretty far from intuitive, but it's not as bad as you made it sound. That being said, i'd love an `isNumber` function at some point... 2) I felt the same way for a while, but recently I was working on something where I ended up really "abusing" the prototype system, and when you actually spend the time to learn it, it's not that bad! It's different, that'…

"1) Isn't it just (!isNaN(num) && isFinite(num))? I know that's pretty far from intuitive, but it's not as bad as you made it sound. That being said, i'd love an `isNumber` function at some point..." You just proved my point! A) Even if you are correct - it's terrible . This is completely ridiculous that there's no basic check for extremely common and mundane type-checking. Moreover, it's the same issue for other typ…

FFS read the code before spouting random stuff.

(!isNaN('100') && isFinite('100'))

Negation (!) before isNaN()

Post reply on HN