My background is primarily that of a Java programmer, but I used a lot of VB script back when I was doing back end stuff for web development.
I have a chance to start on a project at work which isn’t critical at the moment. I’m going to work on replacing an aging DOS program which is a bit cryptic and for which we lack source code. Since the app as it stands works, I have some time to get started on this. I’ve settled on .net 3.5 SDK through visual studio 2008 as my solution but I’m not sure if I should go ahead and pick up a reference book on C# and get started with that, or if I should instead pull out my VB.net books and build my app using that.
Any suggestions, advice? What kind of advantages/disadvantages can I expect to see with each language?
The app I’m building will need to do a lot of interfacing with office 2007 apps and files, if that helps in any way.
IME, you should be able to do pretty much everything you’d want to do in interacting with Office with either language. For me, I’ve stuck with VB.net for a few reasons, mostly being that I’m the only programmer where I work, so other people can look at my code and generally understand what I’m doing; if I used C#, I’d probably have to go into a lot more depth to explain what I’m doing. However, the disadvantages as I can tell is that you will have a harder time with creating more complex data structures with C# (which probably isn’t really an issue for you in that context), and it does seem like more developers use C#, so if you’re going to be doing a lot of googling, it will be a little harder to get VB examples. However, more often than not, a C# example was sufficient to figure out what I needed to know (ie, what classes/objects I need to use).
So, I’m probably say it really doesn’t matter that much and unless you have a compelling reason to go with one over the other, just pick the one you’re more confortable with.
I’d be interested in hearing more about this. It’s been a while since I did VB, but I don’t recall anything that would make me think there was a difference in creating complex data structures.
Back to the OP - I’d go with C#, just because the syntax is closer to Java than VB is. I really can’t think of any advantage other than familiarity that would make me go one way rather than the other.
In terms of overall capabilities, both languages will be pretty much identical. The .NET API is essentially the same for both, and are somewhat similar in terms of the basic language features, OOP, etc. However, Visual Basic has always been the ugly red-headed stepchild of Visual Studio languages, and with good reason as far as I’m concerned: the syntax is ugly, inelegant, and difficult to read. (Admittedly, I’m very strongly prejudiced against BASIC and all its illegitimate offspring. :p)
IMHO, with all the new features they’ve added to Visual Basic to bring it up to speed with the .NET world, it has long ago stopped being any “simpler” or “easier to understand” than other .NET languages: it’s pretty much just the same thing, with a somewhat unwieldy syntax.
So, given your experience as a Java programmer, the syntax and semantics of C# will come much more naturally to you – as far as the language itself goes, it basically feels like a slightly cleaner version of Java with more features. I would personally recommend choosing it instead of VB.Net.
Stealth Potato’s point (and, therefore I guess, frodo’s, too) is very well-taken about the similarity of Java and C#. I’ll add my voice to suggesting that you go that route, as well.
IMO, your experience with Java will make moving to C# fairly simple. The two languages are similar.
I have used C# for the last year or so and used it to wrap two interesting C dlls (the BIOApi and a BACnet API). I have not seen any issues with building complex data structures.
As a former Java Developer who switched to C#, just a heads up. Things will seem all warm and fuzzy since there are a lot of superficial similarities between the languages but once you get outside core specification of the language and into .NET territory, you may find yourself trying to swim upstream anytime you attempt to do something that framework designers didn’t develop a wizard to accommodate.
This is true; there are many similarities between the two languages, but .NET is a very different world from Java, so definitely take some time to try to learn the .NET way of things. There’s plenty of material, references, and communities out there, though (and IME most of it is in C#), so finding stuff to learn from shouldn’t be a problem.