Comment On Outsourced Property Value

When it comes to outsourcing software development, I hear quite a few complaints. And not just from the whiney Slashdotters griping about why they can't find jobs, but from real people -- people who have actually worked through it. The number one issue seems to be value: for what they're paying, they're just not getting enough good code. But this isn't certainly always the case. [expand full text]
« PrevPage 1 | Page 2 | Page 3 | Page 4Next »

Re: Outsourced Property Value

2006-04-20 15:04 • by paolo
first

Re: Outsourced Property Value

2006-04-20 15:06 • by Tony M
Booleans are hard!

Re: Outsourced Property Value

2006-04-20 15:07 • by Cyan
Because you never know when TRUE might equal FALSE...

Hope be with ye,
Cyan

Re: Outsourced Property Value

2006-04-20 15:09 • by Colin
Pshh, that doesn't even do tribool.  What crap.

Re: Outsourced Property Value

2006-04-20 15:11 • by Mr Beeper

An excellent example of defensive programming.  You'll all be sorry you mocked it when the next version of the CLR adds "maybe" and "sometimes" to the list of possible values for a bool.


Fools!

Re: Outsourced Property Value

2006-04-20 15:11 • by Justin

Let's see.... true, false, maybe, possibly, should-be .... there must be a thousand other cases that we could test for ... maybe the language spec for a primitive will change -- who knows.

Re: Outsourced Property Value

2006-04-20 15:12 • by Justin
69214 in reply to 69212
Anonymous:

An excellent example of defensive programming.  You'll all be sorry you mocked it when the next version of the CLR adds "maybe" and "sometimes" to the list of possible values for a bool.


Fools!



 


You beat me to it!

Re: Outsourced Property Value

2006-04-20 15:12 • by naterkane
if a boolean isn't true or false, then we have some bigger issues to address, no?

Re: Outsourced Property Value

2006-04-20 15:13 • by Jake Vinson
Wow, think of all the lines of code that could be used to validate that an integer is an integer.  Or testing every possible string combination.  That's like infinity billion lines!

Re: Outsourced Property Value

2006-04-20 15:14 • by dmdietz
Hmm...this quality of this WTF just isn't up to snuff.  C'mon Alex, give us some good ones!

Re: Outsourced Property Value

2006-04-20 15:14 • by naterkane
69219 in reply to 69213
Anonymous:

Let's see.... true, false, maybe, possibly, should-be .... there must be a thousand other cases that we could test for ... maybe the language spec for a primitive will change -- who knows.


well, if you don't should on me, i won't should on you.

Re: Outsourced Property Value

2006-04-20 15:14 • by codeman
69220 in reply to 69216
What about "File Not Found" ?

Re: Outsourced Property Value

2006-04-20 15:14 • by Jason
69221 in reply to 69207

Anonymous:
Booleans are hard!


No ... Booleans are! or Booleans not are! there is no hard!

Re: Outsourced Property Value

2006-04-20 15:16 • by marvin_rabbit
69222 in reply to 69220
Anonymous:
What about "File Not Found" ?

God!  That took 13 minutes people!  We're slipping!

Re: Outsourced Property Value

2006-04-20 15:16 • by Digitalbath

Should have been "throw new EndOfUniverseException();"


If you are going to write code that is never going to get executed, it should at least be creative or something...yuck.

Re: Outsourced Property Value

2006-04-20 15:17 • by Anon
The Daily WTF zings Slashdot; Slashdot takes a shot at Digg.  What's next? Digg attacks Fark?

Re: Outsourced Property Value

2006-04-20 15:18 • by Jogi
Validating booleans is scrap, but converting them to strings to validate then (to two different strings each, because of the the uppercase conversion) is even worse.

Re: Outsourced Property Value

2006-04-20 15:18 • by Quietust
The fun part comes when Boolean.ToString() is localized to return true/false strings in the appropriate language, at which point m_ISO9001.ToString().ToUpper() returns "VRAI"/"FAUX" on a computer in France and the program dies horribly.

Re: Outsourced Property Value

2006-04-20 15:20 • by APAQ11
69229 in reply to 69227

    bool v_ISO9001 = value;
    //can only be true or false
    if (v_ISO9001.ToString().ToUpper() == "TRUE" ||
        v_ISO9001.ToString().ToUpper() == "FALSE")
{ m_ISO9001 = v_ISO9001; }
else
    {
      throw new ArgumentException();
    }


