Here's my view: the real world doesn't have any free functions. Say a plate breaks in your kitchen. What happened? Obviously some kind of an object derived from a circle and and and some sort of factory? And, uh. Josh you mentioned broken plates. So, as far as a broken plate, I think we can address this by adding some methods for how many pieces the plate is currently in and which broken piece we're talking about then we can specify each broken piece as a simple polygon from the origin of the virtual object, that being the theoretical still-intact plate as manufactured. We can also specify each plate in terms of the deviations from the platonic ideal plate as specified in the CAD designs. So let's change all the signatures to refer to EITHER 1 whole piece, being the whole plate, or the first broken piece, second broken piece and so on, which can all end up in different places in the world. Ultimately this will cover just about everything except if someone makes an artisanal plate by gluing together previously broken plates, where they're not from the same plate. That will make garbage collection difficult as the artisanal factory might leak memory if it doesn't use every piece. The solution is to simply do manual garbage collection where we replace each derived plate that is made up of broken plates, with a new plate that is pre-broken, and we just have to set what pieces it is made of, and then the original pieces can be freed. So actually the base case does need to know whether it is considered "whole" despite being made up of broken pieces, and then it can have virtual pieces that comprise it but know that they have to move and be together as one. This basically captures the plate abstraction pretty well, as long as you remember that we decided that for the dinner function we decided to set a plate, rather than set a table, so you just do the glass.set() the fork.set() and plate.set() so on, and then you can check that it's set, whereas the table they're set on might have unrelated items such as a candle, that isn't really considered set or not.
Javascript: how about we all just use paper plates. do whatever you want with them.
Programmer: also works! Obviously we'll automatically update the DOM tree whenever the server thinks anything's changed, but that's just common sense.
Javascript: ...also feel free to pour soda in them, paper plates are cups too.
Javascript: how about we all just use paper plates. do whatever you want with them.
Programmer: also works! Obviously we'll automatically update the DOM tree whenever the server thinks anything's changed, but that's just common sense.
Javascript: ...also feel free to pour soda in them, paper plates are cups too.
Typescript: hold it! Not so fast!