From the blog:

The Null Object Pattern: Simplify Your PHP Code

Jan 11, 2025 #PHP

Handling null values in PHP can be a pain. We've all seen (or written) code that’s riddled with if checks just to deal with null. But what if I told you there’s a cleaner way? Enter the Null Object Pattern, a simple yet effective solution for avoiding unnecessary checks while keeping your code easy to read and maintain.

Let me show you how it works.

Read more

PHP Annotations: Streamlining Your Code with Attributes

Jan 9, 2025 #PHP

Let’s rewind to 2020. PHP 8.0 lands, and developers get their hands on something they’d been craving for years: attributes. Think of them as PHP’s version of annotations—a way to embed metadata directly into your code. No more juggling bulky docblocks or fragile YAML files. Now you can keep things simple and readable.

Read more

When to Use Traits in PHP

Jun 4, 2024 #PHP #Traits

Traits are a powerful feature in PHP, introduced in PHP 5.4, that allows developers to reuse code across different classes independently of class hierarchies. They serve as a mechanism for horizontal code reuse, helping to avoid issues related to multiple inheritance and allowing for a more modular and maintainable codebase. This blog article will explore the ideal scenarios for using traits, provide examples, and offer best practices, including how to organize traits within a project.

Read more

How to add a .gitignore file to your Git repository

May 24, 2024 #Git

Have you ever accidentally committed sensitive information like passwords, configs, or large files to your Git repository? If the answer is yes, then you need to learn how to handle the .gitignore file. In this article, I'll walk you through how to create a .gitignore file in a Git repository and optimize it for different tech stacks.

Read more
Copyright 2025. All rights reserved
  • Codepen Logo
  • Youtube Logo
  • GitHub Logo
  • Twitter Logo
  • LinkedIn Logo