Comment On Function Batman() (Again)

With the year-end holidays and vacations, I've noticed there's a lot less blog reading going on. In that spirit, I'm thinking of posting some repeats that most of you (according to the stats, atleast) have not seen before. So without further ado, here is post #5: [expand full text]
« PrevPage 1Next »

Re: Function Batman() (Again)

2004-12-22 15:03 • by
I was thinking more along the lines of:



Function Catwoman ( strHalleBerry )

Re: Function Batman() (Again)

2004-12-22 15:32 • by Scott
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(!elem.attributes['noHack'])
elem.onchange=funkify(elem.onchange);
...

Re: Function Batman() (Again)

2004-12-22 15:42 • by
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.');

Re: Function Batman() (Again)

2004-12-22 15:48 • by Maurits
26978 in reply to 26977
This line is a WTF in itself, unless I'm way off base..


If IsNull(strFileName) Then If Len(strFileName) < 1 Then Exit Function

Re: Function Batman() (Again)

2004-12-22 15:53 • by
Batman() is an indentity function. A secret identity function.



The true function's name is BruceWayne().



Get it??? Please tell me somebody got it.

I am the Bat Man!

2004-12-22 15:54 • by Jeremy Morton
26980 in reply to 26978

Maurits:
This line is a WTF in itself, unless I'm way off base..
If IsNull(strFileName) Then If Len(strFileName) < 1 Then Exit Function


You are correct.  It's at least overly redundant.  If not moreso.

Re: Function Batman() (Again)

2004-12-22 16:00 • by
26981 in reply to 26978
Maurits:
This line is a WTF in itself, unless I'm way off base..


If IsNull(strFileName) Then If Len(strFileName) < 1 Then Exit Function





haha clowned  

I am... BatManuel!

2004-12-22 16:02 • by Jeremy Morton
26982 in reply to 26980

// always save twice, if you know what I mean
BatManuel().Save();
BatManuel().Save();

Okay, I'm done with my jokes...

Re: Function Batman() (Again)

2004-12-22 16:16 • by zinglons_ale
26983 in reply to 26976
Scott:
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(!elem.attributes['noHack'])
elem.onchange=funkify(elem.onchange);
...



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.



Re: Function Batman() (Again)

2004-12-22 16:29 • by skicow
26984 in reply to 26976
Scott:
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(!elem.attributes['noHack'])
elem.onchange=funkify(elem.onchange);
...


 


[: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.

Re: Function Batman() (Again)

2004-12-22 17:10 • by Bustaz Kool
26985 in reply to 26975

:
I was thinking more along the lines of:

Function Catwoman ( strHalleBerry )


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...[:$]

Re: Function Batman() (Again)

2004-12-22 18:36 • by

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()

Re: Function Batman() (Again)

2004-12-22 18:40 • by
26991 in reply to 26990
:

You could have called this thread 'Batman() returns'



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.

Re: Function Batman() (Again)

2004-12-22 18:58 • by Unforgiven
26992 in reply to 26991

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.

Re: Function Batman() (Again)

2004-12-22 19:45 • by
26994 in reply to 26992
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.)

Re: Function Batman() (Again)

2004-12-23 03:37 • by ProffK
26996 in reply to 26992
Yes, but it still supports the older as well, adding to the confusion that is VB.NET.

Re: Function Batman() (Again)

2004-12-23 06:42 • by
26999 in reply to 26992
Unforgiven:


Thank god VB.NET also supports more conventional return syntax.





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!

Re: Function Batman() (Again)

2005-01-04 17:19 • by
My Hero

Re: Function Batman() (Again)

2005-01-07 07:17 • by
Batman, who cares? But inserting values into a database without using bind variables, how 1990.

Re: Function Batman() (Again)

2005-01-12 06:01 • by
27726 in reply to 26994
In fact, in VB, if a function does not have a return type, it gets defaulted to Variant.

Re: Function Batman() (Again)

2005-01-12 11:26 • by Drak

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 [:)]

« PrevPage 1Next »

Add Comment