| « Prev | Page 1 | Next » |
|
Batman() makes perfect sense to me!
|
|
Oh No! Inline SQL ! Are you sure an inexperienced maintenance programmer didn't write that?
;-) |
|
I've seen a function named 'sh*t()' (autocensored) - and there was even a comment:
// Function does a sh*t private void sh*t() { [...] } Sorry, no screenshot :( |
|
Well WTF are you doing testing a string for less than -1 when you just found out it is NULL?
I mean: If IsNull(strFileName) Then If Len(strFileName) < -1 Then Exit Function Have you ever tested this function with a null string? Or am I having a senior moment here or something? WTF do you expect to happen if strFileName is null? |
|
Jim,
<pedant mode> The code is checking the Len against 1 rather than -1. </pedant mode> Obviously, if strFileName was ever Null (*) then the Len call will raise error 94 - Invalid Use of Null (since Null does not have a length by definition). * Note to C programmers if they feel inclined to disagree - VB's Null is different to C's NULL. VB's Null has nothing whatsoever to do with strings (ie VB 6's Null is different to C's idea of a 'null string'). Seeya Matthew |
|
My point exactly. The purpose of the test is to exit the function gracefully if a null or empty string is passed, or if an empty one is passed. As written, it will not do that, all it will do is throw an error. Great teaching tool. Not.
|
|
My guess is he saw that isnull is a good way to catch a bad input, and he saw that testing for len 0 (or is he expecting a negative string length?) is another good way to catch them... so why not COMBINE them for maximum usefulness and efficiency? Hey, there's an idea! =D
|
|
I also like the way he declares a variable for the name of a table and then doesn't bother using it, genuis!
|
|
$myhtmltemplate = <<< Myubberprogrammerwashere
(html here) Myubberprogrammerwashere; Hey, it's perfectly valid HEREDOC format! What's so wrong with it? :P |
|
Of course you could also have gone with :
dim thelights etc. |
|
It's perfectly obvious why this function is named this way. It's so you can write brilliant code like:
If TheRiddler.HasEscaped Then Call Batman() Makes perfect sense to me. |
Re: Function Batman()
2007-07-12 06:52
•
by
Anon Joe
(unregistered)
|
|
Well, actually he does use it, genius!
|
|
Oh no! I just read that
Batman = False What will happen to Gotham now? |
| « Prev | Page 1 | Next » |