| « Prev | Page 1 | Page 2 | Page 3 | Next » |
|
please tell me he eventually tried it out.
|
|
I don't know what the parameter does, I just know that it does exactly what I ever wanted!
|
|
Recent upgrades to the system have actually changed this...
public object LoadOrg(int cmpKey, object DO_NOT_USE_AT_ALL_EVER_I_MEAN_IT); which STILL didn't work, so it was upgraded further to public object LoadOrg(int cmpKey, object DO_NOT_USE_AT_ALL_EVER_ILL_KILL_YOU_IF_YOU_DO); |
|
Much like opening/closing the main drain in Joe vs. the Volcano, it probably does nothing.
|
|
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. |
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."
|
|
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!!!"); } |
|
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!
|
|
I guess that if you leave the DO_NOT_USE_AT_ALL_EVER 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?! |
Re: The Forbidden Parameter
2006-06-16 13:15
•
by
home homine lupus est
|
|
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 pascalfunction Sound( Object self, integer Volume) begin self.CreateSound(); self.EmitSound(Volume); end V 2.0 pascalfunction Sound( Object self, integer DONT_USE_THAT_NEVER) begin self.CreateSound(); self.EmitSound(); (* NOTE: Volume is set with self.SetVolume( vol ) *) end --Tei |
|
C'mon, do it! DO IT! doitdoitdoitdoitdoitdoitdoitdoitdoitdoitdoitdoitdoDOIT!
(sorry, couldn't help myself) |
Re: The Forbidden Parameter
2006-06-16 13:19
•
by
don't be silly
|
|
It returns FILE_NOT_FOUND, of course
|
object myBlackBox = new object(); object myObject = LoadOrg(1,myBlackBox); |
Re: The Forbidden Parameter
2006-06-16 13:22
•
by
Disgruntled DBA
|
Yes, but then someone submitted this code:
|
|
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. |
|
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 |
|
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. |
|
public object LoadOrg(int cmpKey, object DO_NO_USE_AT_ALL_EVER) throws OMG_I_CANNOT_BELIEVE_YOU_USED_IT_EXCEPTION
|
|
isn't it obvious?
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 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 DO_NOT_USE_AT_ALL_EVER ever. /// </Summary> |
|
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"... |
|
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... |
|
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. |
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! |
|
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. |
If I'm sad for reading your code, what's that make you for writing it? |
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 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. |
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. |
|
its probably unwise to tempt murphy like that.
|
That's the reason why there is an [Obsolete] attribute into the .NET Framework. |
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! :) |
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....) |
|
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. |
Well, I can already tell you what might happen: unthinkable mayhem. |
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.
|
|
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. |
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.
|
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. |
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. |
{**************************************************************
|
|
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. |
|
"Never, ever cross the streams" -paraphrased from Ghostbusters |
|
> 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. |
|
The real WTF is that the Win32 API is full of instances like this, just without the scary all caps name.
|
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. |
Re: The Forbidden Parameter
2006-06-16 17:19
•
by
Deparment of Redundancy Department
|
|
Did anybody else read this and immediately think of The Monster at the End of This Book?
|
|
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." |
|
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. |
| « Prev | Page 1 | Page 2 | Page 3 | Next » |