Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
esailija
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
31 ms
·
271.
▲
by
esailija
11y ago
How do you live in such a bliss ignorance where supposedly an order of magnitude difference in performance between two state of the art browsers doesn't make you reconsider even for a second that you might have not written a working b
272.
▲
by
esailija
12y ago
not if you are using any kind of event emitters. These don't participate in any kind of flow but fire "error" events as side effect sneakily in the background, and if there is no listener on an event emitter for the "err
273.
▲
by
esailija
12y ago
It doesn't matter at all what kind of promise flavor an API returns because promise implementations treat other implementations as interchangeable. Even the ES6 Promises implementation supports this: Promise.all([{ then:
274.
▲
by
esailija
12y ago
With proper bytecode you would have to do bytecode verification so no.
275.
▲
by
esailija
12y ago
In JavaScript you can't make any backward incompatible changes, let alone remove anything. Because what browser would want to implement stuff that breaks websites for its users?
276.
▲
by
esailija
12y ago
No reason why it couldn't work on the server: create multiton versions of stores and when a page is ready to be rendered assign the state of the multiton instances to the corresponding singleton instances, call render and return the si
277.
▲
by
esailija
12y ago
Promise is the best thing an async library method could return because it's always trivial to convert into anything you want (callback, stream, async/await, yield whatever you want) because it's the only thing that's sta
278.
▲
by
esailija
12y ago
> If you are using a language where the standard libraries are so poorly implemented that you can easily write better versions, you might want to consider using a different language. Standard libraries are typically generalized for a wid
279.
▲
by
esailija
12y ago
If I am going to add a dependency for some shit like this, it better at least be exceptionally well optimized and have no bugs.
280.
▲
by
esailija
12y ago
Well look at JavaScript where self (this) works exactly the same way (it's conceptually just another argument to a function) but is passed implicitly and declared as parameter implicitly. People are not very happy with that either...
281.
▲
by
esailija
12y ago
`async/await` is only for sequencing, it's not gonna replace anything other than `.then` chains. If you have such chains to the extent that you think `async/await` will solve your problems, you should think very hard if every
282.
▲
by
esailija
12y ago
One is not even a tradeoff* and the other is completely unrelated to having an all async ecosystem. *Anything available in other languages in place of callbacks (promises, generators, async await etc) is also available in node. If you are u
283.
▲
by
esailija
12y ago
Using any CPU is a fundamental mistake?
284.
▲
by
esailija
12y ago
I am not sure what you are even saying. My point is that if the most optimal way would result in some other iteration order, that would be the iteration order experienced by users and that it is just a coincidence that the most optimal way
285.
▲
by
esailija
12y ago
It results in different hidden class because the whole point is to be able to reference named fields by fixed offsets from the object location in memory (same as for example reading struct fields in C). If the order changes, so will the off
286.
▲
by
esailija
12y ago
doubles and SMis have been unboxed in arrays (the internal array that backs the integer key properties of an object) for a long time at least in V8.
287.
▲
by
esailija
12y ago
JS objects don't have the same property, whatever order you see from iterating JS objects is only a side effect of the standard hidden class optimization, not because there was intention of having a certain order. In fact if you mix in
288.
▲
by
esailija
12y ago
You can also use Object.create, __proto__ setter or a custom abstraction. However the constructor pattern is in practice used everywhere and I find nothing wrong with it, in fact in the next language version it will get first class syntax t
289.
▲
by
esailija
12y ago
Yes, it's actually a wiki page in a node.js project.
290.
▲
by
esailija
12y ago
V8 can inline getters and setters like it can inline normal functios.
291.
▲
by
esailija
12y ago
They should just provide an operator like ::, then features that can be implemented without special language support don't need to bloat the spec. array::last() would mean same as last.call(array) that means `last` ca
292.
▲
by
esailija
12y ago
Indeed the majority of the time the correct way to handle an error is to propagate it up to the caller...no shit. which is why requiring manual plumbing everywhere to do just that is ridiculous. And forgetting this manual check even once is
293.
▲
by
esailija
12y ago
Challenge accepted https://gist.github.com/petkaantonov/067c5f21395e7fe1f81d
294.
▲
by
esailija
12y ago
These snippets are not even remotely equal. Leave the former untouched and modify the latter to this and you have somewhat equal semantics: function doSomething(null, pushEight); function pushEight(err, res) { if (err) re
295.
▲
by
esailija
12y ago
In mithril promises if you return undefined from then, the promise will fulfill with the previous value, I.E. it behaves like .tap in other promise libraries (because doing this in a .then like mithril does violates the spec - which is evid
296.
▲
by
esailija
12y ago
Maybe the code was untested or only tested in firefox or node, where `console.log` is bound (which is sane default for singletons if you ask me)
297.
▲
by
esailija
12y ago
I made a fix for a mongoose issue that sounds like what you describe and landed it in 1.2.3[1]. Can you verify? And if what you describe is a different issue can you make a github issue? (or is mongoose doing something so crazy that it cann
298.
▲
by
esailija
12y ago
It does work for any library that uses callbacks - a node library that uses callbacks but not the node js callback convention has a bug. 1) There is not much work in promisifying libraries, for example the entire redis library can be promis
299.
▲
by
esailija
13y ago
jQuery API is nothing like the DOM API. This library is a list of functions that are nothing but proxies for some other functions which you might as well call directly. Given that the author has written this http://zedshaw.com&#x
300.
▲
by
esailija
13y ago
I would not say this[1] is a minimal difference :P [1]: https://github.com/petkaantonov/bluebird/blob/master/benchma...
More ›