PHP assertions and assertion libraries

I’ve blogged about PHP assertions and assertion libraries a while back.  I haven’t started using the assertions anywhere outside of unit tests yet, but with more and more bloat added to the code to check for types and particular values, I keep coming back to the idea.

Today I came across a nice article by Matthias Noback which once again made me consider assertion libraries in my codebase.  I’ll discuss with colleagues and hopefully we’ll make the decision once and for all on whether assertions are a good way to go forward.

7 Tips to Write Exceptions Everyone Will Love

Tomas Votruba shares the “7 Tips to Write Exceptions Everyone Will Love“.  These all make a lot of sense and are generic enough to be applicable to any programming language (that implements exceptions).  The list of tips is as follows:

  1. Make Exception Names for Humans
  2. Use Quotes Around Statements
  3. What Exactly is Wrong?
  4. What is The Wrong Value?
  5. What File Exactly is Broken?
  6. What Options do I have?
  7. Link what You can’t Fit 140 Chars

Read the full article for both good and bad examples, as well as the explanations of the above.

The Alternative Dictionary of Web Design Terms

Webdesigner Depot runs “The Alternative Dictionary of Web Design Terms“.  It’s simple, yet pretty funny and accurate.  I liked all of it, but a few of my favorites are:

  • Agile: A development methodology that advocates self-organizing teams and flexibility, allowing startups to more efficiently realize they’re building something that no one wants.
  • Backlink: Before experimenting with dogs, Pavlov trained online marketers to salivate whenever he said “backlink”. It still works.
  • Code: The stuff they show on computer screens in the less-offensive Hollywood representations of hacking.
  • Comments (in Code): In-jokes and clever insights that only total nerds will ever see. One day, someone will achieve true enlightenment, and the secret will written down as a code comment, and lost to an obscure GitHub repository.
  • Navigation: The quickest and easiest way for a customer to get lost.
  • URL: U R Lost.

 

Cold War on Ice

Cold War on Ice is an excellent documentary about the USSR vs. Canada ice hockey Summit Series 1972 games.  I find it to be quite balanced, showing the perception from both sides, featuring the interviews with the same people back in the day and their take on it now, and plenty of great footage.

It’s a must see for any ice hockey fan and history nerd.