Friday, July 31, 2009

ASP.net Visual Basic Versus C#?

i know microsoft decided to make C# , Visual Basic, J# , to make it easier on the person coming from that world to build asp.net pages. but is there cons or pros between the 3 ?

ASP.net Visual Basic Versus C#?
In terms of performance, all .NET languages compile to almost the same Intermediate Language (IL) hence perform almost the same.





I do not know about J#, but I can give you an idea about C# VS VB.NET.





There is a myth that C# code is faster which is not totally true, but there is a grain of truth in that since VB.NET allows you to take actions that might make your code of a lesser performance. Such actions might not be possible in C#.





You cannot use several code blocks with different languages in the same page. You can reference assemblies built in other .NET languages though. In .NET 2.0 you can build different pages in different languages. However this was not possible under .NET 1.1.





Hope this helps.
Reply:If you like Java, try J#. If you like VB, keep on using it. If you like C, then C# will make you way happy. Really.





I tend to use C# because it gives me a bit more control over my threads than J#. And if I get a little lazy writing code, C# has built-in housekeeping, like Java. The only real advantage I've discovered in J# is the built-in ability to .zip a file. I've never been a fan of Visual Basic, so I just don't use it.





A fellow developer recently switched to C# because he discovered that he could charge more for it than VB. That was his only reason.
Reply:asp.net pages are created using c# or vb. the con of using j# is that i do not believe you can. and even if you could, support on the internet is slim. so the consideration becomes between c# and vb. both languages allow the exact same operations frequently using the exact same code. the only difference is minor syntactical points (c# uses braces everywhere, whereas vb uses no braces and prefers the End XXX construct (End If, End While, End Select)). people tend to have an easier time reading vb than c#, and the learning curve for vb is far more appealing. with programs out there whose sole purpose is to convert between vb.net and c#.net, it seems like vb is definitely the best way to code your asp.net pages.
Reply:The only one I'd steer clear of is J#. I was a Java programmer. Learning C# for me was a snap. VB.Net was easy as well.





That's the nice part about Microsoft.Net. Regardless of the language you type into your IDE, it all compiles down to MSIL. Therefore, the choice of language is just personal preference on your part.





Now, having said that, let me also say that C# has one really big thing in its favor: the hourly rates you can get for C# are significantly higher than for VB.Net. That's because most enterprise level apps that are done in .Net use C#, whereas VB.Net still has the stigma of only being good for smaller departmental apps (I don't believe this to be true but other people seem to), so they don't pay as much.





Eric

sympathy flowers

No comments:

Post a Comment