Reputation
1,609
Top tag
Next privilege 2,000 Rep.
Edit questions and answers
Badges
1 12 19
Impact
~34k people reached

1d
comment Any reason to continue using plain strings in ES2015?
Not sure what you're getting at. I'm not discussing whether JavaScript should or should not have evolved the way it has, just asking whether there's any practical reason to continue allowing single- and double-quoted strings in my in-house coding standard for ES2015 code.
1d
asked Any reason to continue using plain strings in ES2015?
Jan
28
awarded  Famous Question
Jan
21
comment Why are native ES6 promises slower and more memory-intensive than bluebird?
@MörreNoseshine sure, I only mean to have a friendly discussion, if you're interested :) You said it's an "unfortunate situation for everyone if this is all true", but I don't think it's so unfortunate if you look at it this way: Bluebird is just a library that follows the Promises/A+ standard, while V8's Promise object is an implementation the ES6 Promise spec. The latter spec defines a very particular, rigorous, play-it-safe API for making promises. So it's fair enough that a tool that doesn't implement that spec (e.g. Bluebird) could easily outperform V8's Promise.
Jan
21
comment Why are native ES6 promises slower and more memory-intensive than bluebird?
@MörreNoseshine (continued) Years later, the ES6 authors came along and said "hey, let's specify that JS engines must provide a generic Promises/A+ conforming utility out-of-the-box, so people always have a basic promise tool to hand". This is a nice convenience (not having to import a library just to do a quick Promise.resolve() or whatever), but it's a very basic implementation, and its existence should not put you off using more serious promise-related tools like bluebird!
Jan
21
comment Why are native ES6 promises slower and more memory-intensive than bluebird?
@MörreNoseshine "I really don't want to use a Promise library when there's an internal implementation." I think you're thinking about this wrong. ES6's Promise global is not special or definitive. The promise standard is called Promises/A+, it was written long before ES6, and it defines promises as a duck-type that different codebases can agree on for passing around control flow.
Jan
4
comment Why doesn't ES6 have thin-arrow functions?
Awesome, thanks. This is what I was looking for. Still a bit confused about the apparent disapproval of dynamic this-binding, especially seeing as ES6 class methods use it, and seeing as you have to use it if you want a function to have a name. It feels to me like a weak attempt to half-bury a core feature of the language; even if that feature should never have existed, half-burying it seems like it would make it even more of a footgun. Anyway thanks for the answer.
Jan
4
accepted Why doesn't ES6 have thin-arrow functions?
Jan
4
comment Why doesn't ES6 have thin-arrow functions?
@WinstonEwert hang on, are you saying the people making the decision would have preferred if they could change function() to inherit this from surrounding scope like => does? In that case, wouldn't this just refer to the global object everywhere? Sounds weird. Where did you hear that?
Dec
29
comment Why doesn't ES6 have thin-arrow functions?
Thanks for your answer but I don't think it covers it. Less doesn't mean simpler; I'd argue it's more complex having to switch between two very different function syntaxes just to get different this-binding logic (compared to switching a single character). Having "multiple types of functions with varying semantics" is not a terrible idea; it's exactly what we do have in fact. And I don't see what backwards compatibility has to do with anything we're talking about. I'm not suggesting they should have removed support for the classic function syntax, if that's what you mean
Dec
29
revised Why doesn't ES6 have thin-arrow functions?
added 493 characters in body
Dec
29
revised Why doesn't ES6 have thin-arrow functions?
added 507 characters in body
Dec
29
awarded  Cleanup
Dec
29
revised Why doesn't ES6 have thin-arrow functions?
rolled back to a previous revision
Dec
29
asked Why doesn't ES6 have thin-arrow functions?
Dec
10
accepted Does immutability hurt performance in JavaScript?
Dec
9
awarded  Notable Question
Dec
9
awarded  Good Question
Dec
9
awarded  Popular Question
Dec
8
awarded  Nice Question