Wouldn't the [bool v_ISO9001 = value;] part throw an exception if  value couldn't be made into a bool type anyways thus making the rest of this code pointless?

Re: Outsourced Property Value

2006-04-20 15:21 • by lizardfoot
69231 in reply to 69220
Anonymous:
What about "File Not Found" ?


They lost it.

Re: Outsourced Property Value

2006-04-20 15:21 • by Justin
69232 in reply to 69227

Anonymous:
The fun part comes when Boolean.ToString() is localized to return true/false strings in the appropriate language, at which point m_ISO9001.ToString().ToUpper() returns "VRAI"/"FAUX" on a computer in France and the program dies horribly.


 


AH! so the whole point was to make sure that only ENGLISH speaking people can use the software!  Very creative security, and curse the french!

Re: Outsourced Property Value

2006-04-20 15:22 • by someone
69233 in reply to 69203
Anonymous:
first


Dumb

This guys ip should be banned

Is this a first form or the daly wtf form?

Re: Outsourced Property Value

2006-04-20 15:24 • by Terry
69235 in reply to 69221
But at least this code will catch it if someone tries to pass "hard" instead of "TRUE" or "FALSE"

God, this guys a genious!  I wanna be like him when I grow up!

BTW, does anyone else have trouble with the CAPTCHA?  I'm colour blind, and most of the time all I see is a pink block :S

Re: Outsourced Property Value

2006-04-20 15:24 • by MikeMontana
Without bashing the developer, I would really want to know why the
developer really felt it was important to go this route. Absolutely,
this is "wtf-code", but, someone actually sat down to think this out -
I would have to ask myself "why didnt they see the circular logic in
using a Bool, casting to a String, and checking the string result in a
boolean fashion?"



Something is critically wrong when a developer, who obviously
understands the OO principles of Get/Set and constructs of
IF..THEN..ELSE plus Casting, yet, writes total bunk like this.



Sure, you can say "well, thats what you get when you outsource stuff",
but I dont buy that. I've worked with lots of people from India,
Russia, Eastern-Europe, China - they understand and get the concepts of
programming just as well as you or me. Something more sinister is at
hand - is it "Antagonizing Compliance" between a sour employee and a
sour manager? Is it compliance with a tersely worded spec that
ridiculously demands "each and every parameter will be checked on entry
and exit, in each and every call" [I've seen crap like that].



Or is it just someone who plainly doesnt get it? I hope this isnt the
case - oh it would be sad to think that someone next to me might be
perpetrating a coding-crime like this, and actually mean it!

Re: Outsourced Property Value

2006-04-20 15:24 • by toxik
69237 in reply to 69227
Anonymous:
The fun part comes when Boolean.ToString() is localized to return true/false strings in the appropriate language, at which point m_ISO9001.ToString().ToUpper() returns "VRAI"/"FAUX" on a computer in France and the program dies horribly.


I don't do much C# but I would assume they removed localized Boolean string-castings as of VB6.

I may or may not be wrong

Re: Outsourced Property Value

2006-04-20 15:27 • by ammoQ
They know something you don't.  In 2012, MS will release a quantum
computer compatible version of the .net runtime that will replace the
two-valued boolean with a fuzzy value that can take any value between
false and true. Think of it as a float, constrained to a value between
0 and 1. 0=false, 1=true, 0.5=maybe, 0.2=rather not, 0.9=most likely
etc. The way they programmed this property, they can make sure that
only true and false slip through, not those undecided other values.

Re: Outsourced Property Value

2006-04-20 15:28 • by Cooper
This is not a  WTF - it is just garbage.

Where's the brillance?

Where's the juice?

Where's the factoring of CSS back into each and every element to which it should be applied?

Where's the inspired stupidity?

The essential 'NOT GETTING IT'?

A WTF is breathtakingly a WTF.

This is not even worth a comment.

I seriously considered not pressing the 'post' button.  I think I will just blow away the window...

Re: Outsourced Property Value

2006-04-20 15:28 • by AnonymousJack
69241 in reply to 69233
Anonymous:
Anonymous:
first


Dumb

This guys ip should be banned

Is this a first form or the daly wtf form?


I'm pretty sure it's a forum

Re: Outsourced Property Value

