Hey, I’m Florian Krämer
I’ve been a web developer for 22 years. I like software architecture and programming!
Check the about page to learn more about me or enjoy one of my articles.
Articles
-
Naming Matters: An Example
Developers spend a lot of time reading and understanding code, actually much more than writing code. Readability and understandability of code are very valuable quality attributes, because it impacts development speed and therefore development cost. Understandability can be improved a lot by just naming things properly.
-
The Optional Object (borrowed From Java): A Guide to Handling Null Values Gracefully
In software development, dealing with null values is a common source of bugs and errors. The Optional object, popularized by Java 8, offers a way to handle null values gracefully, reducing the risk of NullPointerException. While we do not have the risk of a NullPointerException in PHP, the optional still provides benefits. This guide adapts the concept for PHP, demonstrating how to use an Optional class to improve code safety and readability.
-
Working Remote for 20 Years
This is my experience after working 20 years remotely and the need to find a new remote job.
-
The Limits of Human Cognitive Capacities in Programming and Their Impact on Code Readability
Programming is both a technical and cognitive task. While technical skills and knowledge are essential, cognitive abilities play a critical role in how effectively a developer can write, read, and understand code. Understanding the limits of human cognitive capacities can help software architects and developers design code that is more readable, maintainable, and less error-prone.
-
Event Sourcing Library Release
I’ve been working on an event sourcing library for some time now and I think it is time to release it.
-
Problem Details for HTTP APIs: RFC 9475
If you designed APIs before, you probably have had the problem as well, to define how an error response should look like. Usually some HTTP Status codes are defined for certain outcomes and when it comes to the response body you have to get creative.
-
Write high-quality tests with Mutation Testing
At its core, mutation testing endeavors to assess the efficacy of a test suite by simulating alterations in the codebase. These alterations, termed mutations, typically involve small, deliberate modifications to the source code, such as changing operators, swapping variable assignments, or altering conditional statements. The overarching goal is to evaluate whether the existing tests possess the acumen to detect and respond to these mutations effectively.
-
The DDD Trap
This article tries to address an observation I’ve made, that there are many articles, at least in the PHP world, that claim to be DDD, but that most of those articles actually miss 85% or more of what DDD really is: the modeling process. The code part that most articles talk about is the implementation of a long process that happened before, and it is never mentioned in those articles.
-
Simple but useful: Use Case Tables
During my work I faced the problem, that in communication with product managers, there was often no unified format in which information was communicated.
-
About Validation and Anti Corruption Layers
There is a surprisingly large number of people, at least in the PHP world, who haven’t seemingly heard of or thought about when and where to put constraints on their program. Often there are DB entities that are sharing the validation with the input validation and have no clear boundary.
-
Why is Open Source more agile in fixing bugs?
When Oracle, Microsoft or Apple needs weeks to fix things or has a fixed schedule for patch releases, a lot people like to make fun about those companies. Some are even going that far to call those companies incompetent. I do not think that this is reasonable and justified.
-
Why don't you just replace that old thing?
Sometimes people are very eager and quick to say “Just replace X!” but don’t consider the deeper implications of changing an integral part of a companies system. This article was inspired by a statement mate recently by someone stating this:
-
Result Objects vs simple Return Types
Result objects and simple return types serve different purposes, and their advantages depend on the specific use case and design goals. As usual in software architecture there will be trade offs.
-
AI Guided Code Refactoring
With the rise of AI tools, especially ChatGTP it has become an interesting topic how and if AI can be used to write or refactor code. Here is a little experiment on how well ChatGPT can refactor code to make it easier to understand and therefore to maintain and reduce the cost.
-
ChatGPT Initialization Promt for Developers
ChatGPT has some annoying habits like telling you that it is an AI and sometimes uses fancy expressions. This can be funny sometimes but for getting technical tasks, it is not desired. You can control ChatGPTs behavior a little by properly initializing it with some rules of what it should do and what not.
-
Exceptions - good or bad?
Exception-driven development, also known as “throw first, ask questions later”, is considered a bad practice. This article will provide a list of reasons when exceptions are bad and why you should not use them without a good reason.
-
CakePHP3: A new PSR7 Middleware Authentication
Let’s start with some background story on this topic. One of the parts of the CakePHP framework I like the less is the authentication and authorization. There are a few reasons why. For example, the authentication and authorization. Firstly, both authentication and authorization have been married through the AuthComponent, secondly, the component is an ugly monolith that is coupled to the controller layer of the MVC pattern.
-
Complex Rules in CakePHP3
I had a pretty interesting task recently. We have profiles that must implement certain constraints depending on what kind of profile / product the client purchased. So a profile can have a specific number of languages depending on the constraints. This means we need to validate the number of languages an user has picked by a value from another database table that needs to be picked up somehow at runtime.
-
CakePHP and Angular Pagination
It is actually pretty easy to make your RESTful calls in CakePHP paginateable by using what the Paginator Component already offers us and using Angular UI Bootstrap Paginator on the client-side code. On our server side, we just use the built-in serialization of CakePHP to generate the response. This is an example of a CakePHP controller
index()
method that is paginateable: -
CakePHP3 i18n Language inside the URL
In CakePHP 2.x it was pretty cumbersome to get the language across all pages into the URL. With CakePHP 3 it is just awesome and easy. You can now create persistent URL parameters.
-
Social graph connections
On Stackoverflow the user Marin was asking this question, which sparked my interest as well.
-
Callbacks In Cakephp Forms Using Events
If you ever have the need to inject fields or other things into a form, for example when building a blog or CMS system, you can use the event system that comes with CakePHP. The basic concept can be used everywhere within the views and is not limited to forms only, but a form is a good example.