PDA

Click to See Complete Forum and Search --> : VB Shorthand?


Krenshau
Dec 13th, 2007, 03:44 PM
Hello,

Thank you for visiting the forums here. Perhaps, even after the week you might pop in occasionally?

I use Visual Basic 2005 at work a lot because it is verbose and my boss can read and have a basic understanding of what I am doing. However, one of the things I really like about C# is the brevity. For example:

Int? x = null;
Int y = 30;
Int z = x ?? y;

Is there any plans for this kind of ability to be added to Visual Basic? Perhaps, the option to write out the code verbosely, or use a "short hand" way?

Thank you for your answer.

Phill64
Dec 13th, 2007, 04:29 PM
That makes no sense at all,

you said you use VB because it is verbose, then you ask it to not be.. while also pointing out that c# is not verbose thus facilitating your shorthand needs.

So where is the problem? Vb=Readible C#=Short you already have the choice.

Shaggy Hiker
Dec 13th, 2007, 06:13 PM
I kind of like short operators, but I do appreciate the readability of VB, so I'd have to say that I'm pretty much with Phill64 on this one. After all, in C you can write some amazing lines, but reading them is such a CHORE!!

However, the trinary operator would be a nice touch.

Krenshau
Dec 13th, 2007, 08:05 PM
I am saying that I would like the option. In C# you don't have to use the "short hand", but it is available. It is an option. Why not make that an option in VB?

This would be beneficial, to me anyway, when I don't need my boss to understand what I am writing. My boss can't read C# either way, but if this was available in VB, then I could choose when I want to code verbosely, and when I don't. Speed vs. readability. Seems logical to me.

jmcilhinney
Dec 13th, 2007, 08:09 PM
However, the trinary operator would be a nice touch.Doesn't VB 2008 now have an If operator? Don't have it installed here at work but I thought they'd added one.

techgnome
Dec 13th, 2007, 08:55 PM
they did.... if you look at my thread about Lambda Expressions, Beth used the new If operator in one of the examples.

-tg

PaulYuk_MS
Dec 13th, 2007, 11:37 PM
Good to know you like the short operators.

FWIW, we hear a bit more feedback to the other side that users like the readability of the operators and keywords we currently have with VB. Plus, we have to think about the long history we've had with the language. ;)

Krenshau
Dec 14th, 2007, 11:08 AM
I do, a lot. Thank you for your response.

I know I am odd! :lol: