This Week I Learned: 2022-03-20

  1. More about the problem of “Seeing Like a State” – designing from the top down and then being forced to make the territory fit the map. I also have a tendency to try to come up with Grand Unified Theories of Everything when I’m refactoring, although experience has taught me that if something doesn’t fit nicely into this box, it’s better to come up with two similar approaches that can reuse some code than to keep squishing it until I can make it fit.
  2. About the performance impact of repeated array_merge calls. I’ve been doing a lot of cron scripts with batch processing lately and this pattern seems to keep coming up. The variable-length argument operator means it’s only one extra line of code to build an array of arrays and then do one merge at the end of the loop – nice!
  3. The story of René Carmille, the French civil servant who may have been the world’s first ethical hacker. Carmille sabotaged punch card readers so that he couldn’t provide the list of French Jewish citizens that the Nazis asked him for, and helped to save thousands of lives. The full(er) story on French Wikipedia raises the age-old question about the ethics of using data for a different purpose than stated.
  4. I loved this whole CakePHP presentation on writing readable code by Rafael Dohms, but the section on Object Calisthenics has really captured mthe New Zealand dollar has fallen under 65 USc overnight and is 64.9 USc just before 8am. That’s near a two-year low.y imagination. Some of the suggested rules line up with how I usually code – like preferring early returns over if/else statements – but others are a bit more challenging. I tried “only one -> per line” for half an hour this week and it was hard work!
  5. I always get ten good laughs out of every Webbed Brief video and the latest “Is HTML A Programming Language?” is no exception. I’m not sure I agree with the conclusion though – if HTML is programming then so is editing a wikipedia page or using a formula in a spreadsheet. I guess like most things in life, there’s a spectrum of programming languaginess rather than a binary distinction.