18 Matching Annotations
  1. Jan 2022
    1. My gut told me calling an async function from the setTimeout callback was a bad thing. Since the setTimeout machinery ignores the return value of the function, there is no way it was awaiting on it. This means that there will be an unhandled promise. An unhandled promise could mean problems if the function called in the callback takes a long time to complete or throws an error.
    1. Fundamentally, I think promise rejection is substantially different than "throwing" under normal synchronous flow.
    2. const promise = Promise.reject(new Error("Something happened!")); setTimeout(async () => { // You want to process the result here... try { const result = await promise; console.log(`Hello, ${result.toUpperCase()}`) } // ...and handle any error here. catch (err) { console.error("There was an error:", err.message); } }, 100);
    1. we should have the unhandledrejection event handler (for browsers, and analogs for other environments) to track unhandled errors and inform the user (and probably our server) about them, so that our app never “just dies”.
    2. What happens when a regular error occurs and is not caught by try..catch? The script dies with a message in the console. A similar thing happens with unhandled promise rejections.
    1. There are a lot of nasty gotchas with unhandled rejections. That's why Node.js gives you a mechanism for globally handling unhandled rejections.
  2. Nov 2021
  3. Sep 2021
  4. May 2021
  5. Mar 2021
  6. Jan 2021
  7. Aug 2020
  8. May 2020
  9. Feb 2016
    1. 43 Garvey Linn and Tomita 1972 discovered that almost 1/3 of authors who had a paper rejected had "abandoned the subject matter area of their articles" within a year (p. 214).

      Garvey, William D., Nan Lin, and Kazuo Tomita. 1972. “Research Studies in Patterns of Scientific Communication: III. Information-Exchange Processes Associated with the Production of Journal Articles.” Information Storage and Retrieval 8 (5): 207–21. doi:10.1016/0020-0271(72)90031-9.

    1. On the cost rejected papers add to the peer review system (p. 119): "The cost to the academic community of refereeing was estimated by Tenopir and King in 1997 to be $480/article (based on an average time 3–6 hours per article by each of 2–3 referees). At 2004 levels this is approximately $540 per submitted article. Clearly,the percentage ofpapers which are rejected makes a difference to the over- all cost to the journal; in a reasonable quality journal at least 50% of papers will be rejected, while some top journals (e.g. Nature) may reject as many as 90%. Most articles get published somewhere, and as they work their way through the system, being refereed for different journals, they accumulate additional cost; indeed, it couldbe said that a poor (or, at least, inappropriately submitted) article costs the system much more overall than does a good one."