Login or Sign Up to become a member!

EXPERTS, INFORMATION, IDEAS & KNOWLEDGE

Social bookmarker Add this

Your profile

Search

January 2009
Mon Tue Wed Thu Fri Sat Sun
 << <   > >>
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  

XML Feeds

Authors

« .NET Framework 4 Poster In PDF and DeepZoom FormatsThe new features in C# 4.0 »
The Desktop Developers Journal

New features in Visual Basic 10

by chrissie1


Permalink 30 Oct 2008 05:55 , Categories: Microsoft Technologies Tags: happy, vb.net

YEEEEEEEEEEEEHA :D the spelling checker didn’t like that one), here are some of the new features in VB 10.
And yes, I did sound happy there, because some of these features are really not optional but much needed. Like the multi-line lambda and the sub lambda.

You can find the whole video on Channel9

Multi-line lambdas will look like this

  1. myfunction.lambdathing(Function(e) e.dosomething
  2.                                    e.dosomethingelse
  3.                        End Function)

Or like this

  1. myfunction.lambdathing(Sub() dosomething
  2.                              dosomethingelse
  3.                        End Sub)

Now this will also be possible. And I’m very happy about that.

  1. myfunction.lambdathing(Sub() dosomething)

They will also support auto properties and collection initializers, neither of which I really needed.

I’m so happy, I think I will stick with VB for a while. Although all the catching up to C# thing is annoying. I just hope it doesn’t become a VS 2011 or later version. Let’s make it a VS 2010 that came out in 2009 version shall we?

And here is some other stuff that should be possible.

  1. Private Sub SomeMethod()
  2.      Dim _counter as Integer = 1
  3.      AddHandler Button1.Click, Sub()
  4.                                       _counter += 1
  5.                                       TextBox1.text = _counter
  6.                                   End Sub
  1. Private Sub SomeMethodRunningInAnotherThread()
  2.      Me.Dispatcher.Invoke(Normal, Sub()
  3.                                       ‘Do some other stuff
  4.                                       SomeTextBox.Text = "Test"
  5.                                   End Sub)
  6.  End Sub

Info found after some random surfing on StackOverflow

4 comments »Send a trackback » 341 views

Trackback address for this post

Trackback URL (right click and copy shortcut/link location)

4 comments

Comment from: ThatRickGuy [Member] Email
***--
Single line properties = good
simple Parallelization method = good
inferred types = dumb
reintroduction of the varient = emotionally upsetting.

I like that they are trying to reduce code, but some of that crap is a combination of bad ideas and maintenance nightmares.

-Rick
30/10/08 @ 07:48
Comment from: AlexCuse [Member] Email
****-
"reintroduction of the varient = emotionally upsetting."

Totally
30/10/08 @ 08:30
Comment from: David Nelson [Visitor] · http://www.commongenius.com
No one is reintroducing Variant. Variant has no type; the new VB features are about inferring types instead of having to explicitly (and often redundantly) state them. But the types are still there.
21/11/08 @ 14:58
Comment from: Thanigainathan.S [Visitor] Email · http://thaniguy.blogspot.com
****-
Hi ,

Thia article is really nice. Thanks for sharing such a nice thing about VB.NET.

Thanks
22/11/08 @ 05:11

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.
PoorExcellent
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)