r/dotnet • • Nov 13 '18

Visual Basic in .NET Core 3.0

https://blogs.msdn.microsoft.com/vbteam/2018/11/12/visual-basic-in-net-core-3-0/
40 Upvotes

67 comments sorted by

61

u/[deleted] Nov 13 '18

Visual Basic is good for working out which jobs not to apply for. ;)

12

u/[deleted] Nov 14 '18

When applying for my current job I had the understanding that it was a C# shop, which it was. On my final interview they kind of clued me in on the fact that I would be supporting a lot of very old VB/VB.NET apps but would have some C# development. I figured, what the heck and took the job. 2.5 years later I had gone from programmer analyst to senior programmer analyst. I've learned to love VB.NET and hate *some* VB developers. Today I do a mix of C# and VB.NET.

Most of the legacy apps that I support, I support because nobody else wants to. It's given me the opportunity to move up the latter much faster than if I had been working on our C# new development. Because the largest part of our business uses the legacy apps I've had the opportunity to end up pretty important on our team.

When I started, my largest Basic programming experience was in AppleSoft Basic in the 90's and after that I learned C++ and C# and vowed to never touch Basic again. I guess you can't predict everything. I have a healthy respect for VB.NET and Option Strict/Option Explicit now.

My point is, I wouldn't write off any job just because of VB.NET. There's a lot of good and bad code out there that needs upgraded and a lot of the old VB6 programmers gave up because VB.NET was too much of a change. So, it's an opportunity not a curse.

The other day I was referred to as our best VB programmer. Not something I would have welcomed when I started and I'm not sure how I feel about it now.

8

u/devperez Nov 13 '18 edited Nov 14 '18

Where I live, they were so desperate to find someone willing to work on a big VB.NET app, that they were paying like 15K above normal market rates.

7

u/teressapanic Nov 13 '18

Higher salary doesn't mean the job is better. In IT they tend to pay more for work nobody wants to do.

5

u/[deleted] Nov 13 '18

I guess it depends what better means to you. Making a bunch of money probably doesn't sound bad to some.

28

u/farkedup82 Nov 13 '18

I'd rather work on VB than java.

17

u/[deleted] Nov 13 '18

I'll happily work with VB.Net.

Granted, my preference is always C#, but if you know C# you basically already know VB.Net. I have no issue working on an existing well written/maintained VB.Net codebase.

45

u/[deleted] Nov 13 '18

I have no issue working on an existing well written/maintained VB.Net codebase.

Your a funny guy, I like you.

19

u/devperez Nov 13 '18

Uh, yeah. Not that VB.NET codebases are all bad, but I haven't come across one I've liked. It's because all the VB.NET devs I've known came from VB6, where writing well maintained code either wasn't possible, or no one cared enough. Seeing GOTO and ON ERROR RESUME NEXT in VB.NET wants to make me puke.

7

u/[deleted] Nov 14 '18

I’ve worked on a high-throughout service layer that was all VB.net, like over a million calls a day with an SLA of .6 seconds. It was beautiful, efficient code.

3

u/[deleted] Nov 14 '18

Thats wierd... i love this thread.

3

u/[deleted] Nov 14 '18

At the end of the day it is msil that runs, it is not that vbnet is a bad language it is that the community is terrible

1

u/[deleted] Nov 13 '18

I read about a company a while back which made a point of writing their backend in VB.Net, and writing it well, to weed out programmers who put too much stock in a particular programming language that they would turn down a job.

I'll try and find the link.

3

u/farkedup82 Nov 13 '18

its in the .net framework and both are capable of doing the same things. They should have used Python though. It is clearly the fastest and best at everything.

6

u/[deleted] Nov 13 '18

2

u/[deleted] Nov 14 '18

No way

1

u/DarienLambert Nov 13 '18

!RemindMe 1 day

1

u/RemindMeBot Nov 13 '18

I will be messaging you on 2018-11-14 22:18:21 UTC to remind you of this link.

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


FAQsCustomYour RemindersFeedbackCodeBrowser Extensions

1

u/DarienLambert Nov 14 '18

Where's the link?

2

u/[deleted] Nov 13 '18

They exist...honest...

1

u/throwaway_lunchtime Nov 14 '18

I know they exist, but the last time I was on a VB.Net project, they had decided that "one file per namespace" was a good idea and could quite grasp why they had so many merge issues.

3

u/farkedup82 Nov 13 '18

you're a funny guy!

3

u/wafflePower1 Nov 14 '18

but if you know C# you basically already know VB.Net.

Yeah, sure, once I had to make slight changes, had to google what null is in VB.NET, what's the difference between And and AndAlso and some other random shit.

5

u/[deleted] Nov 13 '18

I'm surprised noone has said anything complain ing about VBA in stuff like Word... (it's like VB but just as bad)

7

u/[deleted] Nov 14 '18

The Excel team did an AMA the other day, and I seem to recall a few complaints. :-) (Mostly people wanting to see Python support).

Given how widely used VBA is, it baffles me that the VBA editor in Excel hasn't had any changes in over 20 years other than the addition of long data types.

4

u/[deleted] Nov 14 '18

You can write add-ons in JavaScript for Excel these days, interestingly.

4

u/[deleted] Nov 14 '18

Unfortunately, the JavaScript Office object model is still pretty limited, though.

5

u/Sebazzz91 Nov 14 '18

Not only that, internally it launches the Internet Explorer web host to execute the javascript. It is really super limited.

19

u/Apk07 Nov 13 '18

I love VB and will never understand the hate it garners from C# evangelists. C# is good, too, but preferring C# doesn't justify demonizing VB.

Regardless, I'm happy they're actually treating it as a "first class citizen" as they wrote.

8

u/stun Nov 13 '18

VB is treated as PHP in the .NET world.

4

u/ModernTenshi04 Nov 14 '18

Recently took over as maintainer of a site with several others. Current site is written in PHP, and we're planning to overhaul it to .Net Core.

So, yeah, pretty much.

-10

u/[deleted] Nov 14 '18

Carefulllllll

.NET is excellent for large websites, but small websites can't justify the performance detriment of the CLR. The same goes for Java.

8

u/skyllefine Nov 14 '18

NetCore is really fast.

7

u/[deleted] Nov 14 '18

[removed] — view removed comment

-1

u/[deleted] Nov 14 '18

I personally owned a Windows shared hosting server catering to ASP.NET on the .NET Framework 3.5. It was extremely slow. I then transferred to a Linux hosted server catering to your traditional LAMP setup and gained a massive performance enhancement, especially after I rewrote my back-end in PHP.

Like I said, .NET and Java are great for large websites that need the ability to scale, but their overhead is woefully large on small websites like mine that a server-side scripting language would be much more efficient for (assuming you aren't writing a game, or something).

3

u/jayrulez Nov 15 '18

ASP.NET on the .NET Framework 3.5 is not ASP.NET Core on .NET Core.

From actual usage as well as benchmarks, dotnet core is faster than PHP for pretty much everything.

3

u/[deleted] Nov 14 '18

[removed] — view removed comment

0

u/[deleted] Nov 14 '18

Different languages have different runtimes. These different runtimes contribute to the over all performance of the language by ways of their garbage collector routines, dynamic code management, stack tracing, and debugging tools. These tools are always present when programs are executing on that runtime. Without the runtime, the code doesn't run (in the case of JavaScript, Java, .NET).

This is why you don't see C# or Java used for embedded as much as C++ or C. The virtual machine (read: emulated computer) they run on, the CLR and JVM, respectively, are quite heavy. C++ and C require minimal runtime assistance because they run natively on the machine.

Now in the case of PHP vs. C#, PHP is an interpreted language which is handled by its own runtime. The key difference here is that simple language = simple runtime. You end up with a situation where for small deployments, PHP actually outperforms C# by not bogging down the host machine with its runtime.

However, as deployments get larger, the overhead of the CLR becomes less important, and the speed of C# over PHP begins to shine.

This is computer science in a nutshell. The science of trade-offs. All tools and languages have their place.

3

u/jayrulez Nov 15 '18

Um... Just no!

You try to sound like you know what you are talking about but what you are saying seems to be coming from gut feelings instead of actual experience and knowledge.

Now in the case of PHP vs. C#, PHP is an interpreted language which is handled by its own runtime. The key difference here is that simple language = simple runtime. You end up with a situation where for small deployments, PHP actually outperforms C# by not bogging down the host machine with its runtime.

False.

The complexity of a runtime does not directly relate to its performance.

Have a look here: https://www.peachpie.io

PHP on .NET runs faster than your standard PHP implementation.

I actually migrated a Symfony to .NET Core 1.0 a while ago. We did lots of bench marks before even attempting it. .NET Core at the time already outperformed PHP. It has gotten a lot better since then. Said application is currently running on the latest ASP.NET Core with zero performance issues.

10

u/hokie_high Nov 13 '18 edited Nov 13 '18

I hated VB long before I ever even looked at C# just based on seeing ancient code at my first real job. Subjective of course, but it's full of weird shit like the Dim keyword, and it has awful syntax. I tend to despise any language that uses words to wrap scopes instead of curly brackets. If you're not going to use brackets then just go full Python and use nothing, but enforce whitespace in the syntax.

There's plenty of other things people don't like about the language itself but VB has a reputation of being a language non-programmers learned out of necessity rather than a desire to actually be a competent programmer, so shitty legacy dumpster fire code bases full of MyVar1, MyVar2... MyVarX crammed into a single source file in a project called WindowsApp1 has become a VB meme.

1

u/cwbrandsma Nov 13 '18

All of my main languages are C syntax languages (C#, Swift, Kotlin, JavaScript). So, we have { } instead of begin and end. So it is easier to setup common style guides between languages, which leads to easier migration. C# also tends to be less verbose and just as clear. VB has a few niceties as well.

Granted, I've worked in VB4, VB5, VB6, and even VBScript. They all left a bad taste in my mouth, especially after I switched to Delphi (which was vastly more capable than VB6, and much easier to use than C++).

So when C# and VB.net both came out, I really didn't want to go back to VB.

0

u/[deleted] Nov 13 '18

[deleted]

12

u/_pupil_ Nov 13 '18

It's as simple as this: if you're a talented developer who is learning .net, even coming from VB5, why bother learning VB.Net?

I mean... it's roughly comparable in terms of language, but with a larger market share, more similarities to Java, more examples, and a larger community (IIRC), on the C# side. There's simply no reason, outside of familiarity, to invest your time and energy there.

Especially given how readily VB.Net libraries can be consumed by C# libraries, there just isn't a lot of motivation to stay on it over time if you or your team are on top of your game.

7

u/hokie_high Nov 14 '18

My feeling is that VB is sticking around for the same type of people who benefited from it in pre-.NET days. It allegedly has a simple syntax and a non-programmer can be productive with it in a Windows environment very quickly. You can learn it while skipping a lot of programming 101 concepts.

Obviously this mindset is horrible for shared/production code and that leads to a lot of people hating it, including myself. And I say “allegedly” above because I think the syntax is shit and much more convoluted than languages closer to C, but I’ve been programming since age 10 and grew up learning that stuff, it’s impossible for me to see these things the way a new programmer from an entirely different background sees them.

17

u/[deleted] Nov 13 '18

No why? This is a perfect opportunity to kill support and EOL the language

7

u/hopfield Nov 14 '18

So they drop legacy ASP.NET compatibility on .NET Core but they keep Visual Basic limping along? Is there someone in charge at Microsoft because this makes no sense. I thought .NET Core was supposed to be a streamlined, rethought version of .NET with modern best practices applied and legacy cruft removed.

7

u/1s4c Nov 14 '18

It's basically just about the compiler. Visual Basic .NET is compiled to the same CIL as C#. It doesn't really matter for the runtime what kind of language you used to write your program. You can run PHP and tons of other languages on .NET runtime if you have compiler for them.

2

u/derekmckinnon Nov 13 '18

VB.NET (2005) was the first programming language I learned, so it has somewhat of a special place in my heart. But I definitely never want to go back to using it full time. It’s just so esoteric feeling and verbose compared to C#. Unfortunately, I still occasionally deal with VB6 legacy garbage to this day...why anyone would prefer any VB flavour to C# is puzzling to me, but to each his own

1

u/softwareguy74 Nov 15 '18

Ahhh VB6. Now that brings back memories.

2

u/iso3200 Nov 13 '18

Visual Basic 16.1 and 16.2 will improve C# interop

Can someone please explain to me what this means. Why interop with C# when you can just write in C# in the first place. Want to write C#? Just create a C# class library and reference from the VB.NET project, right?

8

u/[deleted] Nov 13 '18

You might have old working code in VB.Net, and want to add new code in C#?

Why rewrite the old stuff if it works?

1

u/[deleted] Nov 17 '18

[removed] — view removed comment

1

u/Wolven_1 Mar 12 '19

Really? How? Since they both are converted to the same CIL, how would rewriting it in C# make it "work better"? Are the 0's & 1's compiled from CIL which was converted from C# somehow special 0's & 1's?

1

u/throwaway_lunchtime Nov 14 '18

This is a pretty strong statement about sun-setting the full framework.

1

u/softwareguy74 Nov 15 '18

Why?

-1

u/Ronald_Me Nov 15 '18

Why not?

2

u/softwareguy74 Nov 15 '18

But why?

Who the hell in their right mind would build anything new in VB?

1

u/Wolven_1 Mar 07 '19

Anyone that doesn't like typing\seeing f%^&ing curly braces everywhere... for one.

1

u/softwareguy74 Mar 11 '19

So you'd rather type "Then" and "End" in an If statement than a single curly brace?

5

u/[deleted] Nov 14 '18

[removed] — view removed comment

2

u/Dionatos Nov 14 '18

I still got a VB course in my first year of my bachelors in 2012.