- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
I was thinking more along the lines of:
<font color="#0000ff">Function</font> <font color="#a52a2a">Catwoman ( strHalleBerry )
</font>
Admin
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.
Admin
<font face="Courier New" size="2">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.');</font>
Admin
This line is a WTF in itself, unless I'm way off base..
<font face="Courier New">If IsNull(strFileName) Then If Len(strFileName) < 1 Then Exit Function</font>
Admin
Batman() is an indentity function. A secret identity function.
The true function's name is BruceWayne().
Get it??? Please tell me somebody got it.
Admin
You are correct. It's at least overly redundant. If not moreso.
Admin
haha clowned
Admin
// always save twice, if you know what I mean
</DIR></FONT>BatManuel().Save();
BatManuel().Save();
Okay, I'm done with my jokes...
Admin
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.
Admin
[: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.
Admin
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...[:$]
Admin
You could have called this thread 'Batman() returns'
<FONT style="BACKGROUND-COLOR: #efefef"></FONT>
<FONT style="BACKGROUND-COLOR: #efefef">I wonder if this code would run on Linux, or if it would take issue with the Penguin()</FONT>
Admin
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.
Admin
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.
Admin
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.)
Admin
Yes, but it still supports the older as well, adding to the confusion that is VB.NET.
Admin
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!
Admin
My Hero
Admin
Batman, who cares? But inserting values into a database without using bind variables, how 1990.
Admin
In fact, in VB, if a function does not have a return type, it gets defaulted to Variant.
Admin
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 [:)]