Writing declarative PHP
– youtu.be - submitted by Andrew Schmelyun
What declarative programming is, and how to include more of it in your PHP code base.
Read more [youtu.be]
Posts tagged with code quality
– youtu.be - submitted by Andrew Schmelyun
What declarative programming is, and how to include more of it in your PHP code base.
Read more [youtu.be]
When working in a big repository, you sometimes lose track of your required Composer packages. There may be so many packages you can't be sure if they are actually used or not. This tool can help to determine if you really are using a package.
Read more [github.com]
Join 9,500+ smart developers
Every month I share what I learn from running Spatie, building Oh Dear, and maintaining 300+ open source packages. Practical takes on Laravel, PHP, and AI that you can actually use.
No spam. Unsubscribe anytime. You can also follow me on X.
– arunas.dev - submitted by Arunas
You'll learn the difference between "tactical" and "strategic" programming, and why choosing the right approach is important in the long run.
Read more [arunas.dev]
Thomas Votruba explains how you can go about this.
Read more [tomasvotruba.com]
– arunas.dev - submitted by Arunas
Before we learn strategies for better software design, we must understand our enemy - complexity. Let’s define complexity, how to spot it, and what causes it.
Read more [arunas.dev]
DRY is just like every other principle out there - it has its place, but it's best taken in moderation.
Read more [gordonc.bearblog.dev]
Personally I don't know if this is a good practice, but you (and future me) might like it.
Read more [www.aaronsaray.com]
– doeken.org - submitted by Doeke Norg
DRY up code by deferring specifics to a callback.
Read more [doeken.org]
Passing booleans to a method can be code smell, as it is not clear what a boolean does by reading the calling code.
This talk by Kevlin Henney looks at how a handful of coding habits, design practices and assumptions can systematically balloon code and compound its accidental complexity.
Have you ever needed to maintain a project that wasn't yours? A project that, when you first opened it, gave you chills down your spine? Even without reading the code in detail, you could already tell it was a mess.
Kevlin Henney makes the case for not suffixing class names, or files with the type of object it contains.
Read more [kevlinhenney.medium.com]
A static analyzer helps you to find bugs in your code without even running it. Popular static analyzers for PHP are Psalm and PHPStan. In this post, we're going to look at what such a static analyzer can find in a two-year-old codebase.
Read more [flareapp.io]
I've been creating web applications for over 15 years now. It's only in the last five years that I've learned how to test an application automatically. I can safely say that there is no other technique that has improved the quality of my code more.
Let's go over what a test is and all the benefits it provides.
Read more [testing-laravel.com]
We talk about cleverness as if it’s Just Bad, such as “clever code is harder to debug”. That’s going too far. Cleverness can lead to faster, safer, even clearer code.
Read more [www.hillelwayne.com]
Sometimes it is not clear what the responsibility of a certain class is. This can be solved by adding a suffix to the class name.
You can make your code more readable by moving all your exception messages to dedicated classes. We using this technique in all our projects and packages.
YouTube star Povilas Korop shares and discusses five rules from our guidelines.
Technical debt is not simply a measure of the specific work needed to repay the debt; it is the additional time and effort added to all past, present, and future work that comes from having the debt in the first place.
Read more [www.oreilly.com]