Stateless card dealing

How many times have you had somebody deal a hand of cards and then say “um, everybody count your cards”.  A common reason for this to happen is that the dealer loses count of how many cards are dealt.  For example, dealing cards to 4 players may look like: The problem is that after a…


"This statement is false"

Saying phrases like “This statement is false” does mean you’ve found some fatal flaw in logic itself and it does not make you sound smart. It makes you sound like somebody who doesn’t know the difference between syntax and semantics. The real issue…In order for a statement to have meaning, it must be well defined….


Learning Python

Now that I’m on the IronPython / DLR team, it seemed prudent to actually learn the Python language. There are some good online tutorials, but I found the book “Learning Python” by Mark Lutz to be extremely good. If you really want to learn the language, it’s worth buying the book. It’s large and thorough,…


Don’t expect customers to always run your app under a debugger

“That’s ridiculous, I would never do that” you think.  But there’s a certain class of mistakes that cause this. And smart people make these mistakes. 1) If your app behaves differently under a debugger, it may behave incorrectly when not under a debugger. The mere presence of a debuggers should not change a program’s behavior.  …


Why is System.Diagnostic.Debugger class compiled in retail?

There’s a good reason that methods on a “System.Diagnostics.Debugger” class are still compiled in retail builds, although this occasionally surprises folks. Here’s why…   Background: The System.Diagnostics.Debugger class provides some useful low-level debugging APIs such as: Debugger.Break() – causes the app to break under the debugger when executed. This is used for VB’s “Stop” statement…