| « Prev | Page 1 | Next » |
|
I was thinking more along the lines of:
Function Catwoman ( strHalleBerry ) |
|
The original post of this code inspired my co-worker to name a function
of his batman. Yes, it's acutally used in production. Observe the beautiful snippet. function Batman() {
|
|
if (!$handle = @fopen($config[file], "r"))
die('I know a life of crime led me to this sorry fate... but I believe society made me do it.'); |
|
This line is a WTF in itself, unless I'm way off base..
If IsNull(strFileName) Then If Len(strFileName) < 1 Then Exit Function |
|
Batman() is an indentity function. A secret identity function.
The true function's name is BruceWayne(). Get it??? Please tell me somebody got it. |
You are correct. It's at least overly redundant. If not moreso. |
haha clowned |
|
// always save twice, if you know what I mean |
Re: Function Batman() (Again)
2004-12-22 16:16
•
by
zinglons_ale
|
And I couldn't resist doing it again with a couple of internal functions: [code language="c#"] public void Batman(string s, string batmobile) public void Robin(string s, int i, string batmobile) [/code] Yes, the daily WTF has truly inspired me. And that's just scary and wrong. |
[:D] That's funny - I say that because I don't have to debug his code[:P] I think, as a white-male-geek, that the 'funkify' method could help me with the ladies. |
And what do you intend to do with this string? Scan it?[8-|] Parse it?[;)] Invert it?[:P] Careful that you don't overflow your buffer...[:$] |
|
You could have called this thread 'Batman() returns'
I wonder if this code would run on Linux, or if it would take issue with the Penguin() |
Actually, now that I look at it more closely, I see that Batman() doesn't return anything. Unless I just don't know that language well enough. |
|
It does return someting. In VBScript (as well as normal VB), you return a value by assigning to the function name. Hence Batman = False makes the function return false (note that it doesn't end the function). Thank god VB.NET also supports more conventional return syntax. |
|
Aah yes, I see now that it's VBScript rather than VB... I was looking for an 'As SomethingOrOther' after 'function Batman()' and when I didn't see that, thought that perhaps a Function really is just a Sub when it doesn't say what sort of object it's returning. But of course As doesn't even work in VBScript so it's no wonder that it isn't there. (I haven't written much VB or VBScript, so I don't know if the 'As SomethingOrOther' is required in VB, but I know I had to remove them to port the code to VBScript.)
|
|
Yes, but it still supports the older as well, adding to the confusion that is VB.NET.
|
Amen to that! I've been programming in VB for a few years now, and we moved to .NET a few months ago, Return makes WAY more sence! |
|
Batman, who cares? But inserting values into a database without using bind variables, how 1990.
|
|
In fact, in VB, if a function does not have a return type, it gets defaulted to Variant.
|
|
Ah, I remember the times when I used silly function names: void ReturnSomeThings(); and void ReturnNearlyAllThings(); Gladly that was a personal project, and never had to be handed over to anyone [:)] |
| « Prev | Page 1 | Next » |