Welcome to the Lounge
The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
You wouldn't be asking me this is you saw the VB code I had to work with
Jörgen Andersson wrote:And what's the problem with that?
I used to love VB.NET, even after I started doing C#.
But after years of doing C# I now have to use it again and it's just lagging behind in pretty much everything.
The fact that Option Strict is off by default (causing much of my current problems) makes it bad by default.
Function As Object (or worse, just
Function without an
As clause because that's optional without Option Strict) feels weird.
The default indentation in Visual Studio sucks.
If something AndAlso
End IfKeywords like
OrElse are unnecessarily long.
Don't even get me started on lambda's!
collection.Where(Function(x) x.Something) vs.
collection.Where(x => x.Something)!
Meanwhile, shortcuts like inline ref variables don't make it to VB.
Because it's not case sensitive
MyVar are the same, meaning I sometimes need to think just a bit harder to name my variables.
Static classes don't exist, you need a
Module, but that's slightly different (in that functions become public without the need of using the class name) making a
Private Class with
Private Sub New() the closest to a static class.
And please don't use the default VB namespace
Modules that are imported by default!
If I'm honest, I've never seen good VB code that I didn't write myself, while I've seen some good C# code.
Microsoft is quickly dropping support for new platforms and VB.
It's only just been added to .NET Core with version 3, together with WinForms support.
Try finding (good) code samples for VB online.
Even newer Visual Studio functionality, like code cleanup, is not available for VB.
All in all, I have no reason whatsoever (or even a choice) to use VB in any modern software development.
Let me end with a small positive note for the language I started in.
One thing VB does right (in WinForms development) is
Sub MyButton_Click(sender As Object, e As EventArgs) Handles MyButton.Click, which I find more clear than the C# way of adding a handler in the designer.
General News Suggestion Question Bug Answer Joke Praise Rant Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.