2006-04-20 15:31 • by Digitalbath
69243 in reply to 69229
Anonymous:

    bool v_ISO9001 = value;
    //can only be true or false
    if (v_ISO9001.ToString().ToUpper() == "TRUE" ||
        v_ISO9001.ToString().ToUpper() == "FALSE") { m_ISO9001 = v_ISO9001; } else
    {
      throw new ArgumentException();
    }


Wouldn't the [bool v_ISO9001 = value;] part throw an exception if  value couldn't be made into a bool type anyways thus making the rest of this code pointless?



Yes.

Re: Outsourced Property Value

2006-04-20 15:35 • by W
69245 in reply to 69216
Jake Vinson:
Wow, think of all the lines of code that could be used to validate that an integer is an integer.  Or testing every possible string combination.  That's like infinity billion lines!


Pffft you don't need infinite lines, you can recurse infinitely!


function isValidInt($variable)
{
   if ($variable == 0) { return true; }
   elseif ($variable < 0) { return isValidInt($variable + 1) }
   elseif ($variable > 0) { return isValidInt($variable - 1) }
   else { return false; }
}
?>


Now, in PHP that's a funny useless waste of processor time

Re: Outsourced Property Value

2006-04-20 15:36 • by leoger
    if (m_ISO9001.ToString().ToUpper() == "TRUE"){return true;}
else if(m_ISO9001.ToString().ToUpper() == "FALSE"){return false;}
else return m_ISO9001;

The real WTF is that he ends up returning the value of m_ISO9001 no matter what it is! Unless he somehow understands the concept of the keywords true and false as being special and yet thinks a Boolean can evaluate to true without being true, or maybe... oh, I give up.

Re: Outsourced Property Value

2006-04-20 15:36 • by xcor057
Obviously they were trying to address the quantum theory of superposition.  One can never know if a boolean is true or false until it is acted on.

Re: Outsourced Property Value

2006-04-20 15:39 • by marvin_rabbit
69249 in reply to 69247
Anonymous:
Obviously they were trying to address the quantum theory of superposition.  One can never know if a boolean is true or false until it is acted on.

I surf the Quantum Foam.

Re: Outsourced Property Value

2006-04-20 15:43 • by Wayne

That made my day.  Thanks!


I wonder if this outsourcing shop was CMM level 5.  I wonder if it had all this redundant code because it was CMM level 5.

Re: Outsourced Property Value

2006-04-20 15:45 • by Sean
69254 in reply to 69225
Anonymous:
The Daily WTF zings Slashdot; Slashdot takes a shot at Digg.  What's next? Digg attacks Fark?


Nerd fight!

Re: Outsourced Property Value

2006-04-20 15:47 • by res2
69255 in reply to 69236
MikeMontana:
Without bashing the developer, I would really want to know why the
developer really felt it was important to go this route. Absolutely,
this is "wtf-code", but, someone actually sat down to think this out -
I would have to ask myself "why didnt they see the circular logic in
using a Bool, casting to a String, and checking the string result in a
boolean fashion?"



Something is critically wrong when a developer, who obviously
understands the OO principles of Get/Set and constructs of
IF..THEN..ELSE plus Casting, yet, writes total bunk like this.



Sure, you can say "well, thats what you get when you outsource stuff",
but I dont buy that. I've worked with lots of people from India,
Russia, Eastern-Europe, China - they understand and get the concepts of
programming just as well as you or me. Something more sinister is at
hand - is it "Antagonizing Compliance" between a sour employee and a
sour manager? Is it compliance with a tersely worded spec that
ridiculously demands "each and every parameter will be checked on entry
and exit, in each and every call" [I've seen crap like that].



Or is it just someone who plainly doesnt get it? I hope this isnt the
case - oh it would be sad to think that someone next to me might be
perpetrating a coding-crime like this, and actually mean it!


I would have to guess a code generator did this. No sane person would go though all of that without having to think to themselves, "This looks so enterprisy!"

Re: Outsourced Property Value

2006-04-20 15:49 • by Whiskey Tango Foxtrot? Over.

Oh ho, you laugh at this WTF, but it's not a WTF, it's a carefully planned performance upgrade! Just think about it.... they can increase the performance of the ISO9001 property by an order of magnitude in their next version by simply deleting the ToString().ToUpper() calls and the senseless "make sure it's a boolean" check in the set method.


I'm telling you, this isn't a WTF, this is planned incompetence!

