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.

This Week I Learned: 2022-05-01

  1. About resource expansion in RESTful interfaces. Somehow I have never encountered this practice before, but I found my first use for it straight away and I am very happy with my shiny new thing.
  2. This handy checklist of modern PHP features helps you quickly look up which cool new features you can use with each version. I switch around between projects using 4 different versions of PHP regularly, and while PHPStorm is helpful at reminding me which things I can and can’t typehint at each version, I could definitely make more use of some of PHP’s recent enhancements when they’re available.
  3. Browser in the Browser” attacks are the latest sophisticated phishing technique. The fake site pops up a separate browser window for you to enter your single sign-on credentials – but the browser window is actually just an image of a browser window. Layer input fields over it in the right place and add some JS to make it draggable, and you have a very convincing sign-in window. The giveaway is that you can’t drag the new “window” outside of the bounds of its parent, and presumably you can’t Alt-Tab between windows either.
  4. A new lens for thinking about CSS layout algorithms. I haven’t done much greenfield front-end work thus far in my career, and when I do I usually finish up trying to combine two different answer from StackOverflow only to find that it Just Doesn’t Work. I have figured out by trial and error that some properties don’t go with display: flex; but this article really helped me to understand the bigger picture of what’s going on.
  5. The Laravel Origins documentary is an entertaining glimpse into the Laravel community. I do sometimes get culty vibes from Laravel fans (the bit about Taylor Otwell’s beautiful comments near the start was a bit cringy) but if it is a cult, it seems to be a very benign and happy one.