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 prefer physical notebooks over software-based

18 October 2022

Most Software Professionals and Engineers take and keep notes in some form, which is an essential tool. This post will cover why I prefer physical notebooks over their software-based counterpart. Before I go into detail, I will say that I also keep notes on computers, and I am an avid Org Mode user. However, I find physical notebooks more suitable to my needs for a couple of reasons, which, as stated, I will cover here.

First portability! And your first question is probably what the heck is he talking hasn’t he heard about laptops, phones, and tablets? Well, of course, I have, but let me tell you a little secret, I have attended meetings where all electronic devices were disallowed in the room, even in buildings. Therefore, pen and paper was the only option for notes. In extension, I also find that I lose focus on the meeting or presentation given if I sit with a laptop, which I do not do when I only have a notebook. So many times, I will not bring a laptop to a meeting, and I will not pull out my phone.

Then there is the doodling. I have for decades used associative memory techniques without knowing it. During a meeting, lecture, or whatever, if I doodle at the same time next to my notes, I can recall almost all information from a meeting (I have scared people this way, it is fun) if I combine my notes and the doodles I make. Doing this allows me to scan my notes and get a map of what happened during the meeting. I can not do something similar in most note-taking tools on computers or tablets. The only app I found that comes close is GoodNotes for Apple’s iPad. Unfortunately, I do not have an iPad or an Apple Pencil, and for Android, I have not found an app that gets close to GoodNotes.

But my drawings are not just limited to doodles. I regularly draw up system diagrams and architectures as I research topics, new features, new products, etc. Thereby as I draw, I can visualise what my plan is, and I can have multiple designs easily side by side. It is super convenient. I also draw things like sequence diagrams or flow charts, which are very handy. Also, when I outline books or plan plots for stories. I draw maps where I plot the course of people or do other weirdness. It is convenient, and again for a software version, GoodNotes is the only close thing (I am guessing I should state by now that this post is not sponsored by GoodNotes, but it is fantastic).

Then there is flexibility in the workflow. For example, I keep multiple notebooks for different topics. Which can be quickly done in software and in physical form. But for some reason, context switching is easier for me when I swap physical items over changing a file or tab in the software. So to me, it is a more flexible workflow, and I know I am not the only one that has it that way.

Writing by hand enhances my recollection of the subject. I have for years and years aspired to have my notes electronically instead of on paper. But every time I have tried, I have realised that with notes I write by hand (using a pencil/pen), I can recall things better and easier. So another clear advantage for handwritten notes: GoodNotes is giving me some of the same benefits.

Finally, and a little bit funny, (joke) ENCRYPTION! I have the benefit of having handwriting which not even doctors can read.
This means people cannot just read me over the shoulders or upside down, that is pretty cool and something I like. Yes, I can read my own handwriting.

So this is basically why I prefer physical notebooks over software-based ones.

./Lars

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.