This Week I Learned: 2020-12-13

  1. If you’re doing a query with a subselect on the @rid field in OrientDB, you need to filter out nulls from your subselect or you’ll get a OSBTreeException saying “Null keys are not supported”. It wouldn’t be a Java program without the odd glorified NullPointerException, I guess.
  2. How to set up a slow query log in MongoDB. And that when you add the vital missing index, this operation too will slow up in the slow query log.
  3. PHP arrays are slightly faster than objects, but they actually use a boatload more memory. And did you know that if you have a numerically-indexed array with the last key being n, and then you unset($myArray['n']), the next value pushed to the array will have key n+1 and your array will now be associative? Just two weird PHP array facts from Larry Garfield’s great Nomad PHP talk about why most uses of arrays in PHP should be replaced by custom classes which can provide better type safety and readability.
  4. Composer 2.0 is now released and it’s way faster. I’m looking forward to having my first play with it over the Christmas break.
  5. Why some old-school HTML format-related tags (e.g. <b> and <i>) aren’t deprecated when most of the others are (e.g. <font> and <strike>). The purist in me thinks that if these tags have really come to have a meaning beyond just the formatting, they could be renamed to something that conveys that more clearly – it would never occur to me that <u> is for annotating spelling errors!