RSSAmplifier

Blog

Daniel's programming rants

Recent content on Daniel's programming rants

gerlacdt.github.ioRSS feed ↗30 posts

Latest posts

Routines for a healthy and happy life (as a software engineer)

Introduction I have always been passionate about productivity. As a dedicated software engineer, the pursuit of continuous learning and the creation of high-quality, maintainable code are paramount. However, focusing solely on honing technical skills while neglecting other facets of life can lead to an imbalance, a state best described by Kelsey Hightower’s insightful observation: If you…

My Presentations

Links to my presentation slides clojure introduction javascript introduction java8 new features hashicorp nomad tutorial learning how to learn shell introduction

Logging, the sensible defaults

Logging is a major pillar for well-designed applications. It is not only a large help during development but also critical for failure analysis and debugging. The most effective debugging tool is still careful thought, coupled with judiciously placed print statements. - Brian W. Kernighan Further logging is essential for observability in production. Nonetheless, I often encounter codebases with…

Clean Code: The Good, the Bad and the Ugly

Clean Code by Robert C. Martin is a seminal programming book. A whole generation of developers, including myself, became better programmers by Uncle Bob’s advice. But after almost twenty years, does the book still hold up to its high standards? Was some advice given by Clean Code questionable or even wrong? Are there better alternatives nowadays? To be fair, the author himself claims in the…

The Continuous Clean Code Process (CCCP)

Most software projects end up in a big ball of mud. The major cause is neglecting internal quality and focusing on adding features with dirty hacks because of unrealistic timelines. Code has the natural tendency to erode if you don’t launch countermeasures permanently. This observation applies to all systems and is also known as the the second law of thermodynamics: Systems tend to arrive at…

Production Readiness Checklist

Modern applications run typically in the cloud. As good residents, distributed applications must fulfill many requirements in order to enable reliable operations and maintenance. This article summarizes the most important points in order to go live and to keep applications healthy over their lifetime. Twelve-factor app All modern cloud applications should comply with the 12-factor app principles:…

DDD and SOLID: A refactoring story

TL;DR Command-Query Separation Extract Use Cases (Clean/Hexagonal Architecture) Domain Events (with Eventhandlers and Composite Pattern) Cross-Cutting Concerns (with Decorator Pattern) Many backend applications end up as a big ball of mud where small changes ripple through the whole codebase. The root causes are high coupling and low cohesion. The best remedies against those are Domain Driven…

Top 10 Practices Of Effective Software Engineers

TL;DR Write code Read Code (Written) Communication Learn concepts – not technologies Learn Lisp Master your tools Control complexity (Simplicity) Read books (but don’t forget to practice) Understand the problem domain Learn to write good tests (or how to design well and write decoupled code) Introduction I am always pondering what practices, tactics, behaviours and approaches make up…

Effective CLI (more productive than an IDE!)

TL;DR Modern Terminal with nice (Nerd) Fonts ZSH oh-my-zsh Modern Prompt with starship Modern CLI tools (fzf, ripgrep, bat, tmux, jq) Fast editor (Emacs, Neovim, Helix) Organize your dotfiles with GNU Stow The Unix shell/Command-Line Interface (CLI) is an ancient tool. Despite being around forever, the shell is highly customizable and with a good configuration, it is on par with modern graphical…

Best Books For The Inquisitive Software Engineer

This article contains a list of my favorite books with a major impact on my Software Engineering career. The books are categorized in: Software Engineering Programming Brian Kernighan’s Books Modern Classics Learning Management and Leadership Unix Books From Stevens Software Engineering A Philosophy of Software Design by John Ousterhout Link to book A fabulous book to level up your software design…

Software Engineering and Feedback Loops

Introduction Most of the breakthrough inventions in historic and modern Software Engineering are related to feedback loops. They are essential for productive software development, Developer Effectiveness and Developer Happiness. Remember the dawn of computing when computers were programmed with punch cards, programmers had to turn in their cards over night and the next day they got the result…

The Non-Productive Programmer (NPP)

