The chronic suffering of the VB.NET community
anthonydgreen.net
anthonydgreen.net
Given how big C# ended up becoming, I'm wondering why anyone committed to staying in the .NET ecosystem would have stuck with VB.NET all this time. What's the attraction? I could see it as a transitional stage to get classic VB developers started on the road to C#, but as a long-term solution it seemed doomed to chronic suffering from birth.
I've seen several moderately large and active projects (5+ developer maintenance team) still surviving to this day, running on VB.Net. In most cases though, these were started in the mid-2000s, simply due to manpower questions, not language advantages. I recall being moderately surprised even circa 2008 that the author of CSLA.Net (an interesting object-oriented framework) was mostly using VB.Net. I guess from their point of view, they were more proficient in that languages, and the cost of switching was too high. I definitely don't see any rationale for benefits, akin to say F# vs C#.
I think the MS world of the time was very much a monoculture (and would be until circa 2010 or so), which lead to a lot of developers who had only ever really worked in one main language (plus maybe SQL / T-SQL). I tend to think this is quite similar to children growing up in a single-language vs multi-language environment. The patterns tend to get ingrained in your brain in the former, and there are few signals for our brain to understand that "this concept can actually vary from language to language, don't get too used to it", making later shifts much more difficult. It's kind of a case of over-fitting the data, which is the first language they learned, in this case. I think a lot of the VB and then VB.Net developers had this kind of strong mono-culture of language, which compounded the need to keep VB.Net alive for longer. This may have been further compounded by VB's image as a beginner-friendly language, which a lot of people took up to get into the industry as outsiders, without any formal or informal experience. I really do think this might be the main factor. VB.Net may have had a few tiny advantages in terms of semantics (slightly looser casting and conversion rules), syntax clarity ("static" vs "Shared" - an example of a keyword which is objectively clearer in VB, IMHO), or some convenience libraries (I recall occasionally having to reference core .VisualBasic assemblies to get hold of some helper method which was missing on the C# side, for no apparent reason). But it also had just as many detractors, and I would not think any of these were nearly enough to lead to people choosing it over C#.
I don't really feel any pain switching between them, apart from VB.net is a bit annoyingly verbose and I always forget how to do linq lambda functions in it.
One tip I would add is that you can change the colour of the matching {} when you're in a block scope. VS actually highlights the opening and closing of the block. Usually not much of a problem due to auto-indenting, it can help a lot with complex code.
For some idiotic reason the default is a very light grey, but if you make it darker or a different colour, picking out ending } or starting { becomes trivial.
Ada is a lot like this too. I can read, compile and run it in my head during a gerrit review with almost no glitch by now. Written once, read 20 times at least.
There was some talk on HN yesterday about making your code easily changeable. First step is to make it easily readable, understandable. Little things help. End loop helps. Exit loop_name helps. Non-fallthrough case statement help. in / out / in out help so much. Pre and post conditions help also. Clear static types help. Internal functions help. Explicit generic instantiation, while a pita to write, helps a lot at code read time... Lots of lead bullets.
As a simple example you can write an if block with `if...end`, and this will be automatically rewritten as `if...end if`.
I wish every language had built-formatting and also made the reading/writing distinction!
Are you the author of the fish shell, bychance?
(I'm a fish user. If you are, I'm super-thankful for fish!)
In C-style syntax there's often disagreement on how to format blocks, but there's rarely a disagreement in VB: there's naturally only one choice.
Maybe take the best of VB and Pascal, clean up the key-words by tossing legacy inconsistencies, and produce a next generation "word-oriented" style. #MVBGA!
Personally, I think every balanced marker (parenthesis, block beginning/termination, brackets) adds a maintainabiliy cost and is better replaced by some unbalanced alternative (on the case of blocks, semantic whitespace is the current winner). The largest the thing inside the markers, the higher the cost.
In C# the end to an if and a try both look the same. In VB they don't.
As for the complaints of something being verbose, I see people constantly adding comments to close braces to indicate what it was they closed.
And, for whatever it's worth, it can encourage people to not inline which probably would be more maintainable anyway.
> As for the complaints of something being verbose, I see people constantly adding comments to close braces to indicate what it was they closed.
Lazy commenting. If you are for some reason dealing with code complex enough to need to keep track of it like that, instead take the time to comment what's happening next as a way to help the reader infer.
Because, let's face it, if it's complex enough to need to track those things, there's a decent chance it's worth leaving some explanations of what it's meant to do.
...lots more code up here...
return result;
}
}
}
return -1;
}
What's that next-to-last "}" for? To find out, I need to scroll way up, and hope the code is properly indented, or use an IDE feature to collapse the block.But with a Pascal-family language, it would be more like this:
...lots more code up here...
return result
End If
End Loop
End While
return -1
End Function
It is more verbose - but its verbosity with a purpose, and it helps me avoid the distracting question "What is ending here?".Whenever people come up with these tiny estimates for how much "effort" things take they ignore the organizational overhead and maintenance costs. For example, when changes are made to the CTS/CLS[0] a lot of time is spent considering how those changes will impact other .Net languages, that's a cost/overhead even without actual work on those languages.
So it might take "3-5 people to keep VB.Net alive" but only if you ignore the man-hours lost in other teams (.Net Framework, Tooling, Libraries, etc) and the people already required to maintain existing VB.Net Support (3-5~). 15-20 people is a more realistic conservative estimate.
Plus the language's popularity is almost gone:
https://trends.google.com/trends/explore?date=all&q=%2Fm%2F0...
[0] https://docs.microsoft.com/en-us/dotnet/standard/common-type...
The F# compiler codebase is smaller than that of the C# compiler, but only in line count. F# code is massively more compact than C#, which is another way of saying that the concepts are dense too. There are some unique aspects of F# - custom metadata format for things not representable in C# or VB but must be carried over across F# projects, type inference and the massive number of rules for typechecking, a core library acting as a de facto replacement for a subset of the .NET libraries, custom IL reader/writer (this predates System.Reflection.Metadata), and many more - that lead to an enormous concept count that is anything but simple. Luckily, the codebase is quite maintainable and despite countless qualms I personally have with how things are organized, it's proven to be an excellent foundation for continually adding new features over the years.
While I don't get to use it nearly as often as I would like, every time I have it's been really fun to play with/use.
One of the nicest things is that I find is that every time I get to play with it, the language is intuitive enough and IDE support is rich enough that I'm never feeling like I've forgotten how to work with it.
I agree that the F# compiler's codebase is much smaller than C# (wc suggests 417k lines for dotnet/roslyn:src/Compilers/CSharp/ vs 190k lines for dotnet/fsharp:src/, which is hopefully all the right files).
But as far as simpler goes, the compiler is quite a bit complicated by having to implement F# in terms of .Net. Enum variants are actually classes inheriting from the class representing the enum, modules are actually classes, core library members being called by different names in F# vs not, the desugaring of computation expressions into state machines, ...
Then there's F#-specific stuff, like the core library, having two different kinds of parsers (#light on and off), two different kinds of generics, quotations, ...
Microsoft should just kill it (aka put it into mature support) and give clear guidance that developers should move on.
If you can learn and understand VB.NET you can learn and understand C#. It’s time to rip the band aid off.
The alternative would be C#.
Full disclosure:
Languages sorted by when I learned them:
- Basic
- Visual Basic
- C
- Assembly
- Java (well, I "learned" that I was hopelessly ineffective with it. Still got a B.)
- Javascript
- Python
- PHP
- AutoHotKey
- Java (actually learned it)
- Perl
- Delphi
- C#
- VB.Net
Reasons:
Once I actually understood the value of a real typed language there's no way I'll go back except for scripting and small one-offs.
I agree about strongly typed languages. I'd never give Python and its strong typing to switch to a scripting language.
Not sure why they went that route, but I've ran into several issues when using REST services and other functionality that would be easy to get done in C#, but are time consuming and painful with VB.NET.
You might be confusing it with VBScript, Microsoft's old vaguely VB-like alternative to JavaScript that was used in Internet Explorer and (I think) classic ASP.
Probably better to just go web-based nowadays though for the instant portability of targeting all of desktop/mobile/tablet all in one go unless you have a reason not to
And back when there was demand for it, VB was among the best tools available to do that job.
OT I remember when VB.Net first came out and some VB6 devs were rather sniffily referring to it as "Visual Fred" due to the lack of resemblance wth VB beyond keywords.
It was obvious from the get go VB was now a second class citizen, and c# was the future...
I had lot of experience with VB6 back in the day but I moved straight to C#.
Every developer should be polyglot. Adapt or die.
But betting your career on a single language is definitely a big bet. And any bettor will tell you one of the key skills is knowing when to cut your losses.
But the way the author of the article put it is just so weird - choosing the word "pure" in all caps - like it's a point of pride, or big part of their identity.
As far as 'bets' go, it's also a bet on oneself. The skills of an 'average' developer between two languages can have notable differences in concepts and requirements. i.e. I'd be a bit curious about an 'Average' C/C++ Developer who couldn't write a linked list (or at least groks them), versus an 'Average' C# or Java developer who may never have to write one in their career.
I'll say that unless you intend to be a hardcore Systems developer or Finance Sector, Javascript is never a bad thing to at least learn enough of to at least pass equality questions on interviews.
The nice thing about learning other languages however is that it may help expose you to patterns you don't normally see in your main language, or may expose you to things that make it easier to understand certain concepts (i.e. doing Javascript sites with KnockoutJS helped me learn better MVVM practices, as well as concepts like observables which I could then use back in C#)
Since then, every VB develooper has had two decades to realize that VB.NET never was a "new VB", but just a C# dialect. It offers zero value over C#, and it's so closely related that anyone who knows VB.NET can pick up C# instead in literally no time at all.
I don't see why the author brings up F#. F# is just as much a second class citizen in the .NET world, but it is a project of a great community and of ms research.
I loved VB .NET XML literals. Less relevant today with JSON all the things, but I did choose VB .NET a few times over C# just because of these guys. Made for amazingly readable (to me) XML wrangling code.
I'll admit, I'd written more than one in C# myself before I discovered FileHelpers.
Also, in many other ways is an incredibly powerful language, which leverage in a vry powerful ecosystem, sadly is kinda left behind without big sponsors.
It’s not like there’s a compatibility issue. Just stop writing it.
I've migrated hundreds of thousands lines of VB to C# in past years.
Or they could re-implement and maintain VB.NET themselves?
Those are their options. You can't just demand that someone provide you a product if they don't want to.
I still use VB.NET for creating quick tooling for either myself or non-technical users. There doesn't appear to be anything else really these days for doing that. The newer options from Microsoft tend to enforce a lot of patterns, which just slow you down, when for small tools you don't really require all that guff.
I hope with an open source .NET compiler it will be possible VB.NET to carry on well beyond Microsoft's culling.
Interop with C# is working fine and as long as don't have to do too much in the VB part of your program, you can just use it as a "library" (which is technically isn't because you should only call C# from VB, not the other way around). The only two disadvantages I know of are restriction to 32-bit and no easy CI/CD support. Maybe also that it doesn't support HiDPI forms and Windows just scales it up but who is really expecting that from a 90s technology?
Wine would probably be easier to setup.
I remember in 2007 or '08 a colleague was assigned to Ericsson, to work on a time reporting "application" made in VBA, contained in a gigantic Excel spreadsheet. I also assisted in some troubleshooting.
It was called Tratten, swedish for "the funnel", and I remember him telling me that when he presented it to some kind of stakeholder board and when said "sometimes, the application gives a 'read error'" and the whole board reverberated "read error?!" amongst themselves ...
At the time we stared (1999), vb seemed like a great choice for desktop apps: It had a ton of built-in controls for building UIs, it was quick and easy to do so, and there were tons of dlls and ocxes we could tap into from a ton of different vendors.
The vb language was also appealing on a larger scale because you could take existing knowledge to other areas of the windows ecosystem: excel\outlook automation, classic asp if you need web stuff, windows automation\administration, and ie scripting.
MSDN was also an incredible learning resource
I attended a few small group sessions with microsoft in the early days of .net and we were planing on migrating ~100k lines based on what we were being shown. It looked awesome.
I managed to get hold of an early beta version and did the obligatory "hello world" and was gut punched. It took a few seconds to load took like 20ish mb of ram.
It seems laughable by today's standards, but in 2000 our target customers were still clinging to win98 and the pc's generally had garbage specs. IT people were livid we were wasting 4mb of their ram to run the vb6 version of our app. We lost sales and spent hours on the phone justifying our ram usage (fun times). A 5x increase in ram was completely unacceptable so we put it on hold in hopes that the release would improve things.
Things didn't improve so we put the plans on hold in hopes that vb7 would get released or they would reduce the runtime requirements.
Then something really strange happened: We almost lost a sale because the IT guy thought we were using .net and he refused to install the .net framework because it "used too much disk". I had to take 2 meetings with this guy and was literally screaming into the "WE DONT FUCKING USE THE .NET FRAMEWORK, DONT FUCKING INSTALL IT, WE DONT USE IT". And this wasn't the only incident. I'd get pulled into calls and would have to talk irate IT guys down from the ledge and assure them that no .net framework was required to run our program.
Today, things are much different, no one cares about using gigs of ram or hundreds of gigs of disk space. But there is a new set of problems trying to explain how a desktop app works to someone who only knows how to admin web apps.
And the .net framework eventually become ubiquitous via windows updates and other, more critical software, starting to require it. But the early days were really, really odd (at least for us and our customers).
We aren't complete luddites though. We do utilize some .net (asp.net\vb.net) on the server side for a few tools. We have a mobile app (xamarin\c#) that has some companion features, raspberry pi (python) for some "smart" displays, Arduino, and have started to look at blazor to the replace the desktop app.
I might still recommend vb6 for a desktop app with the caveat that it is a pain in the ass to install on later versions of windows.
tldr: vb6 mostly just works and is a great tool for desktop apps
Reading your post, I did a search for vb6 to see what's currently out there, found some screenshots of the IDE, instant nostalgia :)
no, sorry
there are few forums with some really dedicated users if you ever want to hop back into it :)
A: C#, but with WebForms (including using code behind and the built in web controls where possible).
or
B: VB, but with MVC and WebApi.
They all chose C# WebForms even though they all hate WebForms, just not as much as they hate VB.
Personally I love VB and WebForms, I never get to do work with it nowadays (I'm not even sure we have any legacy systems that still run it), but I built my company from scratch off that stack and coming from a classic ASP background I was blown away with controls like GridView and Repeaters etc. I remember our first designer being so confused with the mess of html outputted by these controls and the hatred our purists had for viewstate that polluted their lightweight designs.
I still remember how excited I was when I first used the AjaxControlToolkit and the UpdatePanel control, it was like magic!
Now everything's pretty much all C#, RazorPages, WebApi, Angular or Vue and I'd never go back, but I do miss the old days. It's not often I see tech that seems magical any more, SignalR was probably the last big thing that blew me away in terms of just doing something that felt so different, but it's really rare now.
I would add that we just finished a prototype app for a client using Blazor WASM and coding that did seem like witchcraft and certainly brought back some of the old feelings of being amazed, maybe we'll all look back on javascript frameworks in the same way we look back on VB in a couple of years if Blazor play outs.
If that's true, I wonder if part of the reason MS is killing VB is that it doesn't serve any necessary purpose, and it is simply uncool. I wonder if "uncoolness" is a primary factor.
It sounds silly to write, but think about it -- technologies live and die by coolness. MS is doing everything they can right now to shake off their uncool past, and VB is certainly a relic of the uncool past.
Developer share is crucial. You get a lot of developer share by being cool. Thus, being cool is very important. Damn, I want to drop a Medium article on hackernews now with my hot new take.
1. Start a go-fund-me to get a VB.net team started.
2. Start work on an open source VB.net to F# transpiler.
It was a great language for beginners that also had enough oomph to build commercial applications, everyone who I spoke to who actually used it loved it.
Why a 1 trillion dollar company like microsoft can't hire 5 dedicated devs is beyond me.