Page 1 of 1

VB Sucks

Posted: Tue May 19, 2015 3:07 pm
by dandymcgee
I mean, duh. But seriously!?
If If(str, "").Contains("html") Then
    /* .. */
End If
C# Equivalent
if (str ?? "").Contains("html") {
    /* .. */
}
Note: This is the null coalesce operator. It is syntactic sugar for a null check (see below).

C++ Equivalent
if (str != NULL && strstr(str, "html") != NULL) {
    /* .. */
}
On the bright (slightly less pitch black) side, at least I didn't have to type the "Nothing" keyword. :roll:

Re: VB Sucks

Posted: Tue May 19, 2015 3:35 pm
by dandymcgee
Interesting programming language popularity statistics:
http://www.tiobe.com/index.php/content/ ... index.html

Re: VB Sucks

Posted: Tue May 19, 2015 5:11 pm
by Fixxxer
dandymcgee wrote:I mean, duh. But seriously!?
If If(str, "").Contains("html") Then
    /* .. */
End If
C# Equivalent
if (str ?? "").Contains("html") {
    /* .. */
}
Note: This is the null coalesce operator. It is syntactic sugar for a null check (see below).

C++ Equivalent
if (str != NULL && strstr(str, "html") != NULL) {
    /* .. */
}
On the bright (slightly less pitch black) side, at least I didn't have to type the "Nothing" keyword. :roll:
Yeah VB is total shit.. ;)