Link collection: 15
Mateusz
Random Aeropress Recipe
What makes life boring is routine. Feeling that the current day is the same without changes as the one before. But - I hear you cry - it’ll never truly be the same, there will be always something that changes. That’s true, we perceive some events as the same when in fact they clearly are not carbon copies of each other. Take for example going to work, you’re doing something different today than your did yesterday. But if the work is dull and repetitive, you’ll learn to smooth those bumps of difference and come out with the conclusion that today’s was the same as yesterday. Over time some things that bring you joy and excite you start becoming background instead of a chosen foreground. Why? Because it’s repetitive. It has become a routine. For me the word routine has negative connotations when it does not imply anything that should be avoided. What should be avoided is repetitive routine.
My routine is drinking coffee basically everyday. I’m the snobby type that brings his own beans, grinder and the whole parade with him whenever and wherever he can. It brings me joy, waking up and having this ritual of brewing a cup is sometimes more important for me then actually drinking what I made. My secret is that I sometimes while going to sleep think about that coffee making process that will happen in the morning. All and all there are mornings where I’m not really looking forward to making that coffee with the same passion as I used to. My ritual has become a repetitive routine where every move is calculated and was the same the day before. This stupid randomizer basically allows you to have fun, to be a human. Do you notice any difference in the taste when you change this parameter? You actually might! And that routine might become an adventure that at the beginning was never something you signed up for. To summarize: have fun, stop being text book perfect with things that bring joy to your life.
Handles are the better pointers
It’s impossible to stress how earth moving, mind changing and perception shifting reading about data oriented design was for me. This blog post was the easiest to wrap my head around and provided me with the biggest hammer I now have in my programmers tool box. Hammer being the ability to create complex data structures with arrays and storing indexes into these arrays instead of raw pointers. And abracadabra you’ve achieved the simplest serialization/deserialization in the world, reduced memory used and unknowingly decreased the risk of dereferencing an invalid pointer. All of that by simply changing what you store in your structs. This thinking was allowed to flourish while working on a side project of dis. To cut long story short, really thinking about how I’m going to store data simplified the code to the point where it’s laughable to even show it to somebody. If you design well the way data is stored in a simple and predictable way the simplest and most performant code just drops out on to your lap. When looking back at my previous (unfortunately unfinished) project of debag and the way I’ve handled storing DWARF data I can see that I’ve grown. And in the direction that I wanted to grow when I was writing that unfinished project in the first place. If you want to store a pointer to something think if the underlying memory will not be fragmented by that and if storing an index won’t reduce the overall memory footprint.
Untangling Lifetimes: The Arena Allocator
The arena allocator was one of the first stops on my data oriented design journey. It started while reading 4coder’s plugin framework source code and seeing the use of arenas for memory allocation. For someone that really only understood the ability to allocate memory was fusing malloc/free into a pair. I was intrigued because the idea of a scratch arena was immensely useful. Outlining some size of allocated memory as available for use lower down the chain and freeing all of that at once by simply destroying the arena was beautifully simple. Creating a scratch arena at some level and using it at every called function reduces the lifetime from a tree into a stack. It’s much simpler to think about something in ways of stacks instead of trees. And do not think that everything can be solved by simple stacks. Hard problems are hard. But 90% of the time we are dealing with simple problems that are perfectly suited for simple solutions. My advice for anybody wanting to simplify their code is to see problems that you do not have a simple solutions for and see how others did it. Projects that are worth following are ImGui or Zig. And while mentioning Zig I have to share this amazing talk by Andrew Kelley.
Antoni
<missing-link>
Recently I’ve read a piece about human brain and found a very interesting information about consciousness that changed my world perspective. The catch is - I do not remember where I have read it, what is more, I read about this concept in another article and also lost it. Certainly, the Second Brain setup is much needed.
The main idea that stayed with me was that our inability to be in the present moment is not a bug, it is a feature. The evolution simply promoted the less impulsive behaviors, people living in the present moment were more careless and very often died due to “not worrying too much”. The people that thought more during their daily life maybe were not the most happy ones, but they were able to predict that going into the forest without fear would equal potential death threat.
All this recent push about “being in the present” started to make sense for me. It does not mean that we are broken and should try to fix ourselves, that we are wasting our lives, that we restrict ourselves from happiness. NO, this is more about trying to be in the present, but at the same time being conscious that 99% of the time we won’ be.
What is amazing about our human condition is that we can try, we can change for a moment, we can become something different for a brief period of time and after observing that feeling decide if we would like to hold onto it.
A Brief Disagreement
Once upon a time, during mindless Youtube scrolling, that I am not proud of, I happened to click on this interestingly looking video. The animation made by Steve Cutts resonated with me, I was stunned about how many ideas can be transferred during 3 minute video. The concept of short animated movies, all short movies in general, really clicked inside my head and I became short film watcher, for a brief period in history. I can truly recommend few of them:
What I particularly enjoy about short forms are the ideas that the leave you with. Because the movie is too short to show you everything, it only presents brief parts of the history, leaving you with much space to think and wonder. Some videos really left me thinking about them for days, especially the one with the window. I recommend checking it out, in my opinion this is a really great alternative to many videos that we watch. They can be categorized as fast entertainment, but in contrast to fast food, they leave you with more than just handful of empty calories. They activate your brain.
The Death Dilemma: Are Hospitals Overtreating Patients
During one of he weekend at home I spent evening talking with my mom about life and as it turned out, death. She told me that we are going to watch a movie about priest Kaczkowski Śmiertelne życie. He founded a hospice for terminally ill patients, so the topic of death is very close to him. In this film he shares his attitude to death, how he treats the patients, how he talks to them. He popularized the idea about dying with dignity, he shares his stories, how he treats dead bodies, how the death is a biological process that everyone should understand. Why some processes are well known? We all know that after drinking alcohol the next day will come hangover after we will feel okay. And some are not? That the human brain dies after approximately 6 minutes.
Tabularized, overlooked, unpleasant. Those adjectives come to my mind when I think about topic of death in public debate. People really do not put too much thought to it, but it backfires.
There comes a time when you or someone in your family becomes seriously ill or even dies and what happens? The world simply stops, you start being the passenger and observe the events from the backseat, nervously shouting at the driver. The emotions, panic attacks, neurosis, depression. It all could be prevented if we were prepared for it. And by that I do not mean that you live with a thought that your mother will die and when she dies it is just another day in the business. I am talking about floating it inside our consciousness and building the needed vocabulary to reason about the situation. Having pre-built neural paths allows us to make better decisions, more objective ones, not provoked by emotions, which often lead us to a dead end.
This idea came to me second time. I even wrote about it in one of the previous editions (How doctors choose to die).
meta post
This is not another link but rather a confession. For the last week I was finishing my diploma project, writing 500 days a day (in English). And oh boy, during writing this post I certainly felt that writing is a skill that can be trained. Any other post was not written as smoothly as this one. And I am not talking in terms of speed. The whole process was under my control, I view the next as chronological story in which I want to share something with someone, using words as a tool. And it is just that, you start to notice how to write something, what is not needed, what will distract the reader, what will make him interested. You just start to feel it, think in terms of writing. Beautiful feeling.