News for hackers. Stuff that matters.
Re:The .NET Language Strategy by AnthonyDGreen on Wednesday February 01, 2017 @06:02PM (#13546300)
It never was and never will be identical to C#. They share a lot but there are hundreds if not thousands of subtle differences between the two. It's just easier for people to 'think' that VB is just C# with a search and replace because... that's a lot shorter to say. If you were to look at the compilers themselves or try to write a perfect automatic conversion tool you'll quickly see that far from identical.

For example, VB Select Case and C# switch work nothing like each other.

Re:The .NET Language Strategy by jug on Wednesday February 01, 2017 @06:52PM (#13546666)
Yes, they have a pretty dissimilar philosophy. XML Literals, different event handling/wiring, no need for event delegates, inline date declarations, explicit integer division operator, the Module concept, the My namespace, etc.
Re:The .NET Language Strategy by josteink on Thursday February 02, 2017 @03:19AM (#13548982)
> If you were to look at the compilers themselves or try to write a perfect automatic conversion tool you'll quickly see that far from identical.

There's so much truth in this.

Telerik has a online conversion tool[1] you can us, which can batch convert entire code-bases. But a 1-to-1 straight conversion cannot be done with 100% accuracy, and the tool will tell you everywhere it struggles to figure out the right C# equivalent for the corresponding VB.Net code.

I've used this tool in the past to "eliminate" the last remnants of VB-code in our organization. And when you do a job like that, on that scale, you definitely notice the differences.

A quick list of things you can expect to cause troubles (from memory and may not be 100% accurate):

- The difference in VB global/C# static semantics.

- The (default & overuse) of late-binding in a typical VB codebase. (While that wasn't an option for me back then, this can now be overcome by using "dynamic" everywhere, but that's hardly idiomatic C#)

- VB Modules can cause issues.

- For a full conversion, you'll typically have to rewrite all code using the functions and operands only found in the Microsoft.VisualBasic namespace. Not all these have straight up C#/BCL replacements.

Etc etc.

For being superficially so similar, a conversion job is actually much more work than you would typically imagine.

[1] http://converter.telerik.com/

Re:The .NET Language Strategy by averagewall on Thursday February 02, 2017 @07:01AM (#13549906)
Isn't Microsfot.VisualBasic just as much part of C# as it is VB or any other .Net language?

The rest of your points all sound like bad practice anyway so hopefully people are already avoiding them.

Re:The .NET Language Strategy by josteink on Thursday February 02, 2017 @01:15PM (#13552917)
> The rest of your points all sound like bad practice anyway so hopefully people are already avoiding them.

Welcome to the real world. I can tell you're new here :)

Re:The .NET Language Strategy by cm2187 on Wednesday February 01, 2017 @06:11PM (#13546378)
And until VS2013 the IDE was nothing like either. I think with VS2015 both have mostly converged but I must say it is a bit of a regression for the VB IDE.
Re:The .NET Language Strategy by MichaelGG on Wednesday February 01, 2017 @06:33PM (#13546541)
Hundreds or thousands of differences? Do you have a citation for that?
Re:The .NET Language Strategy by cm2187 on Wednesday February 01, 2017 @06:38PM (#13546563)
He is the program manager for VB...
Re:The .NET Language Strategy by MichaelGG on Wednesday February 01, 2017 @09:39PM (#13547617)
While I was/am a bit incredulous at the number I was hoping for some sort of list or summary. Just sounds like a lot.
Re:The .NET Language Strategy by Locke1689 on Thursday February 02, 2017 @03:31PM (#13554358)
Read the source for the compiler and find all the differences. There are constantly minor semantic changes, like numeric conversions, double parsing, scope of generated temps in for loops, delegate conversions, Nothing, etc.

I just started typing this list off the top of my head and every time I typed something out I could think of one more thing. And these are just the ones I remember, so they're probably the ones that were annoying to work around in the compiler.

Re:The .NET Language Strategy by wuzzard on Wednesday February 01, 2017 @06:54PM (#13546677)
Even so... with numbers like that we need proof!