PHP

12 Nov 2020

Synchronize two collections with different representations

We get used to reading about big things – high-level architectural solutions, design patterns in action, or big data processing. However, most of our problems are small and lie at the low-level in our code. One of them …

04 Nov 2020

Selective serialization using serialization groups

When you ever develop an API in the Symfony framework1, you probably heard of the serializationGroup option. It allows you to define different groups of attributes to serialize and deserialize. However, defining these …

18 Mar 2019

How to use final in PHP?

If someone would ask me about my favorite keyword in PHP, I would certainly answer: final. It doesn’t mean I write this modifier in each class or method. It not only shows the intention but also provides a …

08 Oct 2018

Set up multi-container environment using Docker Compose

I remember this time when I discovered Vagrant. The magic behind this tool and the general idea of scaffolding the whole environment using single command was pretty genius. Moreover, I had programmed on Windows and …

12 Mar 2018

Did your team define own code deprecation strategy?

I didn’t always work in a larger team. At the beginning of my journey as a computer programmer, I was the only one person in a project. It meant that I had had a free-hand (or semi-free-hand) to choose how I could …

18 Dec 2017

Building the associative array – ideas

When we talk about arrays we usually mean the vector of something – primitives, objects or even arrays. But there are a lot of situation when we need to carry extra information with our data. We can use nested arrays but …

20 Nov 2017

Why should you return early?

When I started my journey as a computer programmer, I had written my code in various way. In most cases, I translated requirements into specific conditions and statements, but I hadn’t taken too much care of …

23 Oct 2017

Why you should use array functions instead of basic loops

Loop is the basic construction in each programming language. All repeatable operations are being done using loops. I think you know how the basic loops like while, do and for work and when you should use one of them. But …

14 Aug 2017

Do your constants make sense?

Do you use constants in your code? Probably a lot. Even if you don’t define your own is highly probable that you use some constants defined by other libraries or a language itself. Constants are very powerful unless you …