| « Prev | Page 1 | Next » |
|
Did it blow up?
Were they functions on public class Pandora? |
Re: Classic WTF: The Forbidden Parameter
2007-07-04 09:45
•
by
Jon Skeet
(unregistered)
|
|
I'm not suggesting it really justifies it, but it's possible that the name was intended for anyone *changing* the method rather than calling it. Every so often it's handy (though really ugly) to have a dummy parameter for the sake of distinguishing calls from an overloading point of view. In that situation, you don't want the called method to use the parameter at all, because you don't know what people might have supplied when it genuinely *wasn't* being used.
Just a thought. |
Re: Classic WTF: The Forbidden Parameter
2007-07-04 09:56
•
by
Phr34ker
(unregistered)
|
|
Or it could have been a method in a class that is serialized, that required an Object-variable to be sent in at first, but which later on got unnecessary.
If you change the "layout" of the method, all the objects that has been serialized will become invalid (unless you code around it), and so, doing like this could just be the lazy mans way of getting around a change in a Serialized class. |
Re: Classic WTF: The Forbidden Parameter
2007-07-04 10:02
•
by
WTFNamingException
|
|
There's a bunch of this in the native DirectShow API - probably in MFC too I shouldn't wonder, but life's too short to go and find out.
|
Re: Classic WTF: The Forbidden Parameter
2007-07-04 10:22
•
by
Mcoder
|
And this, ladies and gentlemen, is why you should never use built-in serialization to write into persistent memory. You never know what can of worms you are creating for the future maintaners of your code. |
Re: Classic WTF: The Forbidden Parameter
2007-07-04 10:29
•
by
Shinobu
(unregistered)
|
|
Wow! That's so cute... it brings a smile to my eyes.
|
Re: Classic WTF: The Forbidden Parameter
2007-07-04 11:02
•
by
Dan
(unregistered)
|
|
I'm more amazed by the fact there was documentation
|
Re: Classic WTF: The Forbidden Parameter
2007-07-04 11:39
•
by
ElQuberto
(unregistered)
|
|
This is like God tempting Adam with the forbidden fruit. Well sorta. If God was a crappy coder.
|
Today is actually a Holocaust remembrance day in Latvia. |
Re: Classic WTF: The Forbidden Parameter
2007-07-04 12:41
•
by
Pizza Boy
(unregistered)
|
So not exactly a happy day then. |
Re: Classic WTF: The Forbidden Parameter
2007-07-04 12:47
•
by
noah
(unregistered)
|
|
Did anybody ever consider that the name of the parameter means to not use the function? It's possible that the intention was to warn that the function was deprecated, or something to that effect. In fact, I imagine we would have all caught on to it, if not for the summary and title "The Forbidden Parameter".
|
Re: Classic WTF: The Forbidden Parameter
2007-07-04 13:01
•
by
erktrek
(unregistered)
|
|
Could be some sort of recursive function thing. IOW do not use this parm for the initial call or something (but subsequent calls need to pass an instance of itself etc etc).
Nice descriptive naming too... you could also call it the "shinyRedHistoryEraserButton" parm. |
Re: Classic WTF: The Forbidden Parameter
2007-07-04 14:14
•
by
AdT
(unregistered)
|
But then it should be two functions - one for the public interface and one private function that recurses. I'm not saying you're wrong, all I say is: Even if you're right, it's still a WTF... |
Re: Classic WTF: The Forbidden Parameter
2007-07-04 15:34
•
by
AC
(unregistered)
|
What an obvious way to declare something deprecated. Anyone would be stupid not to realize it. In other news: July 4th is "Ulrichstag", Wikipedia told me. On that day, people (mostly in the Alps) bless everything around them to protect it against bad weather. |
Re: Classic WTF: The Forbidden Parameter
2007-07-04 16:32
•
by
Jon W
(unregistered)
|
|
It's probably a parameter to make the function behave in a slightly different way, used by some other module, that has internal knowledge about this function, but is not in the same assembly/namespace and thus can't be made internal. Your typical implementation dependence coupling, in other words, with a developer too short on time or give-a-dams to factor and document it better,
|
Re: Classic WTF: The Forbidden Parameter
2007-07-04 22:17
•
by
Sharkie
(unregistered)
|
|
If you pass something as that object, it likely throws a OMFG_I_TOLD_YOU_NOT_TO_USE_IT exception.
|
Re: Classic WTF: The Forbidden Parameter
2007-07-05 03:17
•
by
EPE
(unregistered)
|
How can you not pass a parameter? No 'default' values have been declared. Those names seem to imply that the passed data must not be used within the function, instead. |
Re: Classic WTF: The Forbidden Parameter
2007-07-05 07:03
•
by
FreekV
(unregistered)
|
|
Damn, this "worse than failure" is super lame. It doesn't even... go into an explanation why the parameter is there, that might have been interesting
|
Re: Classic WTF: The Forbidden Parameter
2007-07-05 07:40
•
by
pin
|
I think it's a wtf because we don't know >_> |
Re: Classic WTF: The Forbidden Parameter
2007-07-05 12:42
•
by
Dana
(unregistered)
|
|
The real WTF is that there wasn't a comment explaining the cutesy parameter name. Why play games instead of a simple comment inside the function?
Another argument for code reviews. A second pair of eyes would have hopefully kept this out of production. Captcha: kungfu |
Re: Classic WTF: The Forbidden Parameter
2007-07-06 00:08
•
by
Fry-kun
|
Ummm, god *WAS* a crappy coder! Let's see, where to start... Vote for your favorite! (code reuse) 1. pleasure organs coupled with waste management 2. oxygen intake coupled with food/water intake (scalability) 3. Antivirus software without automatic updates?! At least it doesn't slow down the system when there is no active infection... (extensibility) 4. There's no easy way to use any plug-ins (wings, gills...) (maintainability) 5. It's really hard to replace malfunctioning/broken modules (organs) (dead code) 6. Look at all the junk DNA! 7. Garbage collector is not perfect - free radicals accumulate over time?! (happy path) 8. Most (if not all) pleasurable/indulgent activities eventually result in unstable system?! 9. Debugger & source code do not come bundled with the system?! 10. Maximum average uptime of only 70-90 years, highly dependent on external factors?! the list goes on... |
Re: Classic WTF: The Forbidden Parameter
2007-07-06 15:35
•
by
nerdytenor
(unregistered)
|
|
Come on, the real WTF is that nobody can use the call. I'm thinking what they really wanted was:
public object LoadOrg(int cmpKey, object DO_NOT_USE_AT_ALL_EVER_UNLESS_YOU_ARE_AT_LEAST_SENIOR_SOFTWARE_ENGINEER_LEVEL_5); |
Re: Classic WTF: The Forbidden Parameter
2007-07-17 02:08
•
by
Bozo the Engineer
(unregistered)
|
|
Y'know, it *is* legal to use different names for different methods.
|
Re: Classic WTF: The Forbidden Parameter
2007-07-17 02:10
•
by
Bozo the Engineer
(unregistered)
|
...or, you could do what a competent developer would do: change the serialVersionUID and modify the deserializer to recognize and handle both versions. |
Re: Classic WTF: The Forbidden Parameter
2007-07-17 02:12
•
by
Bozo the Engineer
(unregistered)
|
@deprecated? private? protected? package? |
Re: Classic WTF: The Forbidden Parameter
2008-01-13 12:47
•
by
zzo38
(unregistered)
|
I saw some joke somewhere said the junk DNA is actually comments |
Re: Classic WTF: The Forbidden Parameter
2008-11-28 21:49
•
by
855
(unregistered)
|
| « Prev | Page 1 | Next » |