Coding with Johan
Passion for Code
programming

Latest Posts:

How to save computation time with functools.cached_property?

User profile imageJohan VergeerJul 5, 20204 min read
The `cached_property` decorator can save a lot of computation time in return of some RAM memory. Can this decorator be used anywhere, or should it be used sparingly? Let's find out!

Python Dependency Injection Frameworks

User profile imageJohan VergeerJan 26, 20204 min read
Even though the usage of Dependency Injection is not as common in the Python community as it is in the C# or Java communities, it is still a very powerful way to implement the [Dependency Inversion Principle](/blog/solid-python-dependency-inversion-principle). Thankfully there are several packages available to us that provide us with a dependency injection implementation, which I will discuss in this article.

Multiple Inheritance and the Diamond Problem

User profile imageJohan VergeerJan 17, 20205 min read
In this post, I will show you what multiple inheritance is, how you can use it and what to watch out for. First you will learn about single and multiple inheritance and how you can use them in Python. After this you will learn some multiple inheritance gotchas among which the dreaded diamond problem.

SOLID Python part 6: Dependency Inversion Principle

User profile imageJohan VergeerJan 24, 20204 min read
This is the fifth and last article on the SOLID Principles with Python. In this article we will look into the **D** of **SOLID** which stands for Dependency Inversion Principle.

SOLID Python part 5: Interface Segregation Principle

User profile imageJohan VergeerJan 18, 20205 min read

SOLID Python part 1: Introduction

User profile imageJohan VergeerJan 14, 20204 min read
SOLID is an acronym for the first five principles of Object-Oriented Design created by Robert C. Martin. These principles help us to develop software that can be maintained and extended throughout its lifetime. The SOLID principles do this by avoiding code smells, refactoring code and applying Agile Software Development.

SOLID Python part 4: Liskov Substitution Principle

User profile imageJohan VergeerJan 17, 20203 min read

SOLID Python part 3: Open Closed Principle

User profile imageJohan VergeerJan 16, 20202 min read

SOLID Python part 2: Single Responsibility Principle

User profile imageJohan VergeerJan 15, 20202 min read

Should trivial code be tested?

User profile imageJohan VergeerJan 1, 202111 min read
I recently got the following question: "Should I test trivial code?". Since I knew this is a highly opinionated topic, I knew I had to do some research in order to come up with a proper answer. So here are my two cents on the topic that seems to be coming back all the time.