Live data from Hacker News

Angular 2.0

blog.angularjs.org

151–160 of 169 posts

Re: Angular 2.0

#151
post #86

Earlier quoted context omitted.

I agree with you that since your elements appear to not be a part of the HTML5 spec they must be custom and are directives, wouldn't it be a good idea to mark them as such in some way? Maybe prepend them with "an-" or something? The reason being, considering that HTML5 is an ever evolving spec that it might be possible for a new element to be introduced that could be using the same name as one of your examples. That…

Maybe prepend them with "an-" or something? Yes, this is actually the recommended practice from the documentation. Built-in Angular directives are typically prefixed with `ng-`, and they suggest that other projects/developers use their own prefixes to avoid conflict.

That seems like a poor reimplementation of XML namespaces.

Why not use XHTML at that point? If XHTML ever had a clear mission statement in life it was that.

I mean I thought XHTML was a curse a few years ago when it was The Thing Every Good Designer Uses™ since it couldn't be rendered as XML in the most popular browser. But hopefully that's not as much an issue anymore. Or maybe it is. I haven't kept up with IE.

Re: Angular 2.0

#152
post #113
post #72

Earlier quoted context omitted.

imo AngularJS can be pretty micro and scales nicely. Its one of its major strengths, as you can use it to just build a tiny widget inside an existing page or all in and build a huge application.

Micro in the code you write, not the code that's loaded, so it doesn't seem practical to me.

It's worth noting that one of the goals listed for 2.0 in this post is increased modularity, which they imply will let you only load the pieces you're actually using.

Re: Angular 2.0

#153
post #65
post #15

AngularJS has a J2EE mindset. Where libraries grow to become as hard to learn as programming languages themselves. It does not make semantic sense to me anymore. Here is an example from the site: Length (float): {{length}} This is not a valid float number! How semantic is ng-show="form.length.$error.float? smart-float sounds like C++. If programming languages worked like this, we wouldn't have built many apps. The pr…

This is true. AngularJS is much better than what we had before, it is kind of large and monolithic. The cycle probably goes thusly: Large monolithic framework comes and shows everyone a new way of doing things (Angular/Django). People think it is too large and monolithic, so make microframeworks (Flask/Whatever comes after Angular). The next step will be a kind of happy medium.

such as vuejs?

Re: Angular 2.0

#154

Earlier quoted context omitted.

You're not wrong. It's definitely one way to solve it. I just find it harder to jump into a project with heavy reliance on global events and be able to quickly understand what's going on. It gets even harder if you have events firing other events.

> I just find it harder to jump into a project with heavy reliance on global events Harder than what?

Harder than the way that it is done in Angular, via services.

Re: Angular 2.0

#155
post #48
post #23

Earlier quoted context omitted.

I only looked superficially at React, so maybe I got something wrong, but the HTML/XML intermingled with Javascript seems extremely off-putting to me, akin to ASP/JSP/PHP.

The thing that sold me on React was this statement: "Most people make the mistake that the DOM is a place you put things." The DOM is what the user sees. That's all. With React, you have a virtual DOM that can hold everything, not just what the user sees. It's a pure data structure, and can be manipulated as such. Because that DOM is a pure data structure, React can figure out for you what parts have changed, and re-…

>Most people make the mistake that the DOM is a place you put things.

I guess this is why Angular keeps the model separate from the DOM.

That said, the virtual DOM strikes me as a really good idea I'd like to see in Angular.

Re: Angular 2.0

#156
post #2

"All code in Angular 2 is already being written in ES6. As ES6 doesn’t run in browsers today, we’re using the Traceur compiler to generate the nice ES5 that runs everywhere. We’re working with the Traceur team to build support for a few extensions like annotations and assertions." That's pretty cool.

On the one side, yes; on the other though, it's a shame that the technologies we use or want to use for web applications right now (HTML5, ES6, etc) are just not done, standardized or implemented yet.

JS not good enough? We'll invent new languages; Dart, Typescript, Coffeescript, etc. ES6 not yet done? We'll build a transpiler so we can fiddle with it until it's done - if ever.

