I just wrote my first ASP:
Wow, just found out something as well… about how conditional statements are
calculated. The entire statement is looked at. In perl, if the
variable $foo is an undeclared variable, the code
if( defined $foo or $foo eq "bar") will first evaluate $foo and see
it is undefined, and return TRUE to the condition. The second part of the if,
or $foo eq "bar" will never be looked at, and if it was, it would fail,
as $foo doesn’t exist.
Apparently VB will evaluate the complete statement, so if the variable
foo is empty (“”), the following code will produce an error: If
isNull(foo) or foo = "something" Then because foo is an invalid data type
to compare against.
Or so I’m told anyway, I personally don’t think any language could look so much
like it was created by a bunch of brain dead monkeys.
Update: This isn’t the case. The code:
If foo = "" or foo = "crap" Then
Response.Write("foo is null")
Produces “foo is null” on the screen. So much for bashing for that. I’m sure
I’ll find other crack-monkeyness though!