why vb.net sucks

Someone point out what I’m doing wrong, if anything, here. In my current vb.ignorant state, this seems like pure stupidity to me.

If I define three integers, say x, y and z thusly:

Dim x As Integer
Dim y As Integer
Dim z As Integer

Then I parse two strings (which contain integers) into y and z, thusly:

y = Integer.parse(stringOne)
z = Integer.parse(stringTwo)

Now I need to combine these two values for a specific purpose later on. I’ve already verified with the debugger that these two values are being parsed correctly, so I don’t have to worry about it. I would think that

x = y + z

would be all I ever needed, right? Wrong. With y=13 and z=6, I was getting an x of 136… Whicha-waa? Since when does the + operator concatenate integers? Never, so far as I know.

So, in order for x to really equal y + z, I have to do this:

x = y
x = x + z

::sigh::

vb.net is really great for doing simple windows apps quickly. I don’t need power right now. I would really like to not have to sacrifice correctness at the same time though.

  1. Maybe you forgot a set or let or something like that? I pretty much hate and avoid VB, but I’m aware of issues where stuff gets screwed if you leave out your Set. I think that’s when you’re working with ActiveX/COM objects, though. So I really have no advice for you. Unless you want to switch over to C.

  2. Okay I am just coming onto your site, ah what is this vb stuff anyway?

  3. hehe, Sorry Brooke. Normally I don’t post code on my blog. I’m a computer engineer by trade, so occasionally workplace angst makes it onto the pages here. Just skip over ocassionaly entries like this if they make little or no sense.

    Thanks for stopping by though! (:

  4. I thought you would have learned from the terrors that I had to endure last summer…but apparently my daily torture was lost on you friend. =)

    Mikey

  5. Well, he did want that whole while-else construct thing. And he continued to fight you in the hallway for three years. Given these two pieces of information…

    🙂

  6. I don’t even remember why a while-else construct would have been useful to me. As for hall-wrestling, well, you might have a point there. (:

  7. VB.net sucks. Everytime I go to a asp.net page to learn stuff, it’s vb, not c#. vb sucks like shit.

  8. Wow. Some major angst going on with that one!

  9. “VB.net sucks. Everytime I go to a asp.net page to learn stuff, it’s vb, not c#. vb sucks like shit.” VB.net/C# can be translated to/from each other easily. I’ve done it when a client wants something done in C#, and I don’t know how to do something and the source is in VB. It’s real simple to change around.

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>