My recent blog post illustrated the questions and answer format I use in my Pluralsight course .NET Puzzles, Gotchas and Cautionary Tales. At the end leaves it leaves a question open for the reader. I got this comment from James Curran:
arrg… You got me.
I was SURE that while string-plus-int concatenates, int-plus-string was a syntax error.
Ah, James, you fell into my trap. Flying blissfully along you caught sight of the dew on the web and flew right into it…
The Power of the Puzzle
The power of the puzzle isn’t in the question and the answer I give. If you watch my course or read my previous post and never stop the video to think, write down your answer, or experiment in Visual Studio… well, you might think you knew the answer when you didn’t.
The power is in making you think about a particular detail of .NET. Think. Fear slap. Remember.
You’re wired to think you’re correct. This is extremely helpful if you catch a peripheral view of an eye that looks like a tiger’s eye. Looking back over your shoulder at a dead run, the same odd rock in the bushes is still a tiger.
But tigers don’t sit in bushes quite like that. After a bit you pause and tentatively go back. You find that odd rock. And you will never forget that there is a rock that looks like a tiger’s eye beside the new trail, in the morning, in the spring.
You aren’t wired to learn .NET. You’re wired to learn about tigers and which plants are poisonous to eat. And amazingly, you’re wired to build a complex framework from which you can speak, think, make additional projections and learn very complex things. Congratulations, you’re a human!
But learning theory says you’ve got to get a little slap, be a little upset to learn. Laughter, fear, trauma, and black and white “Crap, I’m wrong”. Otherwise, your brain is wired to say “yeah, yeah, got that.”
In fact, if the idea is sufficiently subtle, you’ll twist an explanation into justification for your wrong idea. The research on that is Newton’s Third Law. I think .NET overload oddities may be similarly subtle…
Using the Puzzles
It’s incredibly hard in the midst of the video to avoid sounding condescending when I say “write down your answer or play with Visual Studio.” But there is no other way in the format video for you to show yourself that you are wrong, or right. I’m not going to slap you, and I don’t know if anyone is clever enough to make you laugh at .NET overloads subtleties. Black and white “OMG, I was wrong! About that?! I was wrong!” is enough. When you see you are wrong, the neurons just can’t route what you’re hearing to support your previous notion. You push away the bush and see that it really isn’t a tiger’s eye.
You have a special propensity to learn from itty bitty trauma, fear and surprise. I can’t count the number of times someone said “I know that, but only because…” and they can tell me with excruciating detail exactly how it screwed up a project… their little trauma…
Puzzles create little itty bitty no-overhead, no liability, no risk trauma. Watch a puzzle question clip stop the video and think. Doodle. Write. Propose. Experiment. Drive to work. Do something kinesthetic – at least move a pencil in the shape of your answer or guess.
If you’re right, the affirmation will be a little stronger. If you’re wrong, the likelihood you’ll remember will be significantly higher. And that’s the purpose of these puzzles.
But, there is something wrong with the plus operand puzzle…
Why didn’t the plus operand puzzle in the previous blog post make it into the course?
It’s a nice example to talk about, but the chances of that really hosing you seems small to me. Sure, you could have a typo in a report from it, and you might get some weird data into a string in your database. And if you’re creating a niche app like data collection from streams it might be bad. But, I think that any competent programmer seeing an integer and a string is going to fix it, at least by clarifying with an explicit “.ToString()”
There are two bars for the puzzles in the course –both just my subjective view.
– Are there enough programmers that would get it wrong to be interesting?
– Is there a fair chance that getting it wrong could cause a significant problem?
This puzzle passes the first bar, but just barely misses the second. It’s more than trivia, but not quite significant enough to seem like more than a low value puzzle.
Seriously, stop the video
A lot of you think you had the right answer and didn’t. You aren’t dishonest, you aren’t cheating, it’s just the human brain is wired. It wasn’t a tiger’s eye, and you moved on.
One way to break these patterns is to stop the video, think, record, and then see the result by watching the answer clip. Another is to encounter the problem in your own code an spend a traumatic day debugging.
And if you’re really interested in upping your game, do what James did. After you watch the answer clip, stop the video again. Ask yourself about the implications to your own code. Ask yourself about implications beyond what I covered – in the operand puzzle, I explicitly didn’t tell you what happens with a double, Boolean, decimal or .NET object. What about an enum?
And then, let me know
The puzzles video is an experiment. It’s a hard to video to record, and I don’t know whether to continue the format. I’ve got lots of puzzle ideas, help me decide whether to do more courses using this format.