TODOs aren’t for doing
Some teams require that every TODO comment in a codebase gets logged in the bug tracker. Others automatically delete any “stale” TODO that has been in the codebase for over a year. Don’t do it!
Read more [sophiebits.com]
Posts tagged with code quality
Some teams require that every TODO comment in a codebase gets logged in the bug tracker. Others automatically delete any “stale” TODO that has been in the codebase for over a year. Don’t do it!
Read more [sophiebits.com]
The #[\NoDiscard] is a safety feature for PHP developers, making it easier to catch mistakes where ignoring a function’s return value could lead to bugs.
Read more [www.amitmerchant.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.
Some very cool numbers on the PHP ecosystem, gathered by Jean-François Lépin.
Read more [blog.lepine.pro]
Pseudo-types like callable and iterable may seem convenient at first glance, but they introduce ambiguities and make code harder to analyze.
Read more [f2r.github.io]
Tomas shares his approach to get the most out of mocks, drop dead code, and make tests more valuable.
Read more [tomasvotruba.com]
– jump24.co.uk - submitted by jamie peters
We all strive to write good code when we jump onto a project but sometimes do you wonder why?
The post covers
The techniques here are useful for all level of developers and worth a quick skim over as we all nothing wrong with a quick refresher
Read more [jump24.co.uk]
– ashallendesign.co.uk - submitted by Ash Allen
Read about how to use Pest to add architecture tests for your PHP application and enforce standards such as folder structures, naming conventions, and more.
Read more [ashallendesign.co.uk]
– acairns.co.uk - submitted by Andrew Cairns
Explains what the Code Smell 'Primitive Obsession' is, the damage it can cause to your codebase, how to spot it and - how to fix it!
Read more [acairns.co.uk]
– tighten.com - submitted by Jamison Valenta
Let's talk about Husky, a tool that automatically runs any number of commands whenever you commit or push. You'll never have to worry about forgetting to format, lint, or test before uploading code to the repo — Husky does it for you every time you run git commit or git push
Read more [tighten.com]
– davorminchorov.com - submitted by Davor Minchorov
Everyone talks about over-engineering but people rarely talk about under-engineering. Learn about the differences and how they depend on the context you are in.
Read more [davorminchorov.com]
– jeffochoa.me - submitted by Jeff
Although PHP Enumerations are meant to provide an easy and elegant solution to work with a predefined set of values, these classes are often misused, resulting in a lack of consistency due to the introduction of all sorts of methods that increase their complexity. In this article, we are going to go through some practices (both good and bad) with the goal of clarifying the understanding of these types of objects to help you build a more resilient and consistent codebase.
Read more [jeffochoa.me]
It's always nice to read good post on code reability.
Read more [loup-vaillant.fr]
– www.conroyp.com - submitted by Paul Conroy
Value objects are a great way to add safety and consistency to PHP applications, while improving readability & testability. Let's dive into what they are, what they're not (DTOs!), and how they can help us improve our code quality.
Read more [www.conroyp.com]
– htmx.org
Locality is that characteristic of source code that enables a programmer to understand that source by looking at only a small portion of it.
Read more [htmx.org]
Mohamed write a nice post featuring a lot of good tips on how to make your code readable.
Read more [themsaid.com]
Focus on writing code that solves real problems, is well-tested, and is easy to maintain.
Read more [localheinz.com]
A nice refactor from Aaron Francis
I'm always on the lookout for a good "make more things the same" refactor and I just found one!
— Aaron Francis (@aarondfrancis) March 8, 2023
Make your life easy, make more things the same. pic.twitter.com/tQfnqSZ84u
– tighten.com - submitted by Jamison Valenta
Don’t waste your team’s time fixing little code style issues... and DEFINITELY don’t ship code w/inconsistent code style! Check out our new package Duster, a powerful all-in-one code linter & fixer bundling all the best code styles for your Laravel apps!
Read more [tighten.com]
– www.eloquentarchitecture.com - submitted by John Freeman
The LoB principle dictates that the behavior of a unit of code should be as obvious as possible by looking only at that unit of code. But I think something is missing from this discussion.
Read more [www.eloquentarchitecture.com]
What I've come to realize, though, is that anyone can write code that seems complicated. The hard thing is solving complex problems with simple code.
Read more [www.joshwcomeau.com]