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

Post Reply
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

VB Sucks

Post 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:
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: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: VB Sucks

Post by dandymcgee »

Interesting programming language popularity statistics:
http://www.tiobe.com/index.php/content/ ... 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
Fixxxer
ES Beta Backer
ES Beta Backer
Posts: 26
Joined: Fri Oct 17, 2014 12:13 pm
Current Project: Learning DC dev
Favorite Gaming Platforms: SNES, Dreamcast, N64
Programming Language of Choice: C++
Location: Deep Forest of Sweden

Re: VB Sucks

Post 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.. ;)
Post Reply