I'm a hobbyist programmer with couple of database driven mobile web sites and I finally have decided to switch from classic asp to .net. But after couple of days reading I couldn’t decide which way I should go. Shall I learn c# or continue to vb in .net?
c#: it will be harder in the beginning, but will pay in the future. my opinion...
For hobbyist programming (i.e. a non-commercial endeavour you will only work on yourself), it really doesn't make any real difference.
Go with whichever you are more comfortable with.
C# because if you know it, your job opportunities will be bigger and it's in my opinion a much more elegant language.
It has a bigger community and you will probably find more tutorials written in c#. If you choose either language, there are online converters available to help you.
You will have an easy time reading Java code afterwards. You will also probably feel somewhat at home with c or c++ syntax.
Oh and if you've never been exposed to web forms and come from a classic asp background, why not give asp.net mvc a try? It's nearer to 'the old ways' in some regards.
I faced this one about 3 years ago in my Job. If you look in depth at the syntax of the languages you will see they are very close.
I went with the C# way as it seemed more widely used, asked for, more examples were available and it was cross platform (the mono vb.net was lacking last time I looked).
I found VB.Net really hard to pick up after working in VB since 1991 - the languages are similar enough to feel familiar but different enough to constantly trip me up. To make it even more confusing, I do a lot of work with Excel/VBA, which is still VB6.
So I much prefer C# when I'm working in .Net: I was never much of a C++ or Java programmer, so I don't trip over differences there.
On the downside, C# being case-sensitive is tedious after years of VB auto-correction...
My feeling is that C# has a brighter future than VB, and will give you a much richer experience in the long term. The C derived syntax is also in use by many other modern languages and will make them easier to learn too.
You can start with C# directly. There are not many common things in VB.NET and VB, dispite the look and feel.
If you start with VB.NET, you have to learn the framework anyway.
My suggestion to you is to go with C#. I was a VB programmer, but I always felt left out of the programming community. C# uses the terminology which industry widely uses, where as VB.NET uses its own terminology.
Just to echo a couple of people in here:
"Classic" ASP and VB.net are different beasts completely. Some of the syntax is similar but it's a whole different language once you start to dig in.
You might get confused if you stick with a VB-like language. So much is different in ASP.NET that I would strongly consider starting afresh completely. Buying a C# book and making a weekend of it might be the best way to clean out the learning pipes.
C# is much, much more anal about cases and syntax. VB.Net is too compared to VBS (ASP) so you want to make sure whichever you're going with, you have a good IDE to watch your back and keep you in line while you're learning.
C# looks a lot more sophisticated on a CV/resume compared to Visual Basic to a layman hiring manager. One is sharp and cutting and hot. The other is Basic. There are generally a lot more jobs for the C#/Java syntax than VB's anyway.
But ultimately you should go where you're happiest. You have complete free choice so enjoy yourself.
c# for these reasons:
- I don't have any conclusive proof or anything, but it seems that c# programmers have an easier time reading/coding vb.net code than the other way around.
- c# seems to be more popular in the job market (I know you are a hobbyist, but still...)
- c# is syntactically closer to c/c++/java. If you ever want to go into those other language, c# will put you at a slight advantage (except for java, in which you'd have a pretty good advantage since the languages are very similar.... you'd just need to mostly learn a new framework.)
Although VB.Net is viable, the trend is toward C#. Most of the articles written by the top tier of developers today are in C# and it may save you time to simply develop in C# as opposed to having to translate your "syntactic thought process" back to VB.
You will find C# more challenging from the perspective that the syntax is case sensitive, and you might find yourself relying on intellisense more than what you'd expect.
I also started in asp classic and found it much easier to pick up VB.NET than C#. Sure, most of the samples are in C# but if you understand C# syntax it isn't that hard to understand and apply. You should be able to read both fairly comfortably either way.
I'm not coding(nor do I want to) large, complex web applications. I find that VB has lots of little things that help me concentrate on the logic rather than "silly" things like case sensitivity.
I think it has a lot to do with how you think. I find it 100 times easier to read VB than C# but other people are different. That is why there isn't just one language that is best for everybody.
The two languages are very similar, just what I call syntactic sugar differences. Choose what you are more happy with. I too would echo others in saying if you have do not feel strongly then you should go c# as this is more prolific language.
A couple of other hints while you are here.
- No more hidden fields - you no longer have to have hidden fields holding your state, use either the Session collection or the ViewState collection.
- Move your database access out into a different project, don't talk to the db from the page or the page code behind.
- Look at using some ORM Object relation mapping (LLBGenPro, CodeSmith, LINK to SQL, etc)
- Log all exceptions look at the application events in global.aspx.cs
Welcome to a brand new world!