Language style - are all .NET languages the same?

Thycotic has recently engaged on a consulting project that is completely VB.NET.  This is not our usual (C#) stomping ground so there are plenty of opportunities for us to learn new things and make sure that we steer clear of the religious arguments!  I have been developing primarily in C-style languages for most of my career so the transition has been interesting.

While consulting at the BBC a number of years back, I was fortunate to cross paths with Karen Bearkley - an accomplished Perl developer who had come to Perl from C.  She often commented how important it is to not write Perl in a C style but rather to take advantage of the diversity of the language and its unique constructs.  If you don't write in the flavor of the language you will be forcing your pen rather than letting it flow ...

This got me thinking about our C# to VB.NET transition ...

  • Will our VB.NET code look like a C# developer wrote it?
  • Does the framework really level all .NET languages?
  • Is there still enough diversity to make each unique?

There must be some truth to this idea even in .NET since we have adopted some new standards which feel somewhat C#-ish to me:

  • Never use the root namespace - always declare your namespace in each type
  • Adding overridable to all methods (or was this our Java hold over?)
  • Option Strict On and Option Explicit On
  • Never use the Microsoft.VisualBasic namespace
  • Still be picky about exact case
  • Use a refactoring tool (CodeRush/Refactor Pro! supports VB.NET)

What do find when you move between .NET languages?

3 Comments

  • Except for this standart,"Never use the Microsoft.VisualBasic namespace" all of them are valid to me. I have started as C# programmer after 8 month, started using VB.Net. After 9 months using VB.NET, I am back to using C# again. I think that two languages has their strengths but Visual Basic.NET IDE is more powerfull than C#.NET. My opinion is that instead of forbidding visual basic namespace, teach your developers that functions. They can come very handy. I sometimes use them in c# projects. After all that namespace is part of .net framework.



  • Atilla,



    I must disagree with you here.



    By using the Microsoft.VisualBasic namespace you are using COMInterop. Basically, Microsoft wrapped the VB6 namespace into managed code. Don't be fooled, it is COMInterop. It will add the VisualBasic.dll assembly to your project bin folder.



    Additionally, any 'good' vb guy will tell you they use the Option Strict On and Option Explicit On.

    Why did Microsoft leave this in the .net framework? - The answer is simple: portability.



    Yes, VB allows you to do really nasty things to your code, but I see this as a feature, a flexibility - not a shortcoming.



    Finally, I believe that there is an audience for each language.



    -- Beginners use C# (It is strict - it will not allow you make to many boo boos)

    -- Experts use VB.net (you know what your doing - why not do it in plain english?)



  • Antonio's comment about a 'good' VB guy certainly makes sense. It is always possible to write good or bad code in any language!



    Is .NET the first platform to have a common framework and multiple languages? Does this level the language playing field? - I wonder.

Comments have been disabled for this content.