I love how Rust, by not providing a mechanism to throw errors, forces you to think and model all possible outcomes.
In my experience with TypeScript/JavaScript, I often take a more relaxed approach, where some errors are modeled while others are thrown. This depends on whether they represent valid use cases (even if they are failures) or unexpected issues (true exceptions).
I'm tempted to use this in my next TS/JS project: <github.com/jfmengels/eslint-plugin-fp/blob/master/docs/rules/no-throw.md>
Why gql.tada seems to not get the publicity it deserve? It's brilliant!
Yesterday a friend of mine asked my opinion on a job they took. It's about using OpenCV.js to detect the the colors of a urine strip test from a smartphone camera in a web app.
We bounced some ideas on constraints and assumptions we cold make. Lighting conditions, support to hold the strip during the photo, operator skills, etc.
I showed them what ChatGPT 4 could produce and the result by just providing a prompt of 4 lines is mind-blowing.
Not only it produces code that is sound and works, but it suggested a different OpenCV API approach compared to the one I was thinking of (find contours vs. Haar-cascade detection) that is way simpler and probably more reliable (by just making some tweak to the image acquisition UX).
Impressive!
What was the point of the 'prototypal inheritance vs. classical inheritance' debate in the early 2010s? Nowadays, many new developers probably don't even think about it, and everything still works just fine.
<tsx.is/> is a pretty good alternative to `ts-node`, especially for any local repo script.