Re: Outsourced Property Value

2006-04-20 15:52 • by Whiskey Tango Foxtrot? Over.
69257 in reply to 69254

Sean:
Anonymous:
The Daily WTF zings Slashdot; Slashdot takes a shot at Digg.  What's next? Digg attacks Fark?


Nerd fight!


Hehee... am I the only one imagining Kyle and Cartman's limp-wristed slap-fight on South Park last week when I hear those words? [:D]

Re: Outsourced Property Value

2006-04-20 15:57 • by Nomen Nescio
69259 in reply to 69256
So... does verifying that all booleans are either true OR false, help one become a ISO 9001 compliant enterprise programmar?

Re: Outsourced Property Value

2006-04-20 15:58 • by ampersander
69260 in reply to 69256
When I read the title I feared some guy managed to programmatically go through several internet protocols, office documents and executables just to validate a value. Compared to the other wtfs this is just harmless tomfoolery.

Re: Outsourced Property Value

2006-04-20 16:02 • by Brian

Could this be the remainders of code refactored from


public string ISO9001 { get {...} set {...} }


or worse


public object ISO9001 { get{...} set {...} }?

Re: Outsourced Property Value

2006-04-20 16:06 • by phsx
69263 in reply to 69249
marvin_rabbit:
Anonymous:
Obviously they were trying to address the quantum theory of superposition.  One can never know if a boolean is true or false until it is acted on.

I surf the Quantum Foam.

This is definitely an applicatino of String Theory!

Re: Outsourced Property Value

2006-04-20 16:18 • by Monday
If IsTrue()?

Re: Outsourced Property Value

2006-04-20 16:23 • by Richard Nixon
69269 in reply to 69245
Anonymous:
Jake Vinson:
Wow, think of all the lines of code that could be used to validate that an integer is an integer.  Or testing every possible string combination.  That's like infinity billion lines!


Pffft you don't need infinite lines, you can recurse infinitely!


function isValidInt($variable)
{
   if ($variable == 0) { return true; }
   elseif ($variable < 0) { return isValidInt($variable + 1) }
   elseif ($variable > 0) { return isValidInt($variable - 1) }
   else { return false; }
}
?>


Now, in PHP that's a funny useless waste of processor time


I think you missed the point of the LOC metric. Clue brick - coming your way.

sincerely,
Richard Milhouse Nixon

Re: Outsourced Property Value

2006-04-20 16:28 • by bullseye
69271 in reply to 69260

Many whiny people:
Where's the WTF?


IMO, a programmer doesn't have to vomit into his IDE in order to produce a WTF.  Someone had to understand that a boolean produced true or false, and then added logic for those "other" values.  Think of it like this... if I, as a developer, walked up to you and said, "If I don't want a boolean to be true or false, what value do I set it to?", what response do you think would go through your mind?


Anything that makes you say WTF...  is by definition, a WTF.

Re: Outsourced Property Value

2006-04-20 16:28 • by Wayne
69272 in reply to 69263

Anonymous:
marvin_rabbit:
Anonymous:
Obviously they were trying to address the quantum theory of superposition.  One can never know if a boolean is true or false until it is acted on.

I surf the Quantum Foam.

This is definitely an applicatino of String Theory!


Is an applicatino one of the fundamental particles of computing?

Re: Outsourced Property Value

2006-04-20 16:35 • by Me
This is one real whopper. Really...just off the charts.

Re: Outsourced Property Value

2006-04-20 16:35 • by nobody
69276 in reply to 69237
> may-or-may-not-be-wrong
That's the next-gen Boolean! New and improved for enterpricy, value driven and customer adding SOA and XML based BI/ERP systems that may-or-may-not-be FileNotFoundException.

Order now! And get a free press release from Microsoft stating how much they are better than Linux.

Next-Gen Boolean, It's just Brillant!
And you knwo, Paula (who is now outsourced to Mongolia) said it!

Re: Outsourced Property Value

2006-04-20 16:44 • by krftsman
69278 in reply to 69243
Wouldn't it simply not compile if value wasn't a bool?  The property is defined as a bool, therefor, value will always be a bool, no?

Re: Outsourced Property Value

2006-04-20 16:45 • by neek
come on! does Paula code in c# too?

return 'Brillant!';
« PrevPage 1 | Page 2 | Page 3 | Page 4Next »

Add Comment