What is the biggest problem in PHP in 2021? Many PHP developers are stuck with old codebases, with old frameworks or patterns (if any). Sometimes we work with projects without Composer or PSR-4 autoloading. For some of us, using PHP 7.0 is a luxury far beyond our dreams.
Command and Query Responsibility Segregation (CQRS) is a technique that has become popular in the last few years as a means to scale reads and protect the encapsulation of domain objects optimally. However, it is usually presented in combination with other topics (Event Sourcing, DDD, Microservices), which gives many developers a hard time understanding what is part of CQRS and what is not. Here, we will try to explain the idea of CQRS and how we can take advantage of it, under what circumstances, and the price we have to pay for it.
I have been programming for nearly twenty years at this point, and I have worked in various languages. At many of my previous jobs, as well as my current one, I have had the pleasure of working with PHP as the core language of my job. Since the first time I started working with PHP, I heard all the complaints about the language, but I also saw the power that PHP has.
Laravel Livewire describes itself as a “..full-stack framework for Laravel that makes building dynamic interfaces simple, without leaving the comfort of Laravel.” As a developer who has always struggled to feel comfortable with the latest and greatest front-end tooling, “without leaving Laravel” is incredibly appealing.
As our codebases become ever more complex, the cost of change rises as well. Any change or enhancement carries a risk of breaking something else. The problem is even more acute for people new to the project who’ve not yet learned the pitfalls waiting in that particular codebase. This month we’ll be examining the problem and considering a solution. Next month we’ll see a solution as a straightforward pattern.
In this installment, we continue looking at Conway’s Game of Life and our exploration of cellular automata. Now that we can calculate how one cell in our grid changes from one generation to the next, we can extend that to see how an arbitrarily sized grid changes from one cell to the next.
Security is often difficult to get right, even for those who are experts in the field. Mistakes are easy to make and result in our users falling into a pit. All developers should practice a stance of “security by default.” Doing so means ensuring that any mistakes land users in a pit of success rather than despair.
When Sebastian Bergmann was in university, his professor pulled him to the side and said, “Open Source is great, PHP is great, but I see that you’re interested in these testing concepts, unit testing in particular. That does not exist for PHP. Can I finally convince you now to continue what you do, but with a different language? Do that with Java, and do it at the university and do cool stuff with that?”. Most students would take that sort of advice from their professor as solid words of wisdom and do exactly what had been suggested. Fortunately for all of us, Sebastian wasn’t like most students, and he took it as a challenge and replied, “Well, just because it has not been implemented for PHP yet does not mean that it cannot be done.”
Here we are, the season for students to say goodbye to break and head back to school. For those of you without children, this is why the office supplies areas of most stores have been looking like post-apocalyptic movie sets with a few broken packages on ransacked shelves and a few hollow-eyed clerks left staring vacantly at the mess. I hope none of you needed crayons. They are going for big bucks on the black market right now.
Leave a comment
Use the form below to leave a comment: