Hello and welcome to my little nock of the internet. Here I have my blog which mainly contain posts about tech, the outdoors, cooking, and some times mead brewing.

A bit of background information before you step into my world of crazy. I am Lars, a.k.a. looopTools, a Software Engineer living in East Jutland, Denmark. I have 10+ years of experience from industry mainly through student positions, but also as self-employed consultant, or full-time employee. I mainly work in low-level user space, high-level kernel space, and storage systems in general. Besides research and software development, I also love the outdoors and try to go out as often as possible (not enough at the moment) and I am an aspiring author currently working on a few different novels. I also dabble in being a more advance home cook and baker, which you may see some posts about. Finally I like the ancient art of brewing mead, a.k.a. honey wine, and experiment with different flavour combinations and ageing times.

Why I read books

04 October 2022

For some reason, many people find it weird that I read books and own many books. They do not get why I do not just watch television series instead. So I decided to write a blog post about it.

First of I do watch series, movies, and YouTube. I am not anti-modern culture. But there is just something about books, in all their forms, printed, ebooks, and audiobooks, that is amazing to me, and I see certain benefits when I read compared to periods where I do not.

Now let us get into it. In periods where I do not read and only watch YouTube videos of like 5-10 minutes in length, I see a decrease in the amount of time I can focus. This also holds true for 10-20 minutes long TV series episodes. I am aware that no study has ever concluded that short video clips can affect attention span, but this is my own experience. This is simply unacceptable to me, as I do not want my attention span to decrease. On the contrary, I would actually like to expand it. Her books help. I observe that in periods where I read as little as 10 minutes per day (yes, sometimes I time it), I still see a positive impact on my attention span. Therefore, I like to read and read a lot. To be honest, during my masters and PhD periods, I did not read anything for enjoyment, although I did buy books, and it has taken some time for me to ramp back up, and I am far from the speed I used to be at before. This leads me to the following reason, destressing, Reading helps me a lot in terms of handling daily stress, and it lets me disappear into another world, kind of the same way as meditation does.

Next, letting my fantasy loose. I have a very vivid imagination. I can entirely create scenes with sound effects and everything in my head on the fly as I read. I like this; it feels like hallucinating, and I enjoy it as it fully lets me submerge into a land of dragons, sail the open sea, etc. To me, it is truly magical and gives my brain time off, so again, destressing. Just ask my girlfriend and mom how long it can take me to get out of fantasy land sometimes. In extension to letting my fantasy loose, it also serves as inspiration for my own stories and plot lines (yes, I seek inspiration). It lets me create alternate worlds, and I love it. Morphing other authors’ universes to my ideal is an exercise I do a lot while reading; to me, it is fun.

There is also the aspect of learning something. For example, I do not limit my reading to fiction. I read books about music (how it works), languages and how they evolve, history, philosophy, and more. Books let me dive deeper into a topic than an online article (unless it provides references) and lets me focus on that topic alone. I love learning, and books are one of my sources for this.

Finally, for those who do not know, I am a little bit challenged in spelling and writing, yet I still love to learn languages. Through reading, I get better at spelling and, thereby, writing. Not just simple words, reading helps me discover new words and helps me learn how to spell them, thereby enriching my vocabulary. Additional, this also extends my verbal communication, which is a fantastic bonus. This is not just limited to my native language (Danish) and English but also the new language I am learning or relearning. For instance, I am learning Farsi (Iranian Persian) and learning to read Farsi helps in learning new words (although I still butcher the pronunciation), and the same goes for Spanish and German, where the latter I am relearning. Reading has become a wonderful tool for learning a new language and expand my communication abilities.

Before I close up a little note, most of the benefits and experiences I have mentioned, I also experience with audiobooks. Some audiobooks limit my fantasy when they add sound effects (looking at you, Star Wars audiobooks). But I will say that they are a great tool too.

Now to close. These are the reasons I read a lot and why I am getting more and more reading done. I hope I have inspired you to read more or start reading.

./Lars

[Book Review] How to Write Everything

21 September 2022

