Var, Let, Const: Stop Complicating Your Life in JavaScript

Most tutorials and linters force you to shove const everywhere you look. But a constant that's only a constant by accident isn't a constant – it's cognitive overhead. I explain why “prefer-const” is an anti-pattern and why a simple let is all you need.

Renaming ENUM Values Without Data Loss: A Safe Guide

Directly renaming values in a MySQL ENUM is a recipe for disaster – data will vanish faster than you can say “backup.” The proper approach has three steps: extend the ENUM with new values, update the data, and only then remove the old ones. No magic, just common sense.

Property Hooks in PHP 8.4: Game Changer or Hidden Trap?

PHP 8.4 finally kills getters and setters – except property hooks bring their own gotchas with arrays, references, and the fact that you can't tell from the signature whether a property is even writable. I break down where they shine and where the traps lurk that the documentation won't serve up for you.

The Hidden Surprises of PHP Readonly Properties

Readonly properties are like a lock on a door – they lock the reference, but what's happening inside the object is beyond their watch. I dig into the pitfalls of initialization, constructor myths, tricks with references in arrays, and PHP 8.4 features that finally loosen the most annoying restrictions.

Two Words That Kill Open Source

“I don't have time,” someone writes in an issue, essentially saying: your free time has no value, drop everything and solve MY problem. 99% of such issues remain forever unresolved – digital monuments to human laziness. So how to do it differently?

Why GPT is the SQL of our century?

SQL promised in the '70s that it would make databases accessible to everyone. It took half a century for someone to deliver on that promise — and it's not SQL. Just feed your database structure into GPT, ask in plain English, and let it generate queries that would otherwise require an expert.

How to Handle Getters When They Have Nothing to Return?

What to do when a getter has nothing to return? Nullable parameter, a hasFoo/getFoo pair, or getFooOrNull? I break down three strategies with everything that comes with them – including where each one will bite you in the hand.

Can Regular Expressions Be Used to Parse HTML?

I built one monumental regular expression that can actually parse an entire HTML 5 document – entities, tags, comments, doctype, everything. It works. And it's absolutely useless. But the journey there is worth every backreference.

When Copilot Loses Direction: A Celebration of Shoddy Workmanship

Microsoft released an official video where Copilot helps write a regular expression for matching HTML tags. The result matches all sorts of nonsense and fails on trivial cases. A tragicomic demonstration of how professional negligence spreads under the banner of progress.

That's all. More articles are on the way.

phpFashion © 2004, 2026 David Grudl | o blogu

Ukázky zdrojových kódů smíte používat s uvedením autora a URL tohoto webu bez dalších omezení.