When I write object oriented code, some function has to fetch or generate or tell an object to generate the initial set of information that starts an app. When I write functional code, some imperative command has to tell a database or a file to spit out the initial information. When I write declarative code, I assume that the information that I am acting on just exists already.
Always, initialization is an afterthought in my programs, done in an ad hoc way, that breaks all the beautiful patterns that my predecessors have prepared for me. Has there been any serious research or experimentation into how systems should initialize themselves?
I finally realized that initialization is a concept that I do not understand well while reading Tom Ashworth's excellent introduction to the ideas behind communicating sequential processes. I had been reading it because I was struggling to find a clean way to initialize Flux (actually Reflux) stores in a larg-ish isomorphic React app, but now I realize that passing the information around isn't really the problem I am wrestling with (although CSP channels look really really cool); the problem is deciding what information will be needed to initialize the entire app, before it starts running in any particular context (home page, reseller manager's agent management page, etc.)
So, initialization. Is it a thing? Do people study it in a general sense, outside of the divisions of programming paradigms? Are there enlightening 40 year old papers on this topic that have been forgotten and partially rediscovered?
Aucun commentaire:
Enregistrer un commentaire