News for hackers. Stuff that matters.
Re:Better Promises in JavaScript by felixfbecker on Monday September 24, 2018 @07:37AM (#18056795)
I love it when articles just put statements out like "This syntax would be much better, wouldn't it?" and then just assume the answer is obviously yes and don't find the need to provide any arguments for that.

I disagree. Explicit is better than implicit.

Re:Better Promises in JavaScript by franciscop on Monday September 24, 2018 @08:16AM (#18057015)
I agree, explicit is better than implicit. But redundant is worse than non-redundant. This library just provides syntax sugar to make things cleaner. There are many times that arbitrary decisions have been taken. Why cannot you wait to an array of promises? Wouldn't that be explicit and clear?
Re:Better Promises in JavaScript by monsieurbanana on Monday September 24, 2018 @12:06PM (#18058840)
Awaiting an array of promises looks neat, but it has a (small?) caveat: you can't do the same for the non-await version. You can't do `[...].then()`.

I'm less fan of the second proposition. Imagine someone seeing that snippet on internet and copying it: he would have no way of knowing that ".text()" is actually a promise and could potentially be making more I/O calls than he thought.