Why DRY is the most over-rated programming principle
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]
Posts tagged with best practices
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]
Some good tips for writing effictive, human-friendly documentation.
Read more [thenewstack.io]
Join thousands of developers
Every two weeks, I share practical tips, tutorials, and behind-the-scenes insights from maintaining 300+ open source packages.
No spam. Unsubscribe anytime. You can also follow me on X.
Did you know that DateImmutable isn't really immutable?
Read more [matthiasnoback.nl]
A nice list of things to keep in mind when writing software or documentation.
Read more [leerob.io]
Personally I don't know if this is a good practice, but you (and future me) might like it.
Read more [www.aaronsaray.com]
There are a couple of nice ideas there to solve longstanding problems with UUIDs
Read more [www.ietf.org]
I'm proud to announce that our new premium course on writing readable PHP is now available. It's called Writing Readable PHP.
This course contains a collection of bite-size tips (both in written form and videos) that make your code a joy to read for your co-workers and future self. These tips are aimed towards developers who know the basics of PHP and want to improve their craft. As a bonus, you'll learn to use static analysis to ensure that your code is understandable and correct.
Writing Readable PHP has been created by our team and Christoph Rumpel. It contains our combined knowledge on how to write the best PHP possible.
– 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.
Andraes Möller blogged a few interesting strategies to name the constructors of your PHP objects.
Read more [localheinz.com]
– tray2.se - submitted by Patrik Ahlström
You might think that the way your store your data isn't really that important. Well it's more important than you think it is. A good database design just like good clean code is the key to performance, not only for the end user but also for you the developer. A poor database model just like poorly written code will slow you down and furthermore it will slow your database queries down which results in a slow application.
Read more [tray2.se]
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.
Using else often encourages complexer code structure, makes code less readable. In most cases you can refactor it using early returns.
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.
– devonmather.dev - submitted by Devon Mather
Let's explore the option of firing events on model scopes to add some glue between our feature tests and our unit tests.
Read more [devonmather.dev]
Here's why you should be carefull with array_merge in loops.
Read more [www.exakat.io]
Kevlin Henney makes the case for not suffixing class names, or files with the type of object it contains.
Read more [kevlinhenney.medium.com]
Validation takes on many shapes and forms. In this post, Frank walks you through all the possibilities.
Read more [blog.frankdejonge.nl]
Ever found yourself wanting to make a small tweak to a PHP file in a Composer dependency? Here's how to do it without forking the entire package.
Read more [downing.tech]
At Raycast, the dev team only requests code reviews when they think it's necessary.
Read more [www.raycast.com]