Live data from Hacker News

Glimmer.js: What’s the Deal with TypeScript?

medium.com

111–112 of 112 posts

Re: Glimmer.js: What’s the Deal with TypeScript?

#111
post #38

Earlier quoted context omitted.

There is the possibility of decorators for stuff like this. Angular makes a lot of use of them.

But isn't that some sort of repetition? I don't know how Angular does this so I'm really asking.

Well, it depends on the sort of reflection you want. Decorators get a decent amount of knowledge about the code.

Re: Glimmer.js: What’s the Deal with TypeScript?

#112
post #74
post #56

Earlier quoted context omitted.

>better ... language ... Python ES5 was a dumpster-fire. But ES2015+ is an amazing language. You just have to take the time to systematically study it. If you're choosing a language you'll spend thousands of hours with, you shouldn't use "initial learning curve" as sole criteria.

Amazing? make an object: in ESx: var myObject= { a: { b: { c: { d: 'some value' } } } }; in Coffeescript or Livescript: myObject= a: b: c: d: 'some value' now use it: in ESx: console.log myObject.b.c.d // crash, myObject.b does not exist how to prevent? if ( myObject.hasOwnProperty('b') and myObject.b.hasOwnProperty('c') ){ console.log myObject.b.c.d // undefined } in Coffeescript or Livescript: console.log myObject.…

It's cheating a bit to indent the JS option only. I don't think:

myObject= a: b: c: d: 'some value'

Is really _that_ much of an improvement over:

myObject = {a: { b: { c: { d: 'some value' } } } }

especially combined with an editor that will match those closing brackets for you. And the reality is that if you have object literals that deep, chances are the inner values will also be large enough to justify expanding it anyway.

Also lodash plugs a large number of holes in the standard functionality. In most projects I work at, I'd write something like:

_.get(myObject, 'b.c.d')

for your second example.

Post reply on HN