Future of VB.NET? [closed]
- by Alex Yeung
Hi all,
I worked with C# for years. Last year, I changed my job and the company use VB.NET. Of course, theoretically C# and VB.NET are very similar and I easily adapted. However, I have worked for VB.NET for 1 year. I cannot see any future of VB.NET. As a programming language, it is so foo.
Here is a list of what C# can do but VB.NET cannot
Case insensitive variables
how to think a new variable name? If I have a property called FolderPath, i need to establish another private variable called _folderPath or m_folderPath. In C#, FolderPath and folderPath are two variables.
Moreover, it gets compile error if variable name is same as a class name. For example Dim guid = Guid.NewGuid(). (What the...) Again, I need to think a new variable name.
Adhoc scope
In C#, we could use {...} to create a adhoc scope and all resource in {...} will not affect the code outside. However there is not such syntax in VB.NET. I could only use If True Then and End If to make a local scope which is so unclear.
In-Method Region
Sometime, it is unavoidable to have a long long method. VB.NET does not support in-method region. I always need to scroll down for 1000 lines. It wastes my time.
No multi-line string definition
In C#, we could var s = @"..." to define a multi-line string. In VB.NET there is no direct method to do that. The indirect way is use XML-literal string. Dim s = <![CDATA[...]]>.Value. However it is unclear.
No block comment
In C#, we have line comment // and block comment /* ... */. However in VB.NET we only have line comment which is a very big trouble for me.
No statement end symbol
Statements are separated by line break in VB.NET; while statements are separated by ; in C#.
Underscore
I think many people know underscore _ is continue statement symbol. I really disagree with that. I know MS VB.NET language team is going to remove the underscore syntax from VB.NET. However what can we do now? Although underscore is removed in the future, what's the advantage of that? I cannot see any advantage!
With scope
With scope is an evil scope. Although it allows shorter statement, it is hard to trace.
Default Namesapce in project level
It is a nightmare for me.
The only advantage of VB.NET is property initialization. I think C# cannot do that (correct me if I am wrong.)
Public Property ThisIsMyProperty As String = "MyValue"
Remarks: I don't think optional method parameters is an advantage of OOP.
By those disadvantages, I cannot see the future of VB.NET.
Anyone sees the future of VB.NET?