FRIHOSTFORUMSSEARCHFAQTOSBLOGSCOMPETITIONS
You are invited to Log in or Register a free Frihost Account!


A confusion with C# and VB.NET...





rameshbn1
Hello people,

I recently decided to dump VB6 and start out with .NET (pretty late, am I?). I tried C# for some time using one of the free IDEs and found it pretty exciting. On the other hand, I tried out VB.NET and found it even more exciting. This led to a bit of confusion.

With regard to programming style, I thought both languages were pretty similar, but VB.NET is far more intuitive. But I've been seing a lot of info on the Net saying that C# is THE language to learn.

My Question :: 'What can C# do that VB.NET can't?'
RiCtee
Well....I don't really know much about C#. I learn VB.NET though. C# has origins from C and Java. They are more Object-Oriented based and are rather cryptic to learn at first. They can also be used in other OS than just Windows and are more strict in the syntax.

To your question: I think C# and VB.NET are rather interchangeable and can do what the other can, but there are exceptions. What do you plan to do??
rameshbn1
RiCtee wrote:
I think C# and VB.NET are rather interchangeable and can do what the other can, but there are exceptions. What do you plan to do??


To be honest, I'm don't seriously believe that I'll do my next project in .NET. All my projects have been custom-made database programs in VB6, and I'll have to continue this for a little longer. But I know that .NET is the way to go in future. All those classes lying around ready to be used...

I think this is what I will do, after I try out both C# and VB.NET. If I find that the only advantage C# has over VB.NET is in making windows services and such (which I'm not likely to do, Razz ), I'll continue with VB.NET.

but the question still remains - How does C# score over VB.NET
Kaneda
rameshbn1 wrote:
RiCtee wrote:
I think C# and VB.NET are rather interchangeable and can do what the other can, but there are exceptions. What do you plan to do??


To be honest, I'm don't seriously believe that I'll do my next project in .NET. All my projects have been custom-made database programs in VB6, and I'll have to continue this for a little longer. But I know that .NET is the way to go in future. All those classes lying around ready to be used...

I think this is what I will do, after I try out both C# and VB.NET. If I find that the only advantage C# has over VB.NET is in making windows services and such (which I'm not likely to do, Razz ), I'll continue with VB.NET.

but the question still remains - How does C# score over VB.NET


In terms of what you can do, end result-wise, there's no difference between C#, VB.NET, Delphi for .NET or any other language that compiles to the CLR of .NET.

In terms of features, however, C# has a slight upper hand. Basically, C# was created for .NET, while VB.NET was hacked to work with .NET. Even Delphi has an upper hand over VB.NET in those terms, since the design philosophies behind .NET, C# and Delphi all originate from one person - hence, it was easier to hack Delphi to work with .NET than it was for VB.

If you're comfortable with VB, there's no real pressing reason to switch. I detest the language, its verbose syntax, and its extreme difference to any other language in common use today. I find it to be a nightmare to switch back and forth between VB and C, Java, JavaScript, PHP etc. Either I forget semicolons in PHP or I accidentally put them into VB, or I use parantheses for arrays in Javascript.

