Take a look at this little method below. Three issues come to mind the first time you see it. Unnecessary calls to array_key_exists, long chaining of if conditions, and a redundant nested code. Let's see ...Read more
Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Latest Questions
We have a console command at Openlittermap that takes all the litter locations in the world and groups them into clusters for viewing on the global map. It's a heavy command in ...Read more
I've hired a lot of developers over the years. More than a few of them have come in with a strong belief that our code needed heavy refactoring. But here's the thing: in almost every ...Read more
In a previous post we documented the Split or condition in if refactoring. This refactoring works fine for most languages. Unfortunately, it may occasionally present some problems in TypeScript because of how ...Read more
We’d like to document a refactoring that we usually teach to teams we work with: the Split or condition in if refactoring. Split or condition in if. Motivation. Sometimes we have nested conditionals that are branching depending on ...Read more
Various guides exist on how to do this in Laravel, but all the ones I found (this and this) worked only up to Laravel 8. The reason is that ...Read more
Introduction Hello, all! I'd like to share a recent experience that highlights the importance of refactoring in the face of performance issues. I was ...Read more