We all know them: programmers with long term experience stuck on a low-level of our craft not corresponding to their quantity of experience. Great programmers are creative workers and problem-solvers and one of their most important traits is: never stop learning – but getting stuck in its own comfort zone and becoming reluctant to change is deeply wired into human nature (Humans are…

Reading List for the mindful Software Engineer

Abstractions are essential in order to build complex systems and keep complexity under control. Especially in software development we rely on many abstractions to make our life easier. Although good abstractions do not “leak”, it’s always helpful to understand the background and the details behind them. The following list (in chronological order) of classic computer science…

Database Integration Tests with Docker Sidecar in Jenkins

More often than not, developers want to test the source code against a real database instead of Fakes or Test Doubles during a CI job in order to verify the code works as expected. Therefore a clean database is needed for every CI-job. One solution is to use a shared instance of the database in your existing test-environment which get cleaned before and after a job. But this suffers from being…

Emacs as RSS reader

Do you have a list of websites you visit regularly? Just to find out nothing new was added. This manual scraping is often a waste of time. Worse yet, scanning and filtering these websites for new interesting content is even more time consuming. Subscribing to an RSS feed can reduce your effort immensely. An RSS feed “pushes” the newest updates to subscribers and they will never miss…

Product Management Quotes

I collected my favorite quotes about product management: We need teams of missionaries, not teams of mercenaries. Marty Cagan, Inspired It doesn’t matter how good your engineering team is if they are not given something worthwhile to build. Marty Cagan, Inspired The use of OKRs in most companies is a mess - because it’s a framework that originated in an empowered team environment - and most…

Writing better Code

In Joel Spolsky’s blog post “The Joel Test: 12 Steps to better Code”, he describes a test composed of twelve simple yes-no questions. For a yes you get one point. 10 points are acceptable and 12 are perfect. If you have less than 10 points, you will get in trouble with your software – sooner or later. For a quick self-check, these are the original questions: Do you use…

Google Testing Toilet Collection

In my one of my previous posts i wrote about Good Unit Tests. During my research i discovered the famous Google Testing on the Toilet posts which provide great advice. The Testing-on-the-Toilet articles are short (~3min reads) and give hands-on examples, ready to be applied immediately. Here are my favorites: Testing on the Toilet Tests Too DRY? Make Them DAMP! Exercise Service Call Contracts in…

Programming Quotes

Over the years i collected some (funny) programming quotes. Lean back and enjoy: Everyone knows that debugging is twice as hard as writing a program in the first place. So if you’re as clever as you can be when you write it, how will you ever debug it? Brian W. Kernighan Don’t comment bad code—rewrite it. Brian W. Kernighan The most effective debugging tool is still careful thought, coupled…

Why and How to write better Unit Tests

TL;DR Good unit tests build the foundation of a maintainable and high-quality codebase Unit Tests should help developers to be productive Unit Tests should be fast Unit Tests should be isolated Unit Tests should be deterministic Unit Tests should focus on a single unit Unit Tests should be enduring Unit Tests should be clear, concise and complete Avoid complex control flow logic like nested ifs or…

ESlint + Prettier + Typescript = Consistency

Consistency is one of the most important factors in a codebase. It gives new developers an orientation and direction how to write new code. It keeps the code understandable, clear and free from bikeshedding, so developers can focus on real problems instead of indulging in discussions on their preferred codestyle and individual taste. Consistency can be pertained by strict discipline but if…

Install Postgres on Ubuntu

Recently i decided to switch from MacOS to Linux. I was already an Ubuntu user from 2006 till 2015. So i am used to Linux. Nevertheless i struggled a little bit with the installation of PostgreSQL. For MacOS there is a nice all-in-one package which i recommend: Postgres.app. Everything works out-of-the-box there. In Ubuntu, on the other hand, we need to adjust the default installation a little bit…

Emacs Delete Lines

Sometimes when i write small scripts i tend to insert print statements for debugging. After i verified the correctness of my program i want to get rid of all unnecessary debug statements. With Emacs you can delete all lines which match a specific regular expression with M-x flush-lines or with its alias M-x delete-matching-lines. Interactively you can enter your regular expression and all matching…

Install Emacs on MacOS

Yesterday Emacs 26.2 was released, see: https://www.gnu.org/software/emacs/news/NEWS.26.2 In this short guide i want to show how i install Emacs on my MacBook. I use the vanilla Emacs build from https://emacsformacosx.com/. It is just a simple .dmg file. After installing the dmg file, Emacs is now available on your Mac as an application but not in the terminal-app. The terminal still opens the…

Find and Replace in multiple files

As a software programmer you often have to search and replace a specific string in multiple files because of a refactoring or just improving a variable or function name. Normally you can use your IDE or your editor for this. But in bigger codebases with thousand or million lines of code it can be very slow. Neither do IDEs work with remote SSH-sessions. In such situations the command-line is…

ag the_silver_searcher, a grep replacement

As a programmer you often search for a specific strings or regexps in multiple files. Previously i used to do this with the well-known GNU-tools find and grep. The following command searches for main in all *.go files in the current directory and: 1 2 find . -iname '*.go' | xargs grep -inH 'main' # -i ignore case, -n print line number, -H print filename Recently i discovered ag the silver…

Emacs Test Regexps

Replacing or searching text with regular expressions is very common. But sometimes it is hard to get them right and you need some playground to try them out. In order to verify regular expressions i used to visit webpages like: https://regexr.com/ https://regex101.com/ But these webpages are optimised for perl, javascript or bash expressions and do not support Emacs regular expressions directly.…

Things to consider with microservices

Introduction Some years ago i was involved in migrating a big IBM Websphere monolith into a microservice landscape. We had a lot of problems with the monolith. Our development speed slowed down. We had many merge conflicts because of too many dependencies in the codebase. We outgrew the monolithic design and decided to introduce microservices. We extracted different domains like payment, booking,…

My Nickname Is Danger

A few years ago one of my colleagues “discovered” an algorithm which led to my nickname: take the 3 first characters of my first name and surname concatenate them: DANiel + GERlach => Danger The algorithm can be implemented as a pure function in Javascript: 1 2 3 4 5 6 7 8 9 function getNickname(fullname) { return fullname .split(/\s+/) .map(n => n.substring(0,3)) .

About me

My name is Daniel Gerlach. I work at Mercedes-Benz-Mobility AG. I am a software engineer with a professional background in: Java Javascript Typescript I am a strong supporter of functional programming paradigms like immutability, reference transparency, pure functions, high-order functions, functions as first-class citizens and composition of functions. I think functional programming makes coding…