VB Shorthand?-VBForums
Results 1 to 8 of 8

Thread: VB Shorthand?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2005
    Location
    Indiana
    Posts
    451

    Question VB Shorthand?

    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:

    Code:
    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.
    Ben


    Using Visual Basic 2005/2008
    Share on Google+

  2. #2
    Frenzied Member Phill64's Avatar
    Join Date
    Jul 2005
    Location
    Queensland, Australia
    Posts
    1,201

    Re: VB Shorthand?

    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.
    Share on Google+

  3. #3
    Loquacious User Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    23,884

    Re: VB Shorthand?

    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.
    My usual boring signature: Nothing
    Share on Google+

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2005
    Location
    Indiana
    Posts
    451

    Re: VB Shorthand?

    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.
    Ben


    Using Visual Basic 2005/2008
    Share on Google+

  5. #5
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    87,342

    Re: VB Shorthand?

    Quote Originally Posted by Shaggy Hiker
    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.

    2007-2014

    Why is my data not saved to my database? | MSDN Data Walkthroughs
    MSDN "How Do I?" Videos: VB | C#
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts) | WP8 Turnstile Feather Transition with Pivot Control
    Beginner Tutorials: VB | C# | SQL
    Share on Google+

  6. #6
    PowerPoster
    Join Date
    May 2002
    Posts
    24,789

    Re: VB Shorthand?

    they did.... if you look at my thread about Lambda Expressions, Beth used the new If operator in one of the examples.

    -tg
    Last edited by techgnome; Dec 13th, 2007 at 07:55 PM. Reason: It's expressions, not equasions
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *
    Share on Google+

  7. #7
    Special Guest - Microsoft
    Join Date
    Dec 2007
    Posts
    36

    Re: VB Shorthand?

    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.
    Paul Yuknewicz
    Lead Program Manager
    Microsoft Visual Basic
    http://msdn.com/vbasic
    Share on Google+

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2005
    Location
    Indiana
    Posts
    451

    Re: VB Shorthand?

    I do, a lot. Thank you for your response.

    I know I am odd!
    Ben


    Using Visual Basic 2005/2008
    Share on Google+

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.