noblethrasher
https://users.cs.duke.edu/~rodger/articles/AlanKay70thpoints...
I have the honor of being the person that incited him to create his first account, which he only used once, to improve something that I said.
“A parser for things
Is a function from strings
To lists of pairs
Of things and strings”
After noodling with with the spec for half an hour or so, I’ll usually have enough insight/confidence to start coding/debugging.
Link to original demo: https://www.uselesspickles.com/triangles/ (the site's certificate is expired, so you'll get a warning).
“In the progress of the division of labour, the employment of the far greater part of those who live by labour, that is, of the great body of people, comes to be confined to a few very simple operations, frequently one or two. But the understandings of the greater part of men are necessarily formed by their ordinary employments. The man whose whole life is spent in performing a few simple operations, of which the effects too are, perhaps, always the same, or very nearly the same, has no occasion to exert his understanding,or to exercise his invention in finding out expedients for removing difficulties which never occur.
He naturally loses, therefore, the habit of such exertion, and generally becomes as stupid and ignorant as it is possible for a human creature to become. The torpor of his mind renders him, not only incapable of relishing or bearing a part in any rational conversation, but of conceiving any generous, noble, or tender sentiment, and consequently of forming any just judgement concerning many even of the ordinary duties of private life. Of the great extensive interests of his country he is altogether incapable of judging; and unless very particular pains have been taken to render him otherwise, he is equally incapable of defending his country in war.
The uniformity of his stationary life naturally corrupts the courage of his mind, and makes him regard with abhorrence the irregular, uncertain, and adventurous life of a soldier. It corrupts even the activity of his body, and renders him incapable of exerting his strength with vigour and perseverance, in any other employment than that to which he has been bred. His dexterity at his own particular trade seems, in this manner, to be acquired at the expense of his intellectual, social, and martial virtues.
But in every improved and civilized society this is the state into which the labouring poor, that is, the great body of the people, must necessarily fall, unless the government takes some pains to prevent it.”
—Adam Smith, The Wealth of Nations
It's worth watching from the beginning, but I've linked to the relevant timestamp (8:30).
The big idea behind scalability (IMO) is that we want the pain of maintaining a system to grow logarithmically with respect to the size of the system. Now, size can mean many things (number of customers, lines of code, etc.), but pain is almost always complexity. A potent cure for complexity is symmetry, because every time that we discover a new symmetry, half of the complexity goes away. One way of finding symmetry is to look for invariants.
Roughly speaking (very roughly), having lots of possible states is good (the more states, the more powerful/featureful the system), but having lots of state transitions is bad (especially with respect to security). REST “verbs” help to control complexity by imposing invariants on state transitions. For instance, one good invariant to enforce is that a GET transition mean that a state can always be a start state, whereas a POST must always have an antecedent state. Thus, a REST verb is just label for a set of invariants, and we’re free to choose whatever set of invariants we want. Obviously, the more invariants you have, the weaker they are since an invariant is supposed to be unchanging; i.e. if the size of set of invariants is close to the size of the set of states, then you effectively have no invariants.
Using your example, you'd have two states: `PrepareDeleteUser` and `DeleteUser` where the latter is only reachable from the former. PrepareDeleteUser will check that the all preconditions are satisfied (e.g. that the current operator has permission to delete the user). Now, you may not choose to reify these states so directly (i.e. you'll just have a deleteUser function that does a check for the preconditions), but they must exist in a robust application nonetheless.
In REST we name our states so we can drive the state machine by using the names (following hyperlinks). Why? Because, among other things, this keeps the client decoupled from the server by letting the client be in control of when to effect a state transition, but keeps the server in charge of what transitions are possible.
I need to attend to some real-life concerns at the moment, but I hope to get back to this discussion soon.
Cheers!
I tried to implement an IMAP server a few years ago, but otherwise I don't know much about it. However, I do recall that Mark Crispin admitted that he wasn't a very good API designer, and that much of the complexity of IMAP was due to it being intertwined with the complexity of MIME. But, I can't find the sources for those claims at the moment.
Why?
Because your application is going to have thousands of nominal states, and each one is going to need to support all of the verbs because of the uniform interface constraint.
Why a uniform interface?
A lot to say about this, but basically, the set of verbs is an abstraction of the state machine that is your application. If you have a million states and a million verbs, then you have no abstraction. If you have ten states and a hundred verbs then you have too much abstraction (i.e. you ran afoul of YAGNI). A good degree abstraction is somewhere in between, but if you care about scale (which is the raison d'être for REST), then the size of set of verbs is going to have a logarithmic relation to the size of the set of nominal states.
Responding with a standard error code is okay for verbs that are not supported at a particular state, but it's the uniform interface constraint that forces you to keep the set of verbs small.
Also, HTTP has nine verbs: GET, POST, PUT, DELETE, HEAD, CONNECT, OPTIONS, PATCH, and TRACE.
"In My Best Fiend, Herzog says that one of the native chiefs offered in all seriousness to kill Kinski for him, but that he declined because he needed the actor to complete filming"[1]
I included this note on the flowers to be delivered to my SO:
Me: { 1/n : n ≥ 1 }
You: { 0 }
Us: Me ∪ You
My policy is that anyone that completes the technical screen (2 – 4 hours of work) gets an on-site interview.
Just this morning, I had to spend about 20 minutes debugging a candidate’s code to get it to both build and run, but he’s still getting invited for an on-site.