logo

When weird code needs to explain itself

Making the non-obvious impossible to miss

Joel Clermont
Joel Clermont
2026-04-06

What do you do when your code needs to be weird on purpose?

In the latest episode of the No Compromises podcast, Aaron flags a pattern he spotted during a code review. The same unusual approach was repeated across several Livewire components, and it was not clear why.

It turned out to be a deliberate workaround for a toast flicker bug in an older version of Mary UI. But "check the PR notes" is not a sustainable way to explain that to your team, or to an AI coding agent that might refactor it away.

We talk about how we solved it by extracting a trait with clear naming, focused methods, and documentation that explains the bug, the workaround, and when it can safely be removed.

  • 00:00 The confusing code review that started this
  • 01:15 Flagging the unclear pattern across components
  • 03:54 The Mary UI toast flicker bug explained
  • 05:45 Naming, documentation, and protecting the whole team
  • 09:30 Silly bit

Listen Now (11 min)

And after listening, don't forget to subscribe to the podcast, so you don't miss future episodes.

Here to help,

Joel

P.S. Want to copy some well-worn patterns we've used across years of client projects? Check out our book Mastering Laravel Validation Rules.

Toss a coin in the jar if you found this helpful.
Want a tip like this in your inbox every weekday? Sign up below 👇🏼
email
No spam. Only real-world advice.