Using Design Patterns in PHP Without Overdoing It
Design patterns are a tool, not a goal: when to use which pattern in PHP, where they pay off, and the signs that they are creating unnecessary complexity.
Category
Features, syntax and practices of the PHP, JavaScript, TypeScript, Go and Python languages, with release notes and worked examples. (Page 2/5)
This category has 50 posts.
Design patterns are a tool, not a goal: when to use which pattern in PHP, where they pay off, and the signs that they are creating unnecessary complexity.
A practical look at PHP traits: why they exist and how to share behavior across unrelated classes without the pitfalls of multiple inheritance.
A look at readonly classes, DNF types, and standalone type declarations in PHP 8.2, and their impact on domain modeling.
Why naming is not merely a style choice, but a design decision in its own right — patterns I have observed over the years.
How to carry your type contract from the backend API to the frontend interface without breaking it — and the practical approaches to get there.
How to move manual workflows into reliable Python scripts: which tasks are worth scripting, file operations, external APIs and when Python beats PHP or Go.
Embedding meaning into code instead of relying on primitives: why and how to design value objects in PHP, from an Email example to readonly immutability.
Go 1.18's generic support shows how a language can be reshaped thoughtfully: why Go waited, the type parameter syntax, first impressions and trade-offs.
PHP 8.1 isn't out yet, but I'm already exploring how the upcoming native enum support and readonly properties will reshape domain modelling.
A practical look at PHP type conversion and coercion: gettype, settype, var_dump, and why strict_types belongs in every file.
Building reusable, type-safe abstractions with TypeScript generics: how type inference and extends constraints work, and when a union fits better.
A practical approach to error handling as a Go language idiom: the error value, wrapping, custom error types and a PHP developer's adjustment period.