News for hackers. Stuff that matters.
Re:The .NET Language Strategy by Pica_soO on Wednesday February 01, 2017 @04:49PM (#13545628)
Its not for backwards compatibility, is for beginner friendliness of a eco-system. If one had a stroke and lost all knowledge on comp-science- what would you be more likely to drop for overwhelming complexity and missing instant results? C# or VB?
Re:The .NET Language Strategy by wvenable on Wednesday February 01, 2017 @05:07PM (#13545842)
For a language that has both "And" and "AndAlso" as keywords; I don't think VB.NET should be considered the paragon of beginners languages.

It might have "Basic" in it's name but the complexity of smashing old-school VB syntax and semantics with .NET syntax and semantics has not made for a very beginner friendly language. It's more complex than C# (excluding some of the newest C# features). It's just painted over with a more English syntax to appear beginner friendly.

Re:The .NET Language Strategy by cm2187 on Wednesday February 01, 2017 @07:32PM (#13546920)
How is it far more complex than C#? Both have been designed at about the same time and VB.net has broken backward compatibility precisely to get rid of legacy design decisions. But both have evolved since. And yes you can use a generic and non generic version of a class. Yes you have old style async and new async/await versions of methods. Yes you have explicit typing vs type inference with two ways to do the same thing. And yes you can use lync as an expression or as chained functions. How is that different from C#? Both have evolved pretty much side by side and have as much legacy.

The one thing in my opinion that has been preserved from VB6 and is dangerous as ambiguous semantically is the following:

  Dim x as Integer
Means declare a variable x and instantiate it to zero

  For i = 1 to 10
    Dim x as integer
    x += 1
  Next
The second line means declare x as integer but only instantiate it to zero the first iteration, the second iteration the instruction will be ignored.

That to me is unintuitive.

Re:The .NET Language Strategy by wvenable on Wednesday February 01, 2017 @08:01PM (#13547112)
> How is it far more complex than C#?

Basically you answered your own question. VB.NET has all the same features as C#, evolved over the same time, but VB.NET has a bunch of additional "crap" held over from a language and environment that it isn't compatible with anymore. That's how it's more complex.

You didn't even consider in your example that you declare variables with the keyword "Dim". Do you even know why? It's meaning has almost been lost to history and makes little sense for what it's used for now.

Re:The .NET Language Strategy by cm2187 on Thursday February 02, 2017 @01:55AM (#13548669)
How is "Dim" worse than "var"???

In fact even before type inference I always thought that Dim was a better idea. It was kind of absurd to be forced to write your type twice.

  Dim D as New Dictionary(Of String, String)
vs

  Dictionary<string, string> D = new Dictionary<string, string>();
Re:The .NET Language Strategy by wvenable on Thursday February 02, 2017 @02:32AM (#13548803)
> How is "Dim" worse than "var"???

Var means variable.

In VB6/VBA, the Dim New syntax actually had different semantics; it would create the instance on first access instead of when the Dim statement was executed. It also had the fun side-effect that setting the variable to Nothing would destroy the instance but anytime you accessed that variable it would just create a new one. Irrelevant now, I guess, but still a nice bit of trivia.

Re:The .NET Language Strategy by WayneBro on Thursday February 02, 2017 @10:33AM (#13551171)
You don't write your type twice in C# either. So, the second example would be:

    var d = new Dictionary<string, string>();
`Dim` is worse than `var` because nobody uses the word "Dimension" when they're talking about variables.
Re:The .NET Language Strategy by cm2187 on Thursday February 02, 2017 @11:32AM (#13551789)
As I said, var was introduced with type inference. Before type inference you had to declare it twice, which you never had to do in VB, even in VB6.
Re:The .NET Language Strategy by WayneBro on Thursday February 02, 2017 @01:38PM (#13553150)
Right, but it was introduced to C# over 8 years ago so it's a bit of a moot point, wouldn't you say?

`Dim`, a poorly worded keyword by today's standards, is a perfect example of the kind of leftover crap that C# doesn't have today that VB still does have.

Re:The .NET Language Strategy by smoothdeveloper on Thursday February 02, 2017 @02:15PM (#13553547)
Try defining an instance member with var in C#
Re:The .NET Language Strategy by sokoloff on Wednesday February 01, 2017 @05:09PM (#13545855)
I laughed as I read your comment (not the way you intended).

"Try VB.Net, the perfect language choice for stroke victims."

Re:The .NET Language Strategy by arwhatever on Wednesday February 01, 2017 @06:33PM (#13546539)
I must admit that many VB.NET keywords more closely represent their respective concepts than C# does, but having far more C# experience, those VB.NET keywords initially strike me as seeming like baby-talk.
Re:The .NET Language Strategy by maxxxxx on Wednesday February 01, 2017 @05:07PM (#13545835)
I think VB6 and VB.NET are totally different beasts. VB6 is maybe a good language for beginners but VB.NET is just a weird language in my view. C# is a much more natural fit for the .NET runtime.