Member Sign In
User ID:
Password:
Remember Me:
Forgot Password?
Not a member?
Click here for more information and to register.

www.justetchjobs.com

 



RSS Feeds

RSSAll

RSSVC++/C++

RSS.NET/C#

RSSVB

See more EarthWeb Network feeds

Recent Entries

Monthly Archives

Internet.com / blogs

Free Tech Newsletters
Free Tech Newsletters
ADO.NET Entity Framework Tutorial and Basics
Discover an ADO.NET Entity Framework tutorial covering basic data operations for applications, including LINQ To Entities, Method Expressions, stored procedure mapping, and a little discussion about its usage in an enterprise environment.

Asynchronous Socket Programming in C#: Part I
This is a simple Client-Server application developed to explain the concept of asynchronous sockets in C#. This extends the socket program to accept multiple clients. Because this example uses Asynchronous methods, threads are not necessary to communicate to multiple clients (though internally the asynchronous communication mechanism uses threads at the OS level).

.NET Web Services Tutorial
Writing .NET Web services without using Visual Studio can be tricky. Learn how to create a Web Service without using Visual Studio .NET.

Free Tech Newsletters
Deploying and Configuring SQL Server Integration Services Packages Without the Wizard
Ever get confused by or dislike using the SQL Server Integration Services deployment wizard? Learn how to manually deploy the packages to SQL Server 2005 and configure the packages in a multitude of ways as well.
Improving Portal Page Load Performance
Portals provide users with access to more applications from a single point of entry, but if it takes too long to get in,, they will go elsewhere. Learn specific techniques to improve page load time and track down what is slowing your pages down.
Handling that Pesky Windows ControlBox
Some things that seem hard are actually quite easy, and some things that seem easy take a little work, like that little [X] on a Windows Form, the ControlBox. Learn how to know just when that little bugger is pressed.
Getting Up and Running with the Composite UI Application Block for WPF
Discover how to build complex Windows Presentation Foundation (WPF) applications with reusability and componentized design in mind by using ready-made patterns.
NEW and IMPROVED: A Lesson in Change Management and Project Management
What is the most effective way to introduce change within a department or organization?

Visual Basic 10 Is One Step Closer to Being C#

| Comments (1) | TrackBacks (0)

This past week, I was given twenty minutes to present at the Indianapolis .NET Developers Association (IndyNDA.org) on some of the new features in the Microsoft programming languages that are coming in the next releases. I was also supposed to talk on some of the stuff coming in Visual Studio "2010." It is interesting to note that although I had twenty minutes that could be stretched to thirty, the same topics were quickly overviewed at the Microsoft PDC over the course of more than five hours. 

 

Needless to say, I left out nearly everything!

 

What I didn't leave out were a couple of the simplest features coming in C# 4 and Visual Basic 10. I'll cover those same features in this and my next few blog entries.

 

One of the items that received the biggest applause for Microsoft was in my Visual Basic 10 demo. With Visual Basic 10, the VB team has spent a lot of effort doing something that seems very simple. Consider the following Visual Basic code:

 

Module Module1

    Sub Main()

        Dim scores() As Integer = {10, 20, 30, 40, _

                                   50, 60, 70, 80, _

                                   90, 100, 3, 4}

        For Each score In scores

            Console.WriteLine("The next number is.... {0}", _

                              score)

        Next

    End Sub

End Module

 

This same code could be formatted in a variety of ways using various spacing. With Visual Basic, however, you've always had to remember to include the space-underscores at the end of each lineto indicate that the code continues to the next.

 

With Visual Basic 10, the need for the line continuation character is no more! In truth, there are instances where you might still need to use them; however, in almost all common coding situations, you don't need them. That means that the following code is now valid Visual Basic 10 code:

 

Module Module1

    Sub Main()

        Dim scores() As Integer = {10, 20, 30, 40,

                                   50, 60, 70, 80,

                                   90, 100, 3, 4}

        For Each score In scores

            Console.WriteLine("The next number is.... {0}",

                              score)

        Next

    End Sub

End Module

 

Now, all you have to do is add a "quote-semicolon" and you are practically writing C#! 

 

Module Module1

    Sub Main()

        Dim scores() As Integer = {10, 20, 30, 40,

                                   50, 60, 70, 80,

                                   90, 100, 3, 4} ';

        For Each score In scores

            Console.WriteLine("The next number is.... {0}",

                              score) ';

        Next ';

    End Sub

End Module

 

0 TrackBacks

Listed below are links to blogs that reference this entry: Visual Basic 10 Is One Step Closer to Being C#.

TrackBack URL for this entry: https://swarm.internet.com/mt-tb.cgi/6080

1 Comments

Now, you can take those underscores and place them at the end of the Scala import statements. :)

Leave a comment