Today I came across Model Thinking Full Course. It’s 11 hours of lectures about formal models. What they are, how to use them, etc. Kind of interesting but I don’t have that much time to give it.
Category Archives: Philosophy
You can trust this article because it’s written by academics
I just needed to make a note of this unironic statement which I read here:
The Brain User’s Handbook: A Neuroscience-inspired Guide to Peace of Mind
I am reading The Brain User’s Handbook: A Neuroscience-inspired Guide to Peace of Mind which has this awesome image I want to share:
A Revolution in Thought? – Dr Iain McGilchrist
I enjoy hearing from Iain McGilchrist. I do believe he is truly wise.
Dependency Injection in MediaWiki
Today I read the documentation for how Dependency Injection is done in MediaWiki.
I had a few small nits to pick (such as their statement that services should be stateless) but… fair enough.
For myself I don’t usually use Dependency Injection and a Service Container, instead I prefer the Service Locator pattern which I find is simpler and more economical to use, especially in PHP where there is a single process per request.
Extreme late binding
There’s a famous quote from Alan Kay that you will see bandied about:
OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things.
I think I agree with him, but I often find myself wondering quite what he meant by “extreme late-binding”. I suspect he means that object instances can redefine stuff they inherited from their concrete class. If your OOP platform doesn’t support that, you can emulate it with data and API.
ChatGPT for the day
User: explain profundity
ChatGPT:
Profundity refers to a state of being deep in thought or insight. It’s often associated with ideas, thoughts, or expressions that have significant depth of meaning, understanding, or insight. Profundity can apply to various contexts, including intellectual discussions, philosophical concepts, artistic works, and emotional experiences. When something is described as profound, it usually means it has a deep impact, is very thoughtful, or offers substantial wisdom or insight. Profundity involves layers of meaning that may not be immediately apparent and often requires contemplation or reflection to fully appreciate.
Context object versus global variables
I’m reading A Philosophy of Software Design by John Ousterhout and he says:
The context object unifies the handling of all system-global information and eliminates the need for pass-through variables. If a new variable needs to be added, it can be added to the context object; no existing code is affected except for the constructor and destructor for the context. The context makes it easy to identify and manage the global state of the system, since it is all stored in one place. The context is also convenient for testing: test code can change the global configuration of the application by modifying fields in the context. It would be much more difficult to implement such changes if the system used pass-through variables.
Contexts are far from an ideal solution. The variables stored in a context have most of the disadvantages of global variables; for example, it may not be obvious why a particular variable is present, or where it is used. Without discipline, a context can turn into a huge grab-bag of data that creates nonobvious dependencies throughout the system. Contexts may also create thread-safety issues; the best way to avoid problems is for variables in a context to be immutable. Unfortunately, I haven’t found a better solution than contexts.
Okay, so I’m just gonna step way out of line over here and suggest something heretical… but shouldn’t you just use global variables? You only introduced the context object so you could tweak it in unit tests, and you could just change your tests so that each one ran in a new process. Just sayin’.
…I suppose for the sake of completeness I should add a little more from Ousterhout which he said prior to the above:
Another approach is to store the information in a global variable, as in Figure 7.2(c). This avoids the need to pass the information from method to method, but global variables almost always create other problems. For example, global variables make it impossible to create two independent instances of the same system in the same process, since accesses to the global variables will conflict. It may seem unlikely that you would need multiple instances in production, but they are often useful in testing.
…so he is bending over backward to support multiple tests in one process, but he could just run each test in its own process and his problem evaporates.
The Internet Con
Today I was referred to Cory Doctorow‘s new book: The Internet Con: How To Seize the Means of Computation. Apparently it’s basically just about the idea that web services should interoperate. I’m not going to read this one, but you might?
Large Language Models and The End of Programming – CS50 Tech Talk with Dr. Matt Welsh
Here’s an interesting talk about how we won’t need programmers very soon: Large Language Models and The End of Programming – CS50 Tech Talk with Dr. Matt Welsh.
If refers to the following books: