This Week I Learned: 2022-05-08

  1. The PHP Foundation have released their first update. I’m particularly excited to see the new SensitiveParameter attribute, which can be used to prevent values like secrets or credit card numbers from appearing in stack traces.
  2. Earlier this year I read this post about the potential WebAssembly offers for using popular server-side languages in the browser. A few months later, I’ve encountered the first example of this in the wild – PyScript!
  3. I enjoyed this little CSS selector test, although I only managed to get a couple of them without Googling. I’m not doing much complicated front-end work at the moment but it’s nice to refresh my brain now and again about how powerful CSS selectors can be.
  4. Why are modern programming languages so materialistic? Because they are object-oriented! Just one of many groan-worthy puns at DevDadJokes. I love terrible jokes … particularly when they’re about somebody else’s favourite language or framework.
  5. Speaking of favourite languages … mine is probably still Java, and while PHP has improved in leaps and bounds lately, there are still some things about the language that infuriate like. One of these is how f*#!ing hard it is to validate whether a piece of data is “int-like”, so that I can write code that handles input both from the browser (where everything’s a string) and from API requests (where people like to pass in ints for things that should be ints). I enjoyed this summary of the methods available, although sadly there is still no silver bullet … besides writing my own library function to abstract away all the nastiness, that is.