Hacker News new | past | comments | ask | show | jobs | submit login

I think this is part of the problem. Adopting "strong mode" will make lots of modern code obsolete. At least there are sane alternatives though, but it would also require setting empty properties on classes and undermine duck-typing. Yes, it's doable, but it fundamentally requires a non-dynamic approach to JavaScript programming, a highly dynamic language.



Object.assign (or equivalent with libraires like jQuery or Underscore or what have you) is very much modern code. Hell, Object.assign is ES6.


You misunderstand. Object.assign is as available today as is `typeof foo.bar === 'undefined'` or `_.defaults(...)`. Yet I doubt even the majority of modern code always uses them consistently because `if (foo.bar)` or `foo.bar = foo.bar || 1234` is much simpler and much faster.


> Adopting "strong mode" will make lots of modern code obsolete

The same could have been said for strict mode.


Yes, but that's exactly my point; "strict mode" eliminated a lot of the consensus "bad parts". "strong mode" discourages modern utilized features. Not only are accessing undeclared properties and mutating classes not considered "bad" by the majority of the community, but in fact they're actively relied upon as a feature. It's almost as if Google didn't bother convincing anyone they were bad, because they wouldn't succeed, and instead jumped straight to ruling by fiat, which is precisely why in my opinion this is dead on arrival.


> It's almost as if Google didn't bother convincing anyone they were bad

That's what this proposal is.

You can disagree and discuss alternatives, and that's great, because that's how standards get written.


That's a little too, um, "magical" a version of how standards get made.

In truth it's a pay-to-play sausage-making fest, with incumbents privileged against newcomers -- but at least with the Web, some 10M growing to 20M developers are the ultimate sued-to-woo power.

I'm not yet worried about Google cramming this down other browser vendors' throats. MS and Apple will only come on board when it's in a state where Mozilla is on board too, I predict. This may not happen, so don't count on anything. Do use and report usability and other bugs.


> That's what this proposal is.

Perhaps you're right, and I merely remain wholly unconvinced, though I acquiesced in the OP that perhaps it will be necessary. Optimizability dictating language features to this extent is the tail wagging the dog. I think this would undermine the ecosystem by creating a subset that is neither Java nor JavaScript, neither safe nor dynamic; a lowest common denominator of sorts that may do more harm than good in the competition with native.


Going slightly away from the topic, which I agree with you entirely on, btw...

This is pure speculation on my part, but I wonder if a lot of the Google devs involved in JS in one way or the other just aren't that used to writing it.

It's this quote that caught my attention

    Optimizability dictating language features to this extent is the tail wagging the dog.
Apologies to Java devs if this is uncharacteristic of the community, but a lot of Java devs I know seem to put performance and vm internals ahead of expressiveness.

AngularJS is another project that strikes me as being heavily Java inspired (although it's neither expressive nor performant), almost as if its authors are used to writing desktop applications in Java or C# and just wanted to port their experience to the browser.

It's as though the authors of Gmail or Google Docs are not people developing these other things.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: