views:

605

answers:

11

Just a question that came up from time to time at my old job when we were considering fleshing out our development staff with additional bodies. Does it really matter, if you are a .NET development house, if your developers all code in one language vs another.

I probably started out like alot of the 4million other folks there with Visual Basic way back when, and then migrated to VB.NET. Another developer we had at the time came from a C background and migrated over to C#.NET. Basically he was able to code very quickly in his native language and I was able to do so in mine and since our projects did not really overlap there was no issue until our boss basically said we need to switch to C#... for no other reason than standardization.

So I guess the 'subjective' part of the question is, is it better to sacrifice productivity for consistency? Now I should quantify this in saying we were a SMALL shop, less than 5 developers and given how most of our project plans were done on cocktail napkins its not like we were going for 6-Sigma anytime soon so it was not like 'standards' were a hard and fast rule.

Thanks.

+12  A: 

C# is definitely becoming the preferred avenue for Microsoft and it would make sense to choose a language that all developers to use simply based on the fact that if developers move between tasks, having the projects in a uniform language (not to mention coding conventions) will make the maintenance on those projects much easier for everyone involved.

TheTXI
Fully agree. It doesn't really matter though if you're using C# or VB.Net, but having all developers use the same primary language boost productivity whenever a developer has to switch projects.
OregonGhost
OregonGhost: Exactly. I only said C# because it seems to be moving towards the de facto standard at MS (if it isn't already). Our office is VB.NET.
TheTXI
And to add to that, since Christopher Klein's shop is five developers, they'll likely have to switch projects rather often, unless they're developing a really big product :)
OregonGhost
@TheTXI: Whether or not C# were to become the "preferred avenue for Microsoft", that would not affect their support for VB.NET. _That_ would likely depend on whether customers continue to want it (which they will).
John Saunders
John Saunders: I'm not questioning MS's support for VB.NET. It would take many many moons before they decided to drop VB.NET, but at the same time I would not be surprised if they continued to push the C# product more and more and leave VB.NET by the wayside as demand slows down. Then you might come to the point where when new things with the .NET framework are put out and tutorials, examples, templates, etc. don't come with the VB.NET version. By that time you would like to have made a switch so you don't have to deal with translating/converting.
TheTXI
+1  A: 

I'd say go for whatever works. VB.NET and C# use all the same underlying framework so you should be able to read each others code and with a little googling you should be able to modify it too.

I'd say go for productivity.. ultimately is the customer going to care if it's written in VB.NET or C#?? But saying that you have to think about maintanability.

Fermin
Some of our customers care about the language. But then, we're doing product development for them, so they get the source code, rather than just selling a product.
OregonGhost
The answer to your last question is: It depends on the customer and the contract that is worked out. If you are delivering a product (including source code) to the customer, it is likely they are going to want it in a language that they will be able to manage themselves, or find other people to work on down the line.
TheTXI
OregonGhost: You fast fingered devil you.
TheTXI
@TheTXI: Microsoft Natural Ergonomic Keyboard 4000 :P
OregonGhost
I agree with the sentiment, but would caution that depending on who your customer is they may care about C# versus VB.NET whether it is fair or not. For example, if you are writing a programming toolkit. Let's face it, there are a lot of language snobs out there. On the other hand, those types probably despite VB.NE and C# equally.
JohnFx
True, I was thinking that most customers would be getting the final app and not the source code.
Fermin
+1  A: 

We're still a mixed language group where I work; however, mixed with a purpose. Nearly all hardware related projects are done in C++ (not assembly, I know :() and all nearly all windows applications are done in C#.

Considering C# popularity and ease, I'd say it's in a company's interest to move to it for when they get new, greener employees.

Berdon Magnus
It's like that in my company to. Low-level embedded is ASM and C, high-level embedded is C++ (and recently also C#), and PC/Desktop/Server-Software is C++ or C#, or sometimes VB.NET (depending on requirements and which developer has which project).
OregonGhost
I think having multiple languages only for fundamentally different applications is another matter entirely. I code the main app too in Delphi, but the microcontrollr in plain C. But that is something else than having two nearly equivalent languages like C# and VB.NET
Marco van de Voort
+3  A: 

I think it makes sense to pick one and get everyone on it. The sacrifice in productivity will be brief, competent developers will migrate quickly.

Some advantages:

  • your last VB developer and the team get downsized...uh oh.
  • one of the developers quits and you have to take over their code
  • etc.
Geoff
if hes the last vb developer and team get downsized ... he wont be fired.
01
@ABCDE - check the edits. what i wrote was that he is the last VB developer and the team gets downsized. he's at risk then because everyone else is on c#. sometimes edits ruin the original sentence.
Geoff
+2  A: 

So I guess the 'subjective' part of the question is, is it better to sacrifice productivity for consistency?

Of course not. What good is consistency, by itself? Ultimately the goal of consistency is productivity. With that in mind, I would suggest that, long term, having everyone code in one language would be the best way to go...in general over the long haul, a lot more time is spent modifying and maintaining code than in writing it, and I would think that having people spend the ramp up time once would be better than having to switch back and forth all the time.

Beska
+2  A: 

our boss basically said we need to switch to C#... for no other reason than standardization. (...) So I guess the 'subjective' part of the question is, is it better to sacrifice productivity for consistency?

