Author: withinboredom

  • PHP Strict Types: Hard to get right

    Some people live and swear by strict types in PHP, and it’s understandable why they do. I want to start by saying that strict types have their purpose, but many programmers don’t understand what they mean and misuse them. I’ve seen plenty of subtle bugs related to strict types, so if you use strict types,…

  • How I use AI

    I’ll not be the first to say it: AI sucks. I’ve been messing around with neural nets since 2001, and they are, generally, pretty terrible things. They can be beneficial in some endeavors but aren’t that smart. The limitations are the same, too, only shrinking marginally from a practical standpoint in over 20 years. Yet,…

  • On Writing a Streaming HTML5 Parser in PHP

    On Writing a Streaming HTML5 Parser in PHP

    One of my biggest complaints with the Swytch Framework is that it is using a validating HTML5 parser. This is great if you want to sanitize some HTML or validate HTML, but in the case of Swytch, this isn’t ideal. Now if you haven’t heard of the Swytch Framework, it’s essentially JSX for PHP. You…

  • Innovation and Necessity

    So many people want “innovation.” It’s almost — or maybe it is — a buzzword. Something people say they want but have no idea how to attain it. Innovation doesn’t just magically appear from thin air. No, if you want innovation, you must desire something and a solution must be necessary. Let me back up…

  • No, a 172 ip address doesn’t mean it’s in Docker

    A very popular CLI tool, I shall not name, assumes that if it is running on a machine with a 172.x.x.x IP address, then it is running in Docker. I’m not even making this up, and if it is, it changes the entire behavior to a ‘production mode.’ First of all, the actual IP range…

  • When to Roll Your Own

    Libraries are amazing. No, not the place where you go and get books for free (though, those are amazing too!), but software libraries. Libraries let you “skip” a bunch of work and go straight to the meat and potatoes of your software. If you are writing scheduling software, you can get an open-source library to…

  • Symfony/Doctrine’s Docs has caused more bugs than anything else.

    Symfony and Doctrine’s documentation has a slight flaw: they don’t use constructors for DTOs.

  • How to kill a Kubernetes cluster in one easy step

    I swear, for the past few months, there has been a major issue with my Kubernetes cluster, at least once a month. Once, a simple update took out my entire network infrastructure. It was down for nearly a whole weekend… This time … this time it was down for nearly a week: the worst one…

  • Creating an ORM-less framework

    Years ago, I enjoyed working with Durable Functions on Azure. There were some aspects that I fell in love with, like how “close” I felt to pure DDD, how simple it was to scale, and how little boilerplate was required. I just had one “problem”[1], I wanted to use it in PHP. I’ve been a…

  • How can I tell the difference between acceleration and up/down?

    Einstein once proposed a thought experiment involving an elevator, basically, you can’t tell the difference between acceleration and gravity. Since I spend a lot of time on trains, metros, and buses, I’ve been curious about how my body can tell the difference between acceleration and going up or down a hill. Ultimately, I can tell…