Implicit conversion vs. Explicit conversion

by Mark Zaugg 22. August 2011 23:27

I went through the DBA programme at SAIT.  I'm rather proud of what I've accomplished, I only wish I got to use it a lot more.

I really love Oracle, it sings to me for a whole bunch of reasons.  The structure is beautiful.  Laying out a tablespace across spindles is the sort of thing that makes my heart cry out with joy.

Sure, it's a pain in the ass.  I particularly love the ORA-03113 error.  The fact that I didn't even have to look up the damn number says I need to get better with my tools.  The pain in the ass of Oracle is that you have to set each parameter and you have endless settings to get right.  The beauty of Oracle is that you have a gazillion parameters and settings you can tweak to get perfectly right for your particular situation.

The one thing I'm going to talk about tonight is found in many more places than just Oracle, but that's where I first encountered it.

Here's the situation:  You're entering a date into a database.  Without thinking, you just happen to type in, "22-Aug-2011."  Or maybe you typed in "22/08/11."  Or perhaps, let's go completely wild and crazy and type in "08/22/11."  You are a wild party.

Here's the thing, if Oracle is expecting a date and you're giving it a string of characters, it will look at the input and, if it makes sense, do an automatic conversion of what you typed to what it expected.  It's called an "implicit conversion" and it can figure out - in certain cases - what it got and what it expected.  "22-Aug-2011" is pretty clearly a date, so is "22/08/11" and, if you're a North American bend of mind, the same with "08/22/11."  It happens with all kinds of computer languages where the system figures out what it was supposed to be getting and just does the translation for you.

Ahh, but what if I wrote this entry ten days ago?  Then it would have been  12-Aug-2011.  No problem when I write it like that, but if I write it 12/08/11 we can already sense a problem.  Should I write that date as 08/12/11 I shifted our timeframe out by four months.  There's no way for a computer to know precisely if the date is August or December.  It could be either, depending on your convention.

So to counteract the ambiguity of the implicit conversion, we have an explicit conversion.  It's more work, but there is absolutely no doubt as to what you meant.  You hand-hold Oracle (or whatever) through the translation and you are very precise to ensure it's meaning is perfectly correct.

What's this got to do with me?

I've been suffering from a whole string of implicit conversions lately.  (No pun intended!)

I'm a very straight forward, practical guy.  I'm horribly vague, I dance around a subject a lot, but if I get confronted directly I'll take the time to at least try to explain myself.  In reality, this whole series of blog posts are one, long, run-on sentence that will culminate with one great big post that will piss someone off.  I hope.

It takes me a while to develop my thoughts.  It takes effort for me to explain myself step by step.  Much of the time I have to go back and explain twenty or thirty years of history to explain why I just made the decision I chose.  But I try to be consistent in my thought process and rational in my decisions.  It just doesn't always show through.

The other problem is when I use those "tidbit" soundbites that has a deep meaning to me but doesn't necessarily have full relevance to someone else.  I try really hard to not use those conversation shortcuts when not everyone knows what they mean, but they're often really useful to me and slip through.  You'll know when I use one - they seem strange and out of context.  I'll talk about "Loading the truck" and I'm really talking about pretending to throw my anger over my shoulder, but I'm really just throwing it into the bed of a truck I'm dragging behind me - and I can drag a dump truck, no little pickup truck for this guy!  It's a bad thing, eventually that truck has to get dumped and you don't want to be the one dumped on.  See?  Easy, short, logical, and pretty much impossible to figure out without having it explained to you.

Implicit conversions often need to be made explicit.  Implicit conversions work okay for a while, but explicit conversions leave no room for error.  They're a lot more work, it's not always worth it, but when I find I am getting misunderstood I need to go back to explicit conversations.  Explicit conversations can sometimes be risky, or hurtful, but they are worth the clarity.

So a couple of helpful hints about conversations with me:

My entire life is dedicated to meeting my cornerstones as a person.  If I'm not honest, trustworthy, fair, and respectful I am nothing as a man.  If my conversation runs counter to those principles we need to have an explicit conversation and I need to either apologize or explain myself.  And probably apologize and then explain myself.

I have an overdeveloped sense of humour, and my entire life is a huge inside joke.  If you don't get the joke, I can try to explain it but it's going to take a while.  Laugh along if you can, we'll talk explicitly about it later.

I am absolutely an unhurtful person.  If you feel hurt by anything I've said, please, let's immediately have an explicit conversation over coffee.  Hurting someone else is utterly unacceptable to me.

Apparently I'm flirty.  Yay me.  It's going nowhere.  Trust me.  For the full explanation of that one, see "This is (Really) Why I'm Single."  Oh wait, Firefox crashed and I lost that post.  Just trust me on this one for now.

Lastly, you may think I'd be fun at a party, I'm not all that much fun at a party.  You may think that I'm more fun with a couple of beers, I'm pretty much the same after a couple of beers and I'm a lightweight anyways.  You may think that I'm just a super nice guy, I'm really the same old asshole I've always been but I'm trying to be more tactful about it.

I should be exactly the guy I appear to be.  If I'm not, it is time to shift from implicit to explicit.  I'm more than willing, let's sit down and discuss it.

Comments (1) -

8/23/2011 2:54:21 AM #

Apparently I forgot one.

It's a line from a song.

Mark Zaugg Canada |

Comments are closed

Welcome

Change is the only constant.

Welcome to the semi-exciting new look, same crappy blogger.

All comments are still moderated, I'll approve everything that isn't spam or offensive.  Agreement with His Dorkasaurus is not necessary.

What has changed is that I don't have 1000 junk accounts clogging up the system that I have to go through one by one.  Yes, you too can set up an account and no longer need to wait for me to notice you posted.  Completely optional.

As always:  Have fun, be respectful.

Calendar

<<  May 2018  >>
MonTueWedThuFriSatSun
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

View posts in large calendar