Of course not. The only question is what value this 'consistency' has in terms of future productivity, because productivity is all that matters. 'Consistency' by itself is not a business value. It may only help you to achieve more productivity in the future, this is way car makers reuse components from one model to another.

Several factors must be balanced:

  • (+) Tomorrow people will have to maintain only one language, the most popular .Net language: C#. (See Note 1)
  • (-) Today you must learn C#, which is a cost for your company, unless you do it for free in your weekends. Of course this is a (-) in terms of cost. Learning C# is good by itself, it just has a cost.
  • (-) Today after learning C#, you or someone else must switch one project from Visual Basic .Net to C#. That has a cost, depending on the LOC count of the project. Also, errors might be introduced, so you need to rerun your unit tests, go over all the failures and work them out. Also, you need to repeat some integration testing, to guarantee that everything works well.

You can't tell what the outcome of the balance is with this information. But you don't have to tell, anyway, since your boss presumably has better information and has already taken the decision. All that you need to do is to actually do it.

Note 1: However, this reasoning is dangerously close to "the world would be a better place if VB.NET didn't exist", which may be too strong a statement. VB.NET, or a mix of both languages, might be a good option in some scenarios.

Daniel Daranas
A: 

It is important to stick to a singular language choice, if possible. Obviously, if you are writing unmanaged C++, or have some other similar scenario, there would be notable exceptions. Many people have hit on the efficiency of homogeneous language choices, once you have ramped up. Most of the developers I know will run into an efficiency issue when switching languages, even if they know it inside and out. After coding in C# for a couple of months, if I have to go back to VB.NET to maintain something, there is a good day where I have to consciously think about things that are normally automatic. They are simple things, like using vs. Imports, type conversion, etc. It isn't that you forget how it works, but that your mind wants to do something the way you have been doing it for an extended period. A lot like the old parlor trick of pushing your arms out against a door frame for a minute and then resting them at your side. They want to go back up, because that is the signal that your brain is used to sending.

Another very important takeaway, is that this efficiency factor is important in code reviews, as well. If you are working in VB.NET and have to review C#, you are going to have the same stumbling blocks. Sure, you understand the code, but your rate or accuracy in analyzing the code will not be the same as it would be if it was in the same language you are currently using.

There are some additional minor points. Some tooling is geared towards one language over another. For example, Resharper works for both VB.NET and C#, but it provides a larger set of refactorings if you are using C#. Also, if someone in your organization maintains a company coding standard, it makes changes to those standards half as complex, if only a single language needs to be addressed.

joseph.ferris
+1  A: 

How do you see yourself as shop?

VB.NET is strong in markets that directly lean on Office, maybe client apps too, while C# is particularly strong in serverside and larger applications.

Maybe it is not about following your or his choice, but make a choice to align with the nature of the shop.

Marco van de Voort
A: 

I think this also goes a long with coding style standards. Is there really a reason why a development team chooses to go with 3 spaces for tabs rather than 4? Not really there is no technical or business advantage to this decision other than uniformity and making everyone's code look the same so when I switch between files my brain doesn't have to adjust to the new formatting.

Same thing applies here with the uniformity for C# and VB.net. There is no technical or business advantage for taking one over the other (NOTE: I'm sure if you looked hard enough you could find something really obscure). But having everyone's code uniform helps when moving from project to project so people don't have to switch gears from thinking in C# to thinking in VB.net.

Patrick
This is "something really obscure": http://en.wikipedia.org/wiki/Comparison_of_C_sharp_and_Visual_Basic_.NET
Daniel Daranas
Obscure yes, but it really doesn't apply to this question so much. In the general case most everything you can do in C# can be done in VB.net abet in some situations it may be easier to do it in one or the other.
Patrick
A: 

One of the advantages of using the .Net platform for development is the fact that you have the ability to develop in the language that is best able to express you solution to the problem at hand.

An arbitrary rule IMO should not prevent you from using F# or a DLR language when those languages would be a more natural fit than an imperative language like C# or VB.Net.

It's a harder decision to make with VB.Net vs. C# because the languages are so similar but If you need to do a lot of work with XML then VB.Net's XML literals may help make the code clearer, conversely C#s terse syntax and support for anonymous methods may make your intent clearer.

Venr
+2  A: 

If it helps, I recently wrote an article on my blog looking back at my decision to standardize our development shop on VB.NET over C# and how well my various assumptions have held up and things hindsight has shown me.

Here's a link: "A Manager’s Retrospective on the C# versus VB.NET decision"

As to whether you should standardize the whole shop on one language. I'd say there are definite benefits. The most obvious one is that switching back and forth when you work on different projects is going to incur some mental overhead to re-acclimate yourself each time. Granted, it is going to be less if you have to do it frequently, but to justify the extra complexity there would have to be some offsetting benefit.

Ultimately my advice is to standardize on one or the other based on the following criteria:
(1) If you have a large VB code-base there is a good argument for standardizing on VB.NET.
(2) If everything else is equal, I'd lean towards C# for a number of reasons mentioned in the above article.
(3) Carefully take into account your current team's preferences and the general consensus among developers in your market that you would try to recruit. Language choice is a big deal for morale and hiring.

JohnFx