How C# beat VB to take the programming language crown
This blog explains why Wise Owl have gone over to the dark side, and now program in C#

Posted by Andy Brown on 13 June 2014

You need a minimum screen resolution of about 700 pixels width to see our blogs. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.

How Visual C# won the battle against Visual Basic

I believe there are many good reasons to prefer coding in Visual Basic (I've blogged extensively about it: here and here for example).

I've also written an article on Simple Talk which attracted its fair share of C# trolls.

However, we've just rewritten our website in its entirety using ASP.NET MVC, and we chose C# as a programming language.  Given our preference for VB this deserves a full explanation, so here's why we crossed over to the dark side.

Even Microsoft are giving up

One reason we held out for so long was in the belief that we had the backing of Microsoft, but even they are conceding defeat.  For example, in SQL Server Integration Services, you can embed script tasks.  These now offer C# as a default, and you have to make a conscious decision to switch to VB:

Visual C# choice

It may be second in alphabetical order, but it's the one chosen by default.

Another ominous sign: you can now create custom assemblies in C# in Reporting Services.

C# is (much) more popular

I rely more and more these days on StackOverflow (as I'm sure do all developers).  I would say well over 90% of the code examples quoted there are exclusively in C#, and it was becoming increasingly difficult to find VB code.

Typical SO article

A typical StackOverflow article - notice how the author just assumes that grown-up developers will program in C#, which wasn't mentioned anywhere in the title or question.

Compatibility with other programming languages

If you learn VB, you'll have a head start writing VBA macros for the likes of Excel and Access -  not to be sneezed at.

However, if you learn C# you've got a head start to writing:

Language Notes
JavaScript The dominant language for writing client script for websites (remember vbScript anyone?).
Java Another popular programming language.
SSIS Integration Services expressions are written using syntax uncannily similar to C#.

It's like VHS versus Betamax all over again: the inferior standard is winning out ...

Conclusion

In conclusion, it's time to dust off the semi-colon and curly brackets keys, embrace your inner geek, and start writing stuff like this:

// add a tile

private void addTile(ref UnitTile tileToAdd,

ref List unitTiles, ref int c, ref int r)

{

c += c;

if (c > 3)

{

c = 1;

r += 1;

}

tileToAdd.RowNumber = r;

tileToAdd.ColNumber = c;

UnitTiles.Add(tileToAdd);

}

Yuk!

This blog has 0 threads Add post