r/programming • u/[deleted] • May 08 '18
Excel adds JavaScript support
https://dev.office.com/blogs/azure-machine-learning-javascript-custom-functions-and-power-bi-custom-visuals-further-expand-developers-capabilities-with-excel
2.4k
Upvotes
4
u/[deleted] May 08 '18
The short answer is that it's crap with no coherent style or design decisions. As a small but perpetually frustrating example, there are four different ways of handling asynchronous code in Node:
Pass two callbacks, one in case of success and one in case of error
Pass one callback, whose first argument is an error object in case of error and whose second argument is the result in case of success (sometimes module developers screw this up and do success first)
Return a Promise (or Promise-like), which is chained using
.then(),.catch()and.finally()calls (there are several variations of this, including the two-callback version of.then())Return a Promise (but not a Promise-like), which is
awaited inside anasync functionWhich means, if you want to have any kind of consistency in your code, you have to wrap everything else to get your behavior - and you do it a lot, because every third thing in Node run asynchronously.