We often get asked “what’s with all those assert statements in your code”? This concept was hammered in my head when I was a junior programmer, so I feel kind of old every time I am asked to explain it. But hey… An assert is usually defined as a “debug-only macro that aborts execution if its argument is false”. (See Steve Maguire’s Writing Solid Code) In other languages, like ActionScript, where you don’t have macros, you can use other techniques to achieve the same effect. The idea is that you use an assert as a diagnostic tool to help you Read More