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.
Empty string or NULL? This seemingly trivial question can break queries, JOINs,
and the nerves of entire teams. I'll show you how to use CHECK constraints in
MySQL 8.0.16+ to enforce one approach and put an end to inconsistency once and
for all.
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.
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.
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.
“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?
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.
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.
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.
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.