Click here to Skip to main content
15,887,329 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Our company is interfacing with another software company for a joint project, and we were told that, if a particular value should not be displayed, we should pass in a -5000 (their arbitrary sentinel value); the reason is that no number column in their Oracle database supports null values, on the recommendation of their (now former) Oracle dev. This company also writes the vast majority of their code in VB6 (slowly transitioning to VB.NET, which is another topic for another day...). Out of pure curiosity, is there any valid reason for this recommendation? I can't think of any on my side.
Posted

You said it all. They used to use VB6. They are morons. I am in the same hell, magic values, no use of null, etc. No, they are wrong.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 22-Aug-12 17:39pm    
They are extreme morons. Good to call things by their true names. My 5.
--SA
Sergey Alexandrovich Kryukov 22-Aug-12 17:47pm    
I could not stand adding my answer, too. I know the idiom: "You can say this again." :-)
--SA
In my opinion, no valid reasons exist. The sole purpose of null value is to describe that the is no data or the data is unknown.

I could imagine that this has been reasoned because of the indexing, foreign key and constraint related 'issues' but those things can quite easily be tackled with proper design and they don't typically justify the usage of different fixed magic values in this sense.
 
Share this answer
 
Comments
IndifferentDisdain 22-Aug-12 15:46pm    
Thanks; I actually have access to their database schema, so I can confirm there are no indexing, foreign key or other constraints related to this particular column I'm currently looking at, and this requirement is in place for every single one of their number columns.
Wendelius 22-Aug-12 16:41pm    
Sounds peculiar but those reasons I could have understood to some extent. Of course there could be some client (VB6) related issues etc.

Anyhow as I said, I see no reason to replace a perfectly valid null value with some other value :)
Sergey Alexandrovich Kryukov 22-Aug-12 17:48pm    
Danger! Run away as soon as you can!
--SA
Sergey Alexandrovich Kryukov 22-Aug-12 17:46pm    
No excuses at all. My 5.
The question is shocking; I put my answer as well, please see.
--SA
Wendelius 22-Aug-12 18:05pm    
Thanks :)
A person who uses something like -5000 as a special magic value to conduct "not a value" is a complete idiot and moron. Actually, using VB6 does not have any excuses. The only reason to use it I can see is to sabotage.

Here is one of the most difficult issue of your profession: one of your main goals should be never working with such people if you cannot help them to fix themselves. They will screw up everything anyway. Stay away from them. This is difficult, but otherwise they screw up all your carrier.

—SA
 
Share this answer
 
Comments
Wendelius 22-Aug-12 18:06pm    
Fair enough.
Sergey Alexandrovich Kryukov 22-Aug-12 18:15pm    
Thank you, Mika.
--SA
IndifferentDisdain 23-Aug-12 9:28am    
Thanks; I know the developer that made that determination (I used to work for that company), and he has a ton more experience than I, so before I flew off the handle at that, I just wanted to make sure there wasn't some 'Aha!' gotcha in there that made this a viable option. Best guess: he and/or other devs weren't comfortable properly handling null values in code, so they just removed nulls. Of course, there's even more effort to translate the magic value, but whatever.
Sergey Alexandrovich Kryukov 23-Aug-12 10:38am    
You are welcome. I've touched one aspect of what we discuss: what could be just a mistake of the beginner (even though it's enough to have some brain to see this is bad), if repeated, is a sign of attitude, if persistent -- a sign of unrepairable brain damage.
By the way, please consider accepting this and other answers formally (green button) -- thanks.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900