As some may know I am working on a fantasy novel and during this process I am also working on becoming an overall better writer. Therefore I constantly on the look out for resources which can make me a better writer. One such resource came on to my radar via the Writing Community over on twitter (The hash tag is #WritingCommunity, I don’t believe there been created a community yet), this was the book How to Write Everything by Mr. David Quantick.

I have the book both as an Ebook (I did read it) and on Amazon Audible, where the latter is narrated by Mr. Qyantick. The book is described as the ultimate handbook for every aspect of writing, both in reviews I have read and by people on twitter. Here I will give my review of the book, it will not be in the same style as the Nocturnal Blood review, but I still wanted to give it a go.

The review

Mr. Quantick is a well versed writer who have written basically any style, plays, for television, movies, books, and so on. He presents an impressive CV through out the book that makes you feel like it words coming straight from the horses mouth. The content of the book is present as a correlation of interviews of other writers, personal anecdotes and experiences, and advice for the reader.
This also means that the picture paint in the book is not unicorns and rainbows, writing is clearly not presented as straight road without bumps, twist, and turns. By utilising this approach Mr. Quantick presents the reader with what feels like a more realistic perspective (compared to other writers advise resources I have read or watch before). Which is good as it makes you take the advice more serious and I can already tell you that I am using some of these on a daily basis. Thus, the book basically already have qualified itself as pretty good.

However, it does not stop there. Mr. Quantick takes us on a journey through multiple disciplines of writing as already state. Where for each he compare it to other at least one other discipline and explains how it differs and what people you interact with. For instance both for plays and movie scripts he explains the potential head butting with directors and actors. Yet he also explain how input from none writers should be taken seriously and also your ideas will probably change. This is an important notion that I feel a lot of new writers (and probably also more experienced once) are not ready for and can have a hard time coping with.

Another thing that I find important is how he explains the process of submitting a manuscript (novel, news article, etc.). How it can be rejected, accept, and (potentially) stolen and there is present an abstract description of how to act in each scenario. Furthermore, Mr. Quantick also emphasis how we as writers are not unique when it comes to ideas in particular a focus on inspiration and how two or more people can have the same idea or get inspiration in a similar way resulting in a very similar piece of work.

I do not feel like I can fully justify the amazing advice, warnings, and realisations which Mr. Quantick presents in this book without it just sounding like one long praise fest. Literally the only critique I have with the book is that the interviews presented in the book can be confusing in the audio book version, but that is not the case in the printed version. All in all I feel like all aspiring writers should read this book to be douched in a healthy spray of realism and advice.

Finally, I would like to dive deeper into the two advice I follow daily at the moment. Write every day and Always have something to write on and with. I have found that when I take breaks from writing, even if it is just jutting down notes about my stories I kind of slack off and procrastinate, essentially not training my writing. Which I have found that like other things, it needs practice and in my experience even more than other areas I work in. Therefore, I have started to write everyday, it may not be on my main work in progress, it may just be ideas, but I get something done. As for always having something to write on I have started to always have my phone one me with the note app on the first spring board and I try to carry a pen and paper when I go for walks. This lets me quickly jot down ideas I get on the run and it makes me practices writing every day.

Although, I have not covered the content of the book in depth here, I hope you understand why I fully recommend this book.

./Lars

Why do we strive for short type names in programming languages?

26 August 2022

Like most developers I am not coding just a single programming language and I do keep up to date on new programming languages. Lately however, I have seen a trend I do not really like in static typed programming languages that I do not like and it is in particular present in Rust and Zig. So what is this trend? Well really short unreadable type names! Below I first have a C++ example of a simple sum function (ignore the overflow issue) and then the same function implemented in rust. For C++ we have the type uint64_t and for Rust u64. Now let us assume I am newcomer from Java, C#, or C, in C++ I know its and int I would also argue that I could guess its 64 bit. Additionally, if you play around with enough programming languages u is often used as a short hand for unsigned so you might be able to guess what that part. The _t has always bugged me, but I can deal with. However, with rust all you have to go by is u64 so you know it is 64 bit and like with C++ you could problem resonance yourself to the conclusion that it is an unsigned variable. But unsigned what? float, integer, something third? You literally cannot tell. With time of course you will remember it, but if you (like me) have to switch between multiple language during a single day, it is sometimes difficult to instantly remember what the different types hiding behind u<INSERT NUMBER>, i<INSERT NUMBER>, and so on. I am at a stage now where I can but it took a long time, but it was one of the reason I originally gave up on learning Rust, because I found it to convoluted and like it was intentionally gate keeping with is type names.

uint64_t sum(uint64_t start)
{
    uint64_t res = 0;
    for (uint64_t i = start; i > 0; --i)
    {
        res = res + 1;
    }
    return res;
}
fn sum(start: u64) -> u64 {
    let mut res: u64 = 0;
    
    for i in (0..start).rev() {
        res = res + i;
    }
    
    return res;
    
}

I do not understand this design decision was made in Rust and I honestly think that it scares some people away. Why have this been chosen? Please stop.

./Lars

Please Stop using Electron

19 June 2022

Just stop, that is it, that is the tweet.

That is a tweet I see a lot in particular when it comes to people criticising both Node.Js and Electron. If anyone criticise these two technologies online in particular on Twitter and LinkedIn, immediately a horde of developers with jump in and defend these two technologies or simply tell people to stop criticising both of them. However, in both cases I find critique is in order and in particular when in comes to requesting people to stop using either of them. In this post I will focus on Electron and why I believe we should stop using it. I would also like to credit Nick host of The Linux Experiment on YouTube who made this video ELECTRON: Why people HATE it, why devs USE it for inspiring this post. Also any resource stats I list here is from a Mac, but I have seen roughly the same numbers on Windows and Linux as well.

Let us get started, with What is Electron? Electron is (at its core) a framework that allows developers to build application across multiple platforms in JavaScript, HTML, and CSS. With intention and promise of making it possible to make application for all platforms easy and trouble free, which to its credit it actually does. But wait is JavaScript, HTML, and CSS not web programming/markup languages? Well yes and this is why Node.JS (from here I will just call it Node) is involved in these shenanigans. Node allows you to run JavaScript “outside” of a browser on (almost) any platform, yes it is a JavaScript runtime. Okay that sounds all good, doesn’t it? We develop one application and then it runs everywhere, simple, inexpensive, and expands the amount of customers we can reach as Linux, MacOS, and Windows is within our grasp from the start. Well yes, but there is a dark side.

If you use Google Chrome you will know that it eats system resources (RAM, CPU, etc.) for breakfast, lunch, and dinner, and if you have 16GB of RAM or less it literally sucks as a browser (it sucks for other reasons to but I do not want to get into that here). Why is this relevant? Well technically a Electron App is not a standalone app as for instance Apple Pages or Microsoft Word is, an Electron App runs within a Chromium instance and Chromium is what is in the stomach of Google Chrome (from an abstract perspective). Therefore, apps based on Electron is based on chromium and is just as resource eating happy and that is a problem, because they use resources for no good reasons. As a developer I have had to use Visual Studio Code (VSCode), Slack, and Microsoft Teams all at the same time for work and with Signal and Spotify running as well. Common for all of these apps is that they are electron apps and for VSCode alone, the app start with a memory usage of roughly 800MB which increases with usage and multiple document tabs. Then I add addons/extension for the languages and tools I need, plus spell control and I end up with an idle RAM usage between 1.3 and 2GB which is insane! Emacs for a comprasion with all the plugins I have (similar to what I use in VSCode) in idle runs at between 90mb - 180mb depending on the files I have open. That is 1344.44% increase in resource consumption in IDLE for VSCode compared to Emacs for the best case scenario. Spotify is even worse with a best case idle consumption of 1.5GB and I have seen none idle reach up to 8GB. Eight GB of RAM just to play music useless. So that is just two apps, I will now list the apps with their lowest idle memory consumption I have seen:

  • VSCode (with plugins): 1.3GB
  • Spotify: 1.5GB
  • Slack (with three work groups): 617MB
  • Signal: 578MB
  • Microsoft Teams (with one team): 800MB

That is a grand total of 4795 MB (or 4.7GB) of RAM. In a pretty standard home system with 16GB of RAM that is a bit over 1/4 of the system resources or a 1/8 of a pretty normal developer machine with 32GB of RAM. Just running 5 Electron apps in idle mode, now let us say we add Hyper and assume it use something like Signal, that will bring us over 5GB of idle memory use. It is literally stupid, the amount of memory usage Electron Apps use. Even worse what if you are at the same time a Google Chrome / Chromium or other blink based browser user. Well your memory usage is just going up, up and up for no good reason. Other than some developer/company was to lazy, cheap, or both to actually develop apps for each platform, which is not really a good reason. I would like to inject here I really love all the above apps with the exception of Spotify, which can go die in Swedish forest.

BUT RAM IS CHEAP!!!! Yes RAM is cheap, but that is no excuse. Knowingly using something that is this useless in terms of handling its resource consumption should be a dead give away that a producent of the software don’t care about the user, only the bottom line.

As if the memory consumption alone is not a sway to stop using electron for development there is another which Nick from the Linux Experiment focused a lot on and that is UI inconsistency. Electron apps looks like the developer wants it, not like the system wants it. Therefore a electron app can look (and most do) really out of place on a Mac or Gnome based Linux distribution and it is honestly really weird how users just accept this, in particular mac users. By not having a common design language (similar to what Apple enforce on iPhone and Mac through the app store) we are seeing apps that looks really weird and not in a good way. They may look normal on Windows but on other system they look crap and are confusing for the user. It is pretty impressive we let developers get away with it.

So What can developers and companies do to avoid this? Well for starts stop using Electron, it will cost the company more money and it will take longer time but you will get apps that are better for users and hopefully get you better customer satisfaction. But how to stop using electron? Well first of all right what you can in a cross platform language most are these days, I of cause recommend C++ because I am addict, but Rust is also getting there. This will allow you to create shallow apps on top in Swift for iOS and MacOS, GTK for Gnome, QT for KDE, UPF (or whatever it is called on windows), and Kotlin for Android. You will need UX people for it on all platforms but gods be damned you should have already done that with the Electron version. If you have an app that is mostly based on Web Api calls you can build that in whatever language you want and then again just have the shallow apps client side. It is not rocket science to make good native apps.

Learn to cook, just do it

19 June 2022

One of my most cherished passions is cooking, and I can be in the kitchen for hours and hours, not noticing time past. It serves as a sort of meditation for me, and (most often) lovely food comes out in the end. Now I do not expect everyone to love cooking nor to do it every day, but in this post, I would like to explain why it is my honest belief that everyone should learn to cook a little bit. I mean beyond the extent of boiling pasta and frying an egg.

So why should you learn to cook? Well there are quite a few reasons to cook yourself in my opinion, here are some of them

  • You understand seasons better
  • You will get to understand food origins better (what ingredients it is made of)
  • You save money
  • You will learn that you may like things you did not know about
  • Meal prep
  • You might like it

Understanding the seasons better

When you go grocery shopping and go around the fruits and vegetables, you will realise that some of the shop’s inventory or quality changes. For example, it is pretty hard (depending on the region) to get fresh local strawberries in December; the same goes for other berries and fruits. Root vegetables like beets also come and go, particularly the pretty heritage (a.k.a rainbow) once most often is available in my area in mid-to-late autumn and until the end of March. One ingredient that is available all year round in my region is carrots. However, when they first are available, they are vibrant orange (unless you buy heritage versions) and so sweet. To me, it is almost candy. Later in autumn they will turn bigger, lose a bit of their flavour but still be really nice. Then in late January, they will turn sad, get soft, at least one in a 1 kilo pack will be rotten, and in general, they are just sad. You can still cook with them, but I think you should eat them raw at this stage.

Notice how I describe and know, and when the carrots change, it is the same for other ingredients. One I keep a sharp eye on is sellery, as I love them when they are crisp and (in my area) salty and later, they will go soft and sad, turning almost watery. By knowing this, I know what ingredients I should plan to use in my dishes and what alternatives I may need to look for. If you are a salad person who loves spinach, the latter often get sad in late October.

Additionally, this also tells you that if you go into a restaurant and they claim this locally grown <Insert ingredient>, you have some idea if they are bullshitting you or not. I have personally tried, where the waiter told me that I was having an outdoor grown freshly harvested spinach salad in late December, where we had a good solid two weeks of frost.

Understadning food origin better

Where does a bolognese come from? The jar? By making the food yourself, you will start to realise what ingredients go into a dish, and you will start to realise that it is flipping how much stuff is ready to eat. I am, personally, still confused about why some pasta sauces contain palm oil and curry in one very strange case. Additionally, you know what you put in your body, and you have higher control over it, which can (I do not promise anything) lead you to have a more healthy life. Reduced sodium intake is often a side effect of starting to cook yourself.

Additionally, when it comes to meat, I am honestly horrified at the number of people who have no clue where different cuts come from on an animal. First, knowing just a bit of animal anatomy can give hints about how to cook the meat. Tenderloin sees no work should be soft and tender (if it is not, something is wrong). It should be cooked carefully and not for that long. Hardworking muscles will be tough and need longer preparation time. Often these cuts are ideal for stews. See simple guidelines that make it easy to cook and if you have problems, remember to write it down, or like there are plenty of small books on this.

As you cook, you will realise that your knowledge grows and that it becomes easier to cook, almost with every meal. I have been cooking since I was 12, so like 21 years now, and I still feel like I am learning about ingredients every time I cook.

You save money

In most cases cooking yourself will save you money. That is the section. Compare the price of ready meals or eating out to the cost of cooking yourself, and you will see quite the difference. It is stupid how expensive some ready-to-eat meals are.

You will learn that you may like things you did not know about

One of the things I have done over the years while grocery shopping is to look at something unfamiliar and go, uh, that looks interesting and buy a small amount and taste it. That has taught me that things I either thought I did not like or things I did know what was is now some of my favourite ingredients. Sellery is an example of this. The school I went to destroyed the flavour of this for me for over a decade, and now because I know how to treat it, it is one of my favourite vegetables on stews.

Additionally, as I have gotten better at cooking, I have also started looking at more recipes, which has made me explore different food cultures from around the world. Which has allowed me to explore dishes I never knew and find new favourites.

Meal prep

So I do not do this much more because I get lunch at work. But as a student, I used to meal prep a lot on Sundays for a few reasons.

  • Food in the canteen was expensive, and the skills of the chef were expensive
  • The food in the mall close by was expensive as well
  • I had food both for the evening and lunch if needed
  • Less stress

Throughout college and university, I would spend Sundays doing homework, cleaning (yea, right) and preparing food for at least 4 out of the five weeks. I would cook some protein, mainly pork, chicken, or beef, for 2-3 days. I would cook one batch of rice and one of pasta. Then I would make two base dishes. Then for Monday, I would have rice and dish one, no protein, day two pasta dish two and protein and then mingle it around. This ensured I would not get bored with the food, and I could quickly bring it to the university and throw it into the microwave. It was, in short awesome, and I saved money. Additionally, I would cook enough to have enough rice and pasta for dinner as well, and I could throw together a quick salad, fix up a quick soup and mix rice or pasta through either. Also, if I had leftovers of dishes one and two, I would put them in the freezer for a rainy day when I did not have time to cook in the evening. It saved me a lot of money, gave me healthy food, and removed a lot of the stress.

You may like cooking

I know quite a few people who said, “Oh I do not like cooking”, or “It takes too long”. But after starting to cook, they first realised it does not take as much time as they thought and discovered that during cook time of stews and stuff, they could do homework, read, or play a video game. Then after some time, most of them would say, “huh, I actually like cooking now”. To be honest, all but one came back with a similar reaction.

So in conclusion, learn to cook.

./Lars