As for the actual features, some that VB.NET lacks:
- unsafe mode (pointers)
- unsigned types (I don't know if they changed that since .NET 1.0)
- In spite of the CLR which theoretically should make all languages equal, C# tends to compile into shorter (and faster) programs than VB.NET. That's simply a compiler issue, not a language issue - as such (except that the verboseness of the VB.NET language makes it harder to optimize).
- C# developers on average make more money than VB.NET-developers, doing the same code Wink
rameshbn1
Kaneda wrote:

C# developers on average make more money than VB.NET-developers, doing the same code Wink


hmm...now why didn't I think of that? Laughing

Great answer, thanks!
umeshtangnu
Kaneda wrote:
rameshbn1 wrote:
RiCtee wrote:
I think C# and VB.NET are rather interchangeable and can do what the other can, but there are exceptions. What do you plan to do??


To be honest, I'm don't seriously believe that I'll do my next project in .NET. All my projects have been custom-made database programs in VB6, and I'll have to continue this for a little longer. But I know that .NET is the way to go in future. All those classes lying around ready to be used...

I think this is what I will do, after I try out both C# and VB.NET. If I find that the only advantage C# has over VB.NET is in making windows services and such (which I'm not likely to do, Razz ), I'll continue with VB.NET.

but the question still remains - How does C# score over VB.NET


In terms of what you can do, end result-wise, there's no difference between C#, VB.NET, Delphi for .NET or any other language that compiles to the CLR of .NET.

In terms of features, however, C# has a slight upper hand. Basically, C# was created for .NET, while VB.NET was hacked to work with .NET. Even Delphi has an upper hand over VB.NET in those terms, since the design philosophies behind .NET, C# and Delphi all originate from one person - hence, it was easier to hack Delphi to work with .NET than it was for VB.

If you're comfortable with VB, there's no real pressing reason to switch. I detest the language, its verbose syntax, and its extreme difference to any other language in common use today. I find it to be a nightmare to switch back and forth between VB and C, Java, JavaScript, PHP etc. Either I forget semicolons in PHP or I accidentally put them into VB, or I use parantheses for arrays in Javascript.

As for the actual features, some that VB.NET lacks:
- unsafe mode (pointers)
- unsigned types (I don't know if they changed that since .NET 1.0)
- In spite of the CLR which theoretically should make all languages equal, C# tends to compile into shorter (and faster) programs than VB.NET. That's simply a compiler issue, not a language issue - as such (except that the verboseness of the VB.NET language makes it harder to optimize).
- C# developers on average make more money than VB.NET-developers, doing the same code Wink


well i dont agree
according to microsoft
"One of the main selling points of .NET has been its multi language support, and the concept of "no second class languages". That is, all of the various Microsoft languages should have the same level of access to all OS features, and all expose the same level of power and usability."


C# features advantages

* Supports unsafe code blocks for improved performance at the expense of not being verifiable as "safe" by the runtime
* Operator overloading (not available in VB prior to 2005)
* Iterators (C# 2.0)
* Anonymous methods (C# 2.0)
* Nullable structures are fully supported with the ? notation (C# 2.0)

Visual Basic .NET advantages

* With keyword for using the same object repeatedly (this feature was intentionally not added to C# [1])
* Named indexers (essentially, properties that take arguments)
* Partial compatibility with legacy Visual Basic code
* The My namespace, which simplifies the use of many framework classes by encapsulating their functionality in a flatter, more accessible structure
* More granularity with exception handling with the Catch…When clause, which allows for custom exception filters
* The Handles keyword allows declarative wiring of events to functions; Imperative (C# style) event wiring is also available.
* Language support for late-binding (can be turned off with an Option Strict declaration)
* Optionally ignore ref/ByRef behavior for passing arguments. (C# requires a temp variable to do this.)
* Optional parameter support is useful when using COM automation. This is especially important when working with Microsoft Office.


Potentially problematic Visual Basic .NET features

VB.NETs supports several syntactic "shortcuts", which exist mostly due to the language's legacy support. While these can be valuable in some circumstances, they are also often a significant source of errors and headaches.

* Optional variable declaration
* Optional strong typing

[edit] Potentially problematic C# features

* By default, numeric operations are not checked. This results in slight faster code, at the risk that numeric overflows will not be detected.
* Unsafe code blocks. These allow pointer manipulation which can corrupt memory if not used carefully.

and your claim that c# programmers are paid more than VB.Net programmers i can say only one thing can you please tell this to my boss

Laughing Laughing Laughing Laughing Laughing Laughing
Kaneda
umeshtangnu wrote:
well i dont agree
according to microsoft
"One of the main selling points of .NET has been its multi language support, and the concept of "no second class languages". That is, all of the various Microsoft languages should have the same level of access to all OS features, and all expose the same level of power and usability."


Firstly, one thing is what MS say, another is what they do. Secondly, yes, the whole point of the CLR is that all languages (and not just MS ones) have the same level of access to OS features. And as far as I recall, that's exactly what I said:

Kaneda wrote:
In terms of what you can do, end result-wise, there's no difference between C#, VB.NET, Delphi for .NET or any other language that compiles to the CLR of .NET.


The difference between them enters in how you do those things - and that, in turn, is reflected in the structure, concept and maintainability of the code.

Quote:
Visual Basic .NET advantages


A common trait of those "advantages" are that they're mainly advantages for a programmer who's already using VB. Most of these "features" are actually what makes VB code compile to slower CLR bytecode. Which shows exactly what I said: VB was hacked for .NET.

Quote:
Potentially problematic C# features


Are not problematic at all. They're additional features which should be at the judgment of the coder whether to use or not - not the language designer.

Quote:
and your claim that c# programmers are paid more than VB.Net programmers i can say only one thing can you please tell this to my boss


Why don't you tell him? Smile It's a well known, statistically backed up fact - first time it was revealed, in 2003 in Visual Studio mag, C# programmers on average got paid 26% more than VB.NET programmers. The numbers have been consistent on that ever since.

That's a matter of culture. VB has always been branded as a "hobbyist's language", and as a result, it has more users than any other language. It also has more bad programmers than any other language - here I'm speaking from personal experiences with job interviews - and coworking - with VB programmers.

While VB.NET finally is a fully OO language, most VB programmers have never been trained to think in conceptual models to structure their work. Hence, looking through VB.NET code tends to be a nightmare compared to C# code.

So, it's a matter of culture, but it's a culture that's also largely grown out of (and been built into) the syntax and design of the languages.

For such reasons, having a choice between a VB programmer and a C# programmer who on the paper look like equals in terms of competencies, I'd pick the C# programmer without thinking twice.[/quote]
deepak
The most important point C,C++, Java can be called ancestors of C# and its fully supported in Linux also(Mono). While VB.NET is much more confusing than VB and currently only Win platorms are supporting it.
vincelegard
Both languages are same and both are from microsoft .Net family. The difference is only syntax wise . If u know vb6 it is easy to study vb.net . C# http://csharp.net-informations.com is more like Java or C++. So compared to study c# is little bit difficult to study. But nowadays C# is more popular and creating more job oppurtunities.

legard.
cabenqc
I think question has been answered clearly.
learn to get a paid employment : better C#
for fun or self project : either C# or VB.
Marcuzzo
Since we're bumping old topics anyway, I'll add my 2 cents on this.
I've written a lot of code in both and when comparing C# with VB.NET, the ONLY difference is the syntax.
C# holds the ECMA standards so that C, C++ and java dev's can easily start coding in it.
VB.NET has the systax of ( Visual ) BASIC

both use the .NET framework to execute code in the CLR and have the exact same capabilities

when it comes down to choosing one or the other it is merely a matter of finding out which syntax you like more.
Related topics
visual basic.net
cracking
VB.NET school
VB 6 and vb.net tutorials
Knowing Source Code
VB.NET and SQL Server
VB.NET learning
Need vb.net or Flash ActionScript Help!
VB.Net Or C#
Is DirectX better or Opengl
Desktop Programming
OMG! vb.net without connection to server option?
What is your recommended free VB.net decompiler?
vb.net class as property of another class - FIXED
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.