The brain is not strongly typed

You're a programmer. I don't care how smart you are:

you continually cast a custom object into a boolean.

Life calls for rapid decisions on all kinds of objects.

Is this pizza is the one i want?

We make such evaluations so often, and on so many different objects, that instead of implementing a 'ToBoolean' function on every single custom type that our mind encounters, we create a static function (ToBoolean) which uses some very dodgy reflection to cast absolutely any object in the world into a boolean result.

It's a bad design. It speeds up processing, but at the loss of precision (and thus correctness) in the return variable.

And it's too convenient. The static ToBoolean function is so damn fast, and readily available, that we use it all the time. A slight bug in your work is distorted into 'absolute failure'. Infact, almost everything becomes a false. And when you should be throwing 'invalid cast exceptions' all over the place, you are instead buisly comparing apples with oranges.

This is a 'cognitive distortion'. This is the kind of stuff David Burns tells you how to get around. I wrote bout it a while back.

Watch out for it. I use this saying as an antidote: nothing is black and white, everything is shades of grey. Say it with me, geeky people: nothing is black and white, everything is shades of grey. everything is shades of grey.


My book "Choose Your First Product" is available now.

It gives you 4 easy steps to find and validate a humble product idea.

Learn more.

(By the way, I read every comment and often respond.)

Your comment, please?

Your Name
Your Url (optional)
Note: I may edit, reuse or delete your comment. Don't be mean.