I just wish the standardisation processes for web technologies would go faster. We get small revolutions every 2 years or so, but the standards behind them only get updated every decade.

Re: Angular 2.0

#157
post #92

Earlier quoted context omitted.

I don't understand how that correlates to the current DI. How do I rewrite the following using the new DI system? function MyCtrl($http, Base64) { $http.get('http://www.example.com').success(function (data) { console.log(Base64.decode(data)); }); }

import {Http} from 'angularjs/http'; import {Base64} from './base64'; @Inject(Http) @Inject(Base64) export class MyCtrl { constructor(Http, Base64) { Http.get('http://www.example.com').success(function (data) { console.log(Base64.decode(data)); }); } } Not too bad, right?

I don't like it at all; the Http and Base64 imports require three tokens / lines to import, while the existing DI just needed one. RequireJS requires two (array entry, callback parameter).

I'll stick to ES 5 / Angular 1.2 if we're required to write this much boilerplate to achieve the same thing.

Re: Angular 2.0

#158

Earlier quoted context omitted.

What about the blind who use screen readers or braille displays? Why should the page become so bloated that I can't read simple text simply?

This is not an endorsement (or not) for blogs that rely on JS, but apparently 98.6% of screenreader users have javascript enabled.[0] [0] http://webaim.org/projects/screenreadersurvey4/

Doesn't mean that it's makes for a pleasant or useful experience. Viz http://hanselminutes.com/413/im-a-blind-software-technician-... from a sibling comment of yours.

Also, I'm surprised I got downvoted for saying that we should be considering the disabled when making decisions on how to structure a blog. I know accessibility isn't _cool_ but it's the right thing to do, especially for a text-based site, like a blog.

(PS: mendelk, I'm not accusing you of downvoting me)

Re: Angular 2.0

#159
Unfortunately, Angular 2.0 sounds like a project killer. Let's abandon the huge effort put in by the community, and build this shiny new framework with all the latest and greatest (and currently unsupported) tools. Let's support everything we can possibly foresee, and make the ultimate framework that will never need improvement. That is until Angular 3.0, when we'll need to support ES8...

Rewriting a successful framework with no backward support is suicide. Please read this link before continuing on this path: http://www.joelonsoftware.com/articles/fog0000000069.html. Another informative example is Perl 6. The 'rewrite' killed Perl. Microsoft also did this time after time, forcing developers to constantly rewrite their applications instead of spending time writing new products. Even Python 3, with it's limited incompatibilities, had a very negative effect on the community: https://programmers.stackexchange.com/questions/63859/why-do....

Why should I bother supporting Angular 2.0, since 2 years from now the developers are going to get bored and want Angular 3.0? The community is NOT going to take the time to rewrite all their code to scratch your itch. My time is very limited, and I need to be selective where I use it. I love Angular, but there is zero chance I will rewrite any of my code for Angular 2.0. It's not going to happen. I'm quite certain that my sentiments are shared by other developers who have put in far more time and effort than I have.

My strong advice is to fix and optimize what you have. If there are areas that need rewriting or rearchitecting, then do it, but leave a clear upgrade path and don't break existing apps where possible. Sorry, but that's how software works.

You have a ground breaking, beautifully designed framework. Please don't destroy it because it's not perfect. Nothing is.

Can someone at Google please talk some sense into the developers running this project?

Re: Angular 2.0

#160
post #141

Earlier quoted context omitted.

Require.JS is a service locator. It's not an inversion of control dependency injector. You can swap in a different service locator for your tests, but it's messier than just directly passing in different dependencies for your tests.

RequireJS is not a service locator,it's a module loader. It doesnt instanciate anything.AngularJS DI IS a service locator, not a dependency injection container.

You're confused. A service locator doesn't have to instantiate anything.

Angular's injector, like Guice's injector is a service locator. Because the normal way to use AngularJS is to simply list your dependencies instead of requesting what you want from an injector instance, it is an IOC DI framework.

Post reply on HN