Code quality

97 posts
Grandfathering in legacy

Grandfathering in legacy

So many problems in legacy or brownfield applications stem from invalid state being dragged around throughout the whole application and causing a bug somewhere far away from its origin or just dying a silent death. I’d like to introduce you to a method to handle invalid state in new...

Never talk to strangers

Never talk to strangers

Talking to strangers in 1930s Moscow was not a smart thing to do. Mikhail Alexandrovich Berlioz (chairman of the management committee of one of the biggest Moscow literary clubs – MASSOLIT) and his young companion, poet Ivan Nikolayich Poniryov (who wrote under the pseudonym of Bezdomny) knew that all too well....

Releasing with confidence

Releasing with confidence

Still scared to ship to production on Friday afternoon? Even after reading our previous post on maturing your release process? Here’s some practical advice on evolving your releases — from a fearful event to a trivial byproduct of building software. Building a release and go-to-market strategy is only possible when...

Typed property must not be accessed before initialization

Typed property must not be accessed before initialization

PHP7.4 introduced this cool new feature called “typed properties” which add the existing PHP type system to class properties. This means that you can now enforce which types a property has without having to encapsulate it in an object. An example class containing typed properties looks like this: class...

Getter, Setter, Never?

Getter, Setter, Never?

What if I told you Morpheus never said “What if I told you?” I know you saw that meme a thousand times but have you actually heard him say it in the movie? You didn’t, because it didn’t happen. Darth Vader also never said “Luke, I am your...

How to integrate Elasticsearch in your Laravel App - 2024

How to integrate Elasticsearch in your Laravel App - 2024

Integrating Elasticsearch with Laravel enhances search capabilities beyond simple LIKE matches. This guide covers Elasticsearch basics, setting up a local environment with Docker, creating a demo application, and implementing Elasticsearch integration using observers and repositories.

Catching bugs early with static analysis

Catching bugs early with static analysis

PHP is a dynamic language and while this certainly has its benefits, it also means that it’s not uncommon to see errors about calling an undefined method, or an invalid argument count in the logs. What’s even worse is that the application will simply crash when these types...

Liskov Substitution Principle Explained

Liskov Substitution Principle Explained

The Liskov Substitution Principle is one of the five design principles that make for SOLID code, and probably one of the hardest to fully grasp. Before we dive into how we can apply it to our code, let’s take a look at the definition: In a computer program, if...

Does code need to be perfect?

Does code need to be perfect?

In the past months, I have asked myself a lot why we always strive to write perfect code. Picking up coding again for an internal project made me realise our team (and probably a large part of the rest of the software development world) spend a lot of time on...

You’ve successfully subscribed to madewithlove
Welcome back! You’ve successfully signed in.
Great! You’ve successfully signed up.
Success! Your email is updated.
Your link has expired
Success! Check your email for magic link to sign-in.