Live data from Hacker News

Angular 2.0

blog.angularjs.org

161–169 of 169 posts

Re: Angular 2.0

#161
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…

I don't see the problem. `` makes total sense to me. You show the content of that span when form.length.$error.float is truthy. Probably when it exists.

And yes, AngularJS absolutely defines its own language. The directives create an enhanced HTML (that you can enhance even further), and it has its own expression language where you can ask the value of `form.length.$error.float` without fearing null pointers.

This is basically what Angular is about, and why it works as nicely and cleanly as it does. And it's true; learning a new framework is absolutely comparable to learning a new language. Rails is not simply standard Ruby; it defines loads of new stuff that automatically handles things for you below the surface. Spring completely changes the way you work with Java. Grails has its own DSLs for various tasks.

Every framework has a learning curve. And a framework that doesn't change how you think is as useless to learn as a language that doesn't change how you think. But if you don't like learning, you can always simply stick to what you're familiar with.

Re: Angular 2.0

#162
post #151

Earlier quoted context omitted.

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.

XHTML is on the way out, I'm afraid. Angular is designed for HTML5.

Re: Angular 2.0

#163

Should this be marked as Angular 2.0 BETA? The docs say that it is not done yet. Also, the docs say that they do not know when they will be done. While I can understand that we may not know problem that arise, it is a pet peeve of mine that I never have a an idea when Drupal 8 will be released. I know that open source contributions are hard to track, we have to estimate (guess) when our projects will be done in our w…

> Should this be marked as Angular 2.0 BETA?

Not really, since it's not remotely in Beta yet. It sounds like early alpha at best.

Re: Angular 2.0

#164
post #30

All I really need are client-side templates and awesome DOM binding. What's the current best options?

Backbone.JS, it's exceptionally bare bones, but hey it's YOUR code. You don't have to memorize an entire framework like Angular. Pick up a Backbone book and in two weeks your dangerous enough to use it. A month, you're in the groove. 6 months: Angul-who?

> Pick up a Backbone book and in two weeks your dangerous enough to use it. A month, you're in the groove. 6 months: Angul-who?

Is this supposed to sell Backbone? Because I'm on a similar curve with Angular with just the online docs. Doing stuff in Angular is really unbelievably easy once you let go of your old preconceptions. It's a new way of thinking, but it's one that's very effective.

Re: Angular 2.0

#165
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…

>How semantic is ng-show="form.length.$error.float?

I could not care less. I find that talk about web programming has been polluted by non-terms like "semantic" that doesn't mean anything specific (in the context).

Especially the whole hoopla with regard to "semantic HTML", with designers (who don't know much if anything about programming, and just heard this "semantic" term from a few industry fad gurus) using it to insist developers should treat HTML as a format for reuse (as if the reason we write HTML is to enable better screen scrapping).

Endless discussions about whether it's ok to a DIV if it's purely for display purposes of not, as if HTML/CSS dont already make a clusterfuck of separating markup from presentation.

Fuck "semantic HTML" -- it's a presentation format, that also happens to have a not-that-functional styling component. If you wan't reuse and semantics, get those from the data level (the db, the REST endpoint, etc), not from code meant for browsers.

Re: Angular 2.0

#166
post #151

Earlier quoted context omitted.

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.

>That seems like a poor reimplementation of XML namespaces

Or you know, an adoption of only the needed part, instead of all the BS junk that comes with XML namespaces.

>Why not use XHTML at that point?

Because of all the other junk that comes with it. And because it comes from W3C.

Re: Angular 2.0

#167
post #65

Earlier quoted context omitted.

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.

I never understood how JQuery and JS were just dumped the past 3-4 years in favor of all thse complex frameworks like AngularJS, Ember, etc... is there something these frameworks can do that JQuery can't? Can they make fancy single page apps and JQuery can't? I need to be enlightened. Or is it simply ppl need to exercise their mental creativity?

>* is there something these frameworks can do that JQuery can't? Can they make fancy single page apps and JQuery can't? I need to be enlightened.*

jQuery has nothing to do with whether the app is single page or not.

Those frameworks make writing single page apps very easy.

Re: Angular 2.0

#168
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…

You can make your custom directives HTML5 compliant, see [1], you can use the HTML5 data- prefix. For instance: can instead be coded as: or something similar. [1] -- http://docs.angularjs.org/guide/directive

Custom elements are part of the HTML5 spec too:

http://w3c.github.io/webcomponents/spec/custom/

The only requirement is that they have a dash in the name. So while is not a valid HTML5 element, would be.

Re: Angular 2.0

#169
post #21

Earlier quoted context omitted.

The intention is to use it with Traceur, which is an ES6->JS transpiler that works right now. It's like writing a framework in CoffeeScript or dart2js - users shouldn't care about the implementation language, the ultimate binary is just a blob of JS that works on browsers - except that the source code will eventually run natively in the browser.

Just to clarify, even Traceur has a hard time supporting browsers before IE10. Though I agree that it is not an issue here.

FYI, your last post on the Nvidia post is dead.
Post reply on HN