Opinion, VB.Net or C#

Started by dmbalzer, June 03, 2021, 04:16:41 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dmbalzer

Just a general question.  I am moving my add on from a macro enabled stencil to a VSTO add in for future deployment.  I am very familiar with C# and much more fluent with VB.net, but from a code porting standpoint it would be easier to go VB.net.

I know Visual Basic as stated by Microsoft will only be getting security and general compatibility updates, and after that who knows if anything.

My question is would you take the time to port everything to C# or stick with what i know under the assumption that VB.net will continue to work fine in the future?

Thanks!

Visisthebest

Mostly C# is getting more language features as Visual Studio develops further, but VB.NET is still a great language and a nice bridge to C# in the future. I would choose what works for your planning and your learning preferences as a developer, as I program more in VB.NET it also becomes easier to read C# as I understand the intention of pieces of code better. It is easier to take steps than jumps developing your programming skills.
Visio 2021 Professional

Yacine

Isn't VB.Net much closer to C# than VBA?
I've worked with all three and felt that VB was more of an unecessary hybrid inbetween.
Yacine

Nikolay

#3
Quote from: Yacine on June 05, 2021, 09:02:00 AM
Isn't VB.Net much closer to C# than VBA?
I've worked with all three and felt that VB was more of an unecessary hybrid inbetween.

Exactly. I've heard the Microsoft even planned to discontinue VB.NET at some point, but look - it's 2021, and it's still there, and even found its way to the .net core, including .NET 5 and 6  :)

Visio Guy

VB.NET looks like VBA, but you have access to tons of modern capability in the .NET framework. VBA doesn't even have a built in sort method! It will drive you mad! You can even have a solution that has VB.NET and C# projects mixed, which is nice if you have libraries developed for different customers/projects and want to piggy-back on existing code.

VBA has the advantage of being built-in, and you don't have to compile to get anything to run. This is great for learning and prototyping, but once you need forms, and advanced functionality, VBA is really, really cumbersome. You can get almost the same "VBA feel" buy using a tool like LINQPad. See John G's article:

Getting started with C# in LINQPad with Visio

For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

dmbalzer

Quite a bit of food for thought! Thank you for all of the insight.  I agree sorting (in my case dictionaries of parts by tag, part # etc. for bill of materials tables) has driven me bananas.

I guess my only gripe is a bit of added dev time with the compiling, firing up Visio, and testing/debugging loop, but i have found VS 19's syntax and runtime checking saves a great deal of bugs from happening.

I do like the flow and control of C#, it just feels weird having to type cast things so much such as all the (short) type casting, and accessing shape info as structs.

Takes getting used to but long term I may just go all in with C#, and keep prototype in VBA.

Thanks again!