• bucky (unregistered)

    please tell me he eventually tried it out.

  • (cs)

    I don't know what the parameter does, I just know that it does exactly what I ever wanted!

  • (cs)

    Recent upgrades to the system have actually changed this...


    <font face="Courier New" size="2"><font color="#000080">public object</font> LoadOrg(<font color="#000080">int</font> cmpKey, <font color="#000080">object</font> DO_NOT_USE_AT_ALL_EVER_I_MEAN_IT);


    which STILL didn't work, so it was upgraded further to

    </font><font face="Courier New" size="2"><font color="#000080">public object</font> LoadOrg(<font color="#000080">int</font> cmpKey, <font color="#000080">object</font> DO_NOT_USE_AT_ALL_EVER_ILL_KILL_YOU_IF_YOU_DO);</font>

  • Drew (unregistered)

    Much like opening/closing the main drain in Joe vs. the Volcano, it probably does nothing.

  • Last Bubble (unregistered)

    I could see the utility of this if you redefined NOT with:

    #define NOT NOT(NOT)

    in which case, you would be implored (albeit slightly ungrammatically) to use the last param at all times. Probably a way to create two product lines: a Basic (NOT) and Enterprise (NOT NOT) edition.

  • (cs)
    Alex Papadimoulis:

    <FONT face="Courier New" size=2><FONT color=#000080>public object</FONT> LoadOrg(<FONT color=#000080>int</FONT> cmpKey, <FONT color=#000080>object</FONT> DO_NOT_USE_AT_ALL_EVER);</FONT>

     

    It returns object I_TOLD_YOU_NOT_TO_USE_ME of course.

    Arthur Dent: I wonder what will happen if I press this button.
    Ford Prefect: Don't.
    Arthur Dent: [presses it] Oh.
    Ford Prefect: What happened?
    Arthur Dent: A sign lit up saying "Please do not press this button again."

     

  • (cs)

    Awwwwwwwwwwwww. C'mon alex, tell us what the variable was used for! PLEEEEEAAAAAAAAAASSSSSSSSSSEEEEEEEEEEEE!

    I wonder if the first line was:

    if (DO_NOT_USE_AT_ALL_EVER != ((object)null))
    {
        throw new Exception("I warned you never to use that parameter!!!");
    }

  • rk (unregistered)

    The author probably wants to be certain that some kind of parameter is always passed.  By cleverly naming it in such a way that s/he appears to not want a parameter to be passed, we know that, indeed, we should pass something.  Brillant!

  • (cs)

    I guess that if you leave the <font face="Courier New" size="2">DO_NOT_USE_AT_ALL_EVER </font>parameter a default object is created and used like a local variable? Or if this language does not support default or implicit parameters, how can one NOT pass a forbidden, heretic object and get the shite to compile?!

  • home homine lupus est (unregistered) in reply to RayS

    Maybe whas changed the implementation, but the interface can be altered, and the var name is a suggestion-of-use to avoid attemps to istil using it, that WILL be a error.

    V 1.0

    <font face="Courier New" size="2"><font color="#000080">pascalfunction Sound( Object self, integer Volume)
    begin
      self.CreateSound();
      self.EmitSound(Volume);
    end


    </font></font>V 2.0


    <font face="Courier New" size="2"><font color="#000080">pascalfunction Sound( Object self, integer DONT_USE_THAT_NEVER)
    begin
      self.CreateSound();
      self.EmitSound(); (* NOTE: Volume is set with self.SetVolume( vol ) *)
    end
    </font></font>
    --Tei

  • Michiel (unregistered)

    C'mon, do it! DO IT! doitdoitdoitdoitdoitdoitdoitdoitdoitdoitdoitdoitdoDOIT!

    (sorry, couldn't help myself)

  • don't be silly (unregistered) in reply to home homine lupus est

    It returns FILE_NOT_FOUND, of course

  • (cs)
    Alex Papadimoulis:

    When Steve Mitcham started at a new job a little while back, he spent some time reading through the documentation and implementation guide for the enterprise framework that the company developed in-house. There were a few things that seemed off, but one thing in particular stuck out ...

    <FONT face="Courier New" size=2><FONT color=#000080>public object</FONT> LoadOrg(<FONT color=#000080>int</FONT> cmpKey, <FONT color=#000080>object</FONT> DO_NOT_USE_AT_ALL_EVER);</FONT>

    <FONT face="Courier New" size=2><FONT color=#000080>public</FONT> <FONT color=#000080>void</FONT> SaveOrg(<FONT color=#000080>int</FONT> cmpKey, <FONT color=#000080>object</FONT> org, <FONT color=#000080>object</FONT> DO_NOT_USE_AT_ALL_EVER);</FONT>

    Never before was Steve so intrigued and tempted to find out what might happen if he passed in something ... a string ... an integer ... or even just an itsy-bitsy little bit.

    object myBlackBox = new object();

    object myObject = LoadOrg(1,myBlackBox);

  • (cs) in reply to RayS
    RayS:
    Recent upgrades to the system have actually changed this...


    <font face="Courier New" size="2"><font color="#000080">public object</font> LoadOrg(<font color="#000080">int</font> cmpKey, <font color="#000080">object</font> DO_NOT_USE_AT_ALL_EVER_I_MEAN_IT);

    ...
    </font>

    Yes, but then someone submitted this code:


    ...
    try
    {LoadOrg (num, DOES_ANYBODY_WANT_A_PEANUT);}
    ...

  • (cs)

    The least stupid explanation I can think of is that some other code calls these functions with specific values except he can't be bothered to document what values are acceptable and what they do. If null is used, some super, magic code is not invoked whereas the wrong values will crash something.

    Either that or there's a logic bomb in there.

  • (cs) in reply to Disgruntled DBA

    Could be they used the parameter in previous versions, but later discovered they didn´t use it at all.

    Instead of changing every call to the function to not pass the argument, and eliminating every object created for that purpose, they left it as was but changed the parameter name to WARN it´s not used at all.
    Down side: Every new call would need to send anything to make it compile.

    Maybe a THIS_PARAMETER_IS_NO_LONGER_USED name would have been a better idea.

    This is the kind of stuff short deadlines produces

  • Orion Adrian (unregistered)

    Perhaps it was the equivalent of "reserved" which pops up often in Microsoft documentation. Perhaps the original coder was just trying to get programmers not to pass values in because the code was going to change to use it as a special case and if someone did pass something in, changing the function would break the programmer's code.

  • Shizzle (unregistered)

    public object LoadOrg(int cmpKey, object DO_NO_USE_AT_ALL_EVER) throws OMG_I_CANNOT_BELIEVE_YOU_USED_IT_EXCEPTION



  • ibo (unregistered)

    isn't it obvious?

    <font face="Courier New" size="2">DO_NOT_USE_AT_ALL_EVER is not supposed to NOT be used, rather, LoadOrg keeps a collection of objects that once instantiated are not supposed to be used!

    This could be cleared up with a simple comment:

    /// <Summary>
    /// Use </font><font face="Courier New" size="2">DO_NOT_USE_AT_ALL_EVER for objects not to be used. If the objects are /// usable and intended to be used do not use </font><font face="Courier New" size="2">DO_NOT_USE_AT_ALL_EVER ever.
    /// </Summary>
    </font>

  • Anon Coward (unregistered)

    We see this all the time, like this function here:  dwFlags and pvReserved are both "reserved for future use and must be set to zero/NULL"...

  • (cs)

    feh.
    I just use 'Verboten' in these instances.  that way anyone debugging my code has to spend some time learning German before they spend even more time investigating the code.

    something about making me look more efficient than other people, i'm not sure...

  • (cs)

    That reminds me of a WTF early on in my programming career.  This massive and old FORTRAN program was getting an ABEND (sort of like a core dump) on the final "STOP 123" statement.  Poring over the SYSABEND trace, I discovered it was because the value of the constant 123 had somehow gotten clobbered.  Yes, you could do that in FORTRAN - it was back in the time when programmers were cheap and computers were expensive.

    A week's worth of debugging (mostly poring through paper listings rather than test runs - remember what I said about computers being expensive?) and I discovered that some idiot written a function had a big comment at the beginning of the function saying "C DON'T PASS IN A CONSTANT" and then proceeded to clobber the value in the parameter for no apparent reason.  Sure enough, some other idiot had passed in the constant 123 as a parameter to that function.  My fix was to take out the comment and the deliberate clobbering of the parameter.  So a week of work, and I removed one line of code and one comment.

  • (cs) in reply to PaulTomblin
    PaulTomblin:
    So a week of work, and I removed one line of code and one comment.



    Man, -1 LOC/week?  Your productivity was really in the shitter, wasn't it?  Didn't Joe produce 10,000 LOC that week?  I mean, yeah, his commits didn't compile, broke the build process, and set the entire department back a day, but, come on.  At least he was being productive!
  • Sam (unregistered) in reply to warmachine

    It's possible that the function recurses and that variable is used for recursion further down the line?

    void recurse(int I_MUST_BE_NULL)
    {
        if (null == I_MUST_BE_NULL)
           return recurse(1);
        else
           return recrse(I_MUST_BE_NULL + 1);
    }

    or something . .

    Sam

    PS Those of you who are sad enough to look at that function will realise that it will recurse forever. But hey, it's only an example.



  • (cs) in reply to Sam
    Anonymous:
    PS Those of you who are sad enough to look at that function will realise that it will recurse forever.


    If I'm sad for reading your code, what's that make you for writing it?
  • (cs) in reply to merreborn
    merreborn:
    PaulTomblin:
    So a week of work, and I removed one line of code and one comment.


    Man, -1 LOC/week?  Your productivity was really in the shitter, wasn't it?  Didn't Joe produce 10,000 LOC that week?  I mean, yeah, his commits didn't compile, broke the build process, and set the entire department back a day, but, come on.  At least he was being productive!


    I did mention that I don't work there any more, right?  "Joe" (his name was actually Hanna) could set the entire department back more than a day every time he decided he needed to work some extra hours.
  • (cs) in reply to merreborn
    merreborn:
    PaulTomblin:
    So a week of work, and I removed one line of code and one comment.



    Man, -1 LOC/week?  Your productivity was really in the shitter, wasn't it?  Didn't Joe produce 10,000 LOC that week?  I mean, yeah, his commits didn't compile, broke the build process, and set the entire department back a day, but, come on.  At least he was being productive!


    I once had the dubious privilege to work on a project with a guy like that. He was able to "produce" more than 1000 LOC a day and did it in a very tight fashion, writing twice as much code on a line as it is healthy but there wasn't a single day when his code actually compiled.

    So I had to start each morning with correcting yesterday's code until it compiled and after lunch came the funny part: eliminating NPE-s, because he never bothered to check for null values. Finding the null in a line like "if( foo.getX().getY().getZ() > 6 ) bar.getA().getB().getC().setD( paula.getF() ); is a great way to kill time on an otherwise boring afternoon.
  • UTU (unregistered) in reply to isaphrael
    isaphrael:
    I just use 'Verboten' in these instances.  that way anyone debugging my code has to spend some time learning German before they spend even more time investigating the code.


    This is not exactly programming, but I once was installing a DMX-controlled lighting effect into a discotheque. It was a cheap product (in those days the most basic models used to cost an equivalent of 3000 euros a piece, this was really much simpler). Of course, it had a manual; in chinese, japanese, and german. No hope of getting one in english.

    Anyway, the manual had a comment that one of the channels (the one that was used to control the mirror of the effect) that said something like "250-255, vervender sie nicht, rauchen verboten". I knew tought it was something about using at night with smoke... and boy was I surprised to learn that turning the mirror to it's most extreme position (range 250-255 to be exact) caused a short circuit inside the machine and literally caused a fire if there was anything that wanted to catch the fire inside i (like dust etc.)

    Later on we reprogrammed the controller to not sen more than 221 ($DD) to *any* channel; extreme measures for extreme problems...

    Oh how I wished I remembered what's the mark/model of the effect... though I believe it's been long out of production by now.
  • shepherd (unregistered)

    its probably unwise to tempt murphy like that.

  • Carl de Billy (unregistered) in reply to Maximilianop

    Maybe a THIS_PARAMETER_IS_NO_LONGER_USED name would have been a better idea.

    That's the reason why there is an [Obsolete] attribute into the .NET Framework.

  • WTF?! (unregistered) in reply to Sam
    Anonymous:
    It's possible that the function recurses and that variable is used for recursion further down the line?

    void recurse(int I_MUST_BE_NULL)
    {
        if (null == I_MUST_BE_NULL)
           return recurse(1);
        else
           return recrse(I_MUST_BE_NULL + 1);
    }

    or something . .

    Sam

    PS Those of you who are sad enough to look at that function will realise that it will recurse forever. But hey, it's only an example.





    Ouch whoever designs code like that.. needs to be taken out and Shot.

    if I Ever see a function like that... I will spend the rest of my days HUNTING YOU DOWN!

    :)
  • (cs) in reply to PaulTomblin

    PaulTomblin:
    merreborn:
    PaulTomblin:
    So a week of work, and I removed one line of code and one comment.


    Man, -1 LOC/week?  Your productivity was really in the shitter, wasn't it?  Didn't Joe produce 10,000 LOC that week?  I mean, yeah, his commits didn't compile, broke the build process, and set the entire department back a day, but, come on.  At least he was being productive!


    I did mention that I don't work there any more, right?  "Joe" (his name was actually Hanna) could set the entire department back more than a day every time he decided he needed to work some extra hours.

    I once had a female coworker who happened to have that talent as well.  My favorite story is when some random morning, she overheard someone say that our tech lead was taking a personal day that day.  She exclaimed, "NO!!!  He has to come in today.  He HAS to help me fix what I broke."  What did she do?  Well, we had a commercial website.  When users logged into our site, there was the usual name/password check and then a check on the current date against the account expiration date from the database to make sure the account was current.  The back end database was backed up nightly, overwriting the previous day's back up (yes, i know, not the best back up strategy ever).  Well, turns out she had forgotten that pesky where clause on an update sql statement she had run the previous day to update what she thought was just a few users' accounts.  Then she went home for the day.  So, all of users had account expiration dates set to some day in the past and no one could log in.  Oh yeah, and since she did it the previous day, the back up data was no help.  Only funny because I didn't have to help clean up that mess...

    (The fact we could run ad hoc sql queries against a production database is a huge wtf, yes, i know that too, that's a whole other mess not worth explaining....)

  • (cs)

    <font face="Verdana" size="3">
    </font>

  • Kelsey (unregistered)

    This reminds me of touring through Australia's only nuclear reactor at Lucas Heights, near Sydney. Inside the reactor there is a button, which says

    'Do Not Press This Button'

    Apparently it was hooked up to a counter. Particularly fun on open to the public days.

  • (cs)
    Alex Papadimoulis:

    Never before was Steve so intrigued and tempted to find out what might happen if he passed in something ... a string ... an integer ... or even just an itsy-bitsy little bit.



    Well, I can already tell you what might happen: unthinkable mayhem.
  • xcor057 (unregistered)
    Alex Papadimoulis:

    <FONT face="Courier New" size=2>DO_NOT_USE_AT_ALL_EVER);</FONT>

    <FONT face="Courier New" size=2><FONT color=#000080>public</FONT> <FONT color=#000080>void</FONT> SaveOrg(<FONT color=#000080>int</FONT> cmpKey, <FONT color=#000080>object</FONT> org, <FONT color=#000080>object</FONT> DO_NOT_USE_AT_ALL_EVER);</FONT>

     

    I wonder if the parameter should be of type object.  Maybe it should inherit from a base class such as the Illudium236SpaceModulator class.

    CAPTCHA = clueless

    'nuf said.

     

  • (cs)

    Now the Python was more crafty than any of the wild animals inherited from Object. He said to the woman, "Did God really name the fruit, 'DO_NOT_USE_AT_ALL_EVER'?"

    The woman said to the Python, "We may use the cmpKey, but God did say, 'You must not use fruit at all ever, and you must not construct a reference to it, or you will throw an exception.' "

     "You will not throw an exception," the Python said to the woman. "For God knows that when you use it your IObject will be implemented, and you will be.Equal(toGod), knowing good and evil."

    When the woman saw that the fruit of the tree was good for food and inherited from IObject, and also desirable for gaining wisdom, she de-referenced it and called a method. She also passed a reference to her husband, who was with her, and he de-referenced it. Then the IObjects of both of them were implemented, and they realized their object references had not been set to an instance of object; so they sewed fig leaves together and made traces for their stacks.

  • s0be (unregistered) in reply to xcor057
    Anonymous:
    Alex Papadimoulis:

    <font face="Courier New" size="2">DO_NOT_USE_AT_ALL_EVER);</font>

    <font face="Courier New" size="2"><font color="#000080">public</font> <font color="#000080">void</font> SaveOrg(<font color="#000080">int</font> cmpKey, <font color="#000080">object</font> org, <font color="#000080">object</font> DO_NOT_USE_AT_ALL_EVER);</font>

     

    I wonder if the parameter should be of type object.  Maybe it should inherit from a base class such as the Illudium236SpaceModulator class.

    CAPTCHA = clueless

    'nuf said.

     



    I thought it was Uranium PU-36?
  • xcor057 (unregistered) in reply to s0be
    Anonymous:
    Anonymous:
    Alex Papadimoulis:

    <FONT face="Courier New" size=2>DO_NOT_USE_AT_ALL_EVER);</FONT>

    <FONT face="Courier New" size=2><FONT color=#000080>public</FONT> <FONT color=#000080>void</FONT> SaveOrg(<FONT color=#000080>int</FONT> cmpKey, <FONT color=#000080>object</FONT> org, <FONT color=#000080>object</FONT> DO_NOT_USE_AT_ALL_EVER);</FONT>

     

    I wonder if the parameter should be of type object.  Maybe it should inherit from a base class such as the Illudium236SpaceModulator class.

    CAPTCHA = clueless

    'nuf said.

     



    I thought it was Uranium PU-36?

    My WTF.  It is actually 'illudium Q-38 explosive space modulator'

    CAPTCHA = quality

    Now that's more like it.

     

  • Dazed (unregistered) in reply to OneFactor
    OneFactor:
    Now the Python was more crafty than any of the wild animals inherited from Object. He said to the woman, "Did God really name the fruit, 'DO_NOT_USE_AT_ALL_EVER'?"

    The woman said to the Python, "We may use the cmpKey, but God did say, 'You must not use fruit at all ever, and you must not construct a reference to it, or you will throw an exception.' "

     "You will not throw an exception," the Python said to the woman. "For God knows that when you use it your IObject will be implemented, and you will be.Equal(toGod), knowing good and evil."

    When the woman saw that the fruit of the tree was good for food and inherited from IObject, and also desirable for gaining wisdom, she de-referenced it and called a method. She also passed a reference to her husband, who was with her, and he de-referenced it. Then the IObjects of both of them were implemented, and they realized their object references had not been set to an instance of object; so they sewed fig leaves together and made traces for their stacks.

    Utterly priceless. Yes, there's been a fair few rubbish replies to wade through since I started following this forum, but the best posts, like this one, make it more than worthwhile. The Van Neumann Uncertainty Principle was pretty good as well.

  • (cs) in reply to Drew

    Anonymous:
    Much like opening/closing the main drain in Joe vs. the Volcano, it probably does nothing.

    Joe-v-Volcano:  Quite possibly one of the most brilliant (and I don't mean 'brillant') movies ever.  The genius of the line "I have no response to that" cannot be overstated.

  • (cs)
    {**************************************************************
    * *
    * !!!!!! USE THIS CODE AND DIE !!!!!!! *
    * *
    *.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-. *
    * | ______ | *
    * | .-" "-. | *
    * | / \ | *
    * | _ | | _ | *
    * | ( \ |, .-. .-. ,| / ) | *
    * | > "=._ | )(__/ \__)( | _.=" < | *
    * | (_/"=._"=._ |/ /\ \| _.="_.="\_) | *
    * | "=._"(_ ^^ _)"_.=" | *
    * | "=\__|IIIIII|__/=" | *
    * | _.="| \IIIIII/ |"=._ | *
    * | _ _.="_.="\ /"=._"=._ _ | *
    * | ( \_.="_.=" `--------` "=._"=._/ ) | *
    * | > _.=" "=._ < | *
    * | (_/ \_) | *
    * | | *
    * '-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=' *
    **************************************************************}
  • Logicalmind (unregistered)

    I can probably tell you what this is. Chances are they are creating proxies of the objects in question. Their framework then injects some session state such as transaction handling or something along those lines into these variables. The proxy implementation then uses these variables to do the "wrapper" code so the business logic implementors don't have to deal with it.

  • (cs)

    "Never, ever cross the streams"

    -paraphrased from Ghostbusters

  • Dan (unregistered) in reply to PaulTomblin

    > Yes, you could do that in FORTRAN - it was back in the time when programmers were cheap and computers were expensive.

    As oppose to now when programmers are cheap and computers are cheap, but programmers are still cheaper and can't get better computers.

  • (cs) in reply to Dan

    The real WTF is that the Win32 API is full of instances like this, just without the scary all caps name.

  • (cs) in reply to xcor057
    Anonymous:
    Anonymous:
    Anonymous:
    Alex Papadimoulis:

    <font face="Courier New" size="2">DO_NOT_USE_AT_ALL_EVER);</font>

    <font face="Courier New" size="2"><font color="#000080">public</font> <font color="#000080">void</font> SaveOrg(<font color="#000080">int</font> cmpKey, <font color="#000080">object</font> org, <font color="#000080">object</font> DO_NOT_USE_AT_ALL_EVER);</font>

    I wonder if the parameter should be of type object.  Maybe it should inherit from a base class such as the Illudium236SpaceModulator class.



    I thought it was Uranium PU-36?

    My WTF.  It is actually 'illudium Q-38 explosive space modulator'


    I hate being the prick that says "You're all wrong."  So, I'll try this instead. 

    Ahem; "Just about everyone has been partially right!"

    Illudium PU-36 Explosive Space Modulator.
  • Deparment of Redundancy Department (unregistered)

    Did anybody else read this and immediately think of The Monster at the End of This Book?

  • (cs) in reply to marvin_rabbit

    Er, no.  I just listened to three audio clips from the cartoons (three times each), and it's definitely "Illudium Q-36." 

    I hate being the prick that corrects the prick that corrects everyone else, but if you go to http://www.gargaro.com/marvinsounds.html and have a listen to the clips you will definitely hear "Q," not "PU."  (This, despite the fact that some of the clip files are actually named "pew"-this or that, and transcribed as "pew."  Power of suggestion, no doubt.)  Crank up the volume a bit, and listen carefully.  It's "Q."

  • Rinky Dink (unregistered) in reply to mrprogguy

    Kind of obvious.

    This is an entry into a recursive function, and the recursion needs to pass an object when it calls itself.

    And the first call must be null to start it all off.

Leave a comment on “The Forbidden Parameter”

Log In or post as a guest

Replying to comment #:

« Return to Article