@functionalscript BTW, I can see the appeal of going class-less—it’s more reminiscent of functional programming. Alas, JS misses a few features here—especially algebraic data types and matching.
I find myself starting with object types and often (not always) converting them to classes because I prefer them over factory functions for objects when things get more complicated: – Methods – Explicit runtime type
Problem: Subclass S can’t invoke its constructor and return the result. TS will complain that `this` could be an instance of a subclass of S; then type is indeed wrong.
🟢 Approach 2: structuredClone Downsides: A. Prototypes not preserved (*) B. Private properties not copied
– 0.1 + 0.2 and the floating point format – Type coercion – Automatic semicolon insertion – Why so many bottom values? – Increment (++) and decrement (--)
1/ W.r.t. optional parameters, JavaScript having both `undefined` and `null` becomes useful because we can distinguish between a parameter being `null` and it being omitted. (Probably not enough of an upside to outweigh the downsides elsewhere.)
In light of this, I’m wondering if we should try to never explicitly use `undefined`—unless we need to skip a positional parameter:
Manual by Infocom: "Learning ZIL: everything you always wanted to know about writing interactive fiction but couldn’t find anyone still working here to ask"
I love how each file stored on Google Drive has a unique ID and is not identified by its pathname. Thus, we can rename any component of a pathname without losing the link with the file. We can even move it somewhere else.
It reminds me of Lifestreams where a file system is a chronologically ordered stream of files with unique IDs. Instead of folders, there are tags and queries. That makes creating a file simpler because we don’t have to choose a name and a location. https://2ality.com/2011/04/information-management-classics.html
Update: As mentioned in the replies, the blue dot was alerting me to a new feature (code spaces). Once I clicked on the “learn more” link, it went away.