VB Sucks

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

VB Sucks

Postby dandymcgee on Tue May 19, 2015 4:07 pm

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:
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
 
Posts: 4911
Joined: Tue Apr 29, 2008 4:24 pm
Location: New Hampshire

Re: VB Sucks

Postby dandymcgee on Tue May 19, 2015 4:35 pm

Interesting programming language popularity statistics:
http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
 
Posts: 4911
Joined: Tue Apr 29, 2008 4:24 pm
Location: New Hampshire

Re: VB Sucks

Postby Fixxxer on Tue May 19, 2015 6:11 pm

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.. ;)
User avatar
Fixxxer
ES Beta Backer
ES Beta Backer
 
Posts: 26
Joined: Fri Oct 17, 2014 1:13 pm
Location: Deep Forest of Sweden


Return to Programming Discussion

Who is online

Users browsing this forum: No registered users and 3 guests