What's the point of C# and C++

  • Thread starter Thread starter Zach
  • Start date Start date
Z

Zach

After having taken a looong break from VB (last used 6.0), I started
getting back into programming again, this time with VS 2005. I began
reading up on VB.NET from various sources (books, internet, etc.) and
found out about the CLR and how all of the .NET languages access it, the
major difference being the syntax and structure of the individual
languages. What I'm wondering, since VB.NET is obviously easier to
learn/use than C#.NET and C++.NET, why do these others exist (in the
..NET "format", not the standard library/compile to standalone .exe
versions)?

I've read discussions in forums and newsgroups from others saying C# is
better than VB for this and that or VB is easier to use (which it is)
but if they're all accessing/using the same .NET runtime then what's the
point? I'm not being cynical; I'm just confused as to why I should
bother learning C# if it isn't better or worse than VB. I'm probably
missing something here and if so I'd really like to know what it is.

Thanks in advance

Zach
 
Zach said:
After having taken a looong break from VB (last used 6.0), I started
getting back into programming again, this time with VS 2005. I began
reading up on VB.NET from various sources (books, internet, etc.) and
found out about the CLR and how all of the .NET languages access it, the
major difference being the syntax and structure of the individual
languages. What I'm wondering, since VB.NET is obviously easier to
learn/use than C#.NET and C++.NET, why do these others exist (in the .NET
"format", not the standard library/compile to standalone .exe versions)?

The reason both exist is that they are aimed at different markets. C# is
more aimed at someone who is programming day in and day out while VB is more
aimed at your casual programmer. In some cases VB is easier to use than C#
but there a lot of disadvantages with VB. While it has some minor timesaving
examples these are fairly insignificant when you need to use pointers and
are stuck in a VB project (pointers are useful for high speed bitmap and
video stream manipulation. Donet can keep up a fairly high frame rate and
manipulare video in real time). Personally for me just having to type all
the keywords that are required in vb is enough to make me prefer c#. eg
function, sub, dim, as, directcast, not, I must type these 1000+ times a day
and am really sick of typing them, especially directcast. :-)

As for C++ it's there for writing dot net libraries in C++ of course.

Michael
 
Michael C said:
The reason both exist is that they are aimed at different markets. C# is
more aimed at someone who is programming day in and day out while VB is
more aimed at your casual programmer.


:-D This is one of the funniest statements I've ever read in this group in
the past years. Hey, another one: C++ was invented for children between 3
and 6. Then they feel bored and upgrade to C#. I'm convulsed with laughter.


Zach, C# and VB are very close together. Each has some advantages over the
other. So, it's mainly a matter of taste. Exceptions prove the rule. You can
start another long discussion as they have already taken place in the past
years, or you just can believe me, who writes programs for over 20 years
now, in Assembler, Pascal/Delphi, C#, C++ and several versions of Basic. Mr.
Michael C seems to be a troll gracing us with his presence lately. Decide on
your own. Anyway, whatever language you prefer, none of them is by far aimed
to casual programmers. On the other side, I can clearly discourage you from
using C++/CLR(!) if you don't have to.



Armin
 
The reason both exist is that they are aimed at different markets. C# is
more aimed at someone who is programming day in and day out while VB is more
aimed at your casual programmer. In some cases VB is easier to use than C#
but there a lot of disadvantages with VB. While it has some minor timesaving
examples these are fairly insignificant when you need to use pointers and
are stuck in a VB project (pointers are useful for high speed bitmap and
video stream manipulation. Donet can keep up a fairly high frame rate and
manipulare video in real time). Personally for me just having to type all
the keywords that are required in vb is enough to make me prefer c#. eg
function, sub, dim, as, directcast, not, I must type these 1000+ times a day
and am really sick of typing them, especially directcast. :-)

As for C++ it's there for writing dot net libraries in C++ of course.

Michael

I do not agree that VB is aimed at casual programmers.

As someone who has written C and C++ code for over 20 years, I now
prefer VB.NET to C#. Yes it is a little more verbose, but I like
that. C# can be very cryptic sometimes, and the small number of
things you can't do in VB.NET are not things that affect me very much.
 
Since all .NET languages use the same framework, the only real reason for
the existence of having multiple languages is developer preference. Prior to
the existence of .NET the most common languages were ones that used syntax
from Unix based languages (C++, Java, etc.) and Visual Basic. This is why
multiple languages exist in .NET, so that developers with experience in any
of these languages can start to interact, write libraries that they can
share, and use a single runtime. Which language is best? There is no
definite answer to that, because whichever one you are better with is
usually better for you. However, the most common two by far are VB.NET and
C#. Other .NET languages exist mostly so that people can still use
previously existing languages, but compile them to run on .NET. Many people
concentrate on either VB.NET or C# when learning .NET, but it is often
recommended that you at least get a general feel for both, because I
guarantee that you will run into example code on websites in both languages.
But the only major difference is syntax, because they both use the same
classes, so if you understand the basic things like declaring a variable and
method in both languages, you should be good. No matter what anybody says,
neither one is "better". (But in my mind, C++ is a language of the past, if
you used to be a C++ developer, make an attempt to transition to C#)
 
Zach said:
After having taken a looong break from VB (last used 6.0), I started
getting back into programming again, this time with VS 2005. I began
reading up on VB.NET from various sources (books, internet, etc.) and
found out about the CLR and how all of the .NET languages access it, the
major difference being the syntax and structure of the individual
languages. What I'm wondering, since VB.NET is obviously easier to
learn/use than C#.NET and C++.NET, why do these others exist (in the .NET
"format", not the standard library/compile to standalone .exe versions)?
VB.Net is proprietary to MS. C#.Net is not owned by MS, and it is under the
control of the ISO and ECMA standards committee. C++.NET can run as managed
code using the .Net Framework or C++.NET can run as unmanaged code not
needing the .Net Framework.
I've read discussions in forums and newsgroups from others saying C# is
better than VB for this and that or VB is easier to use (which it is) but
if they're all accessing/using the same .NET runtime then what's the
point? I'm not being cynical; I'm just confused as to why I should bother
learning C# if it isn't better or worse than VB. I'm probably missing
something here and if so I'd really like to know what it is.

Maybe some developers don't know either one of the languages. Why should
they? Maybe, COBOL is the language that's needed, because COBOL is still
being used.

http://www.startvbdotnet.com/dotnet/languages.aspx
 
I do not agree that VB is aimed at casual programmers.

Me, too. However, sadly it's the folks at MS themselves who spread
nonsense like this.

http://www.microsoft.com/express/windowsdevelopment/

"Visual Basic
Productivity that is ideal for first time or casual Windows
programming.

Visual C#
A great combination of power and productivity for the Windows
developer.

Visual C++
Horsepower with a finer degree of control than other Express
Editions."

Wolfgang
 
Wolfgang Enzinger said:
Me, too. However, sadly it's the folks at MS themselves who spread
nonsense like this.

http://www.microsoft.com/express/windowsdevelopment/

"Visual Basic
Productivity that is ideal for first time or casual Windows
programming.

That's just because, if not with VB, where else could they have put the word
"casual"? They would have left out this target audience completely. The
problem is that this gives a wrong picture because it is not _only_ for
casual programmers, also for ambitious projects. The productivity is
extraordinary, as we both know. :)

My personal interpretation of their statement.
Visual C#
A great combination of power and productivity for the Windows
developer.

Visual C++
Horsepower with a finer degree of control than other Express
Editions."


Armin
 
Zach,

VB is the number 1 program language for Microsoft
C++ is the number 2 program language for Microsoft
C# is the number 3 program language for Microsoft.

For a VB6 developper is VB for sure easier to learn, for schoolkits C# is
definitly better in this situation, because with VB you have plenty of
posibilities to get to the same result and most starting programmers have
much problems with that.

If VB is better than C# is mainly a personal taste, as you are all day busy
as casual as possible to create working business programs, then VB is in my
idea absolute better, because the time you need to make a program is
probably 50% as with C#.

However C# is more strict. Where VB helps you to correct wrongly typed code,
you can often see in C# typing errors after building the program again. That
is however better if you are learn to program.

The resulting code will normally be the same, both have the same speed in
processing, although that depends of course how it is made by the programmer
as well.

As C# is more educated to kits you see on Internet typical kit behaviour.
They shout that what they have learned is the best.
As you are a little bit more mature you can take your own conclussion from
that.

That text you have seen is made by marketing people, as you are a long time
developer you know what to think about that.

jmo

Cor
 
Jack,

Although it is always told about verbose by C programmers (which are
probably only talking about Basic 1.0)

String A = "Hello";
DataSet B = new Dataset()

Dim A = "Hello"
Dim B as New Dataset

What is in your opinion more verbose

As I wrote jmo

Cor
 
Armin Zingler said:
:-D This is one of the funniest statements I've ever read in this group
in
the past years. Hey, another one: C++ was invented for children between 3
and 6. Then they feel bored and upgrade to C#. I'm convulsed with
laughter.

Actually my statement was quite mature and factual. Your statement was
childish. Features such as VB continuously compiling in the backgroup slows
down the development environment. For someone who is programming all day
every day this gets annoying. Especially because corporate users can't
always have the latest PCs due to company policy as when to replace them.
I'm stuck with a celery 2.6 and VB does struggle with it.

What I say makes a lot of sense, the casual programmer likes to see "Dim X
as Integer" spelled out for them, whereas a professional only needs the
basic minimums and doesn't want the hassle of typing keywords all day.
Zach, C# and VB are very close together. Each has some advantages over the
other. So, it's mainly a matter of taste. Exceptions prove the rule. You
can
start another long discussion as they have already taken place in the past
years, or you just can believe me, who writes programs for over 20 years
now, in Assembler, Pascal/Delphi, C#, C++ and several versions of Basic.
Mr.
Michael C seems to be a troll gracing us with his presence lately.

Odd that you call me a troll and then act like a child just because I say
something that you don't want to hear.

Michael
 
Jack Jackson said:
As someone who has written C and C++ code for over 20 years, I now
prefer VB.NET to C#. Yes it is a little more verbose, but I like
that. C# can be very cryptic sometimes, and the small number of
things you can't do in VB.NET are not things that affect me very much.

I'm the other way around, I've done mainly VB for many years but much prefer
C#. Generally it's the little things such as
- intellisense, they seem to have got it all right in C# and a little bit
wrong in VB. THe number of times a day I have to push the escape key is
incredible. There's about 5 different things wrong with the intellisense
which I could list if you like. I'd have to be in front of my work PC to
list them all though.
- the way it compiles in the background continuously which makes everything
quite slow.
- the fact that pointers is missing. The only thing I use pointers for is
bitmap or video manipulation but it's suprising when this need arises even
on boring business apps.
- anonymous methods missing. It's anoying when you're getting into the
latest features just to find they're not all there.
- the need to specifically set option strict on. In a team environment any
strictness you can enforce is a *really* good thing.
- having to set *every single control* to be private is really annoying.
- legacy statements such as exit sub and on error goto. I know you can just
avoid using these but if you're in a team it's better if the environment
enforces greater strictness. I'm currently fixing up an app that is full of
reckless abandon and it's quite a big job.
- the way it allows inconsistancies such as dim x() as string and dim x as
string() being the same thing and being able to call a function without
empty brackets. This last one is really interesting when a function with no
parameters returns an array, you can call it like this

MyFunction(6)

This looks like you're passing in a parameter of 6 but in fact you're
getting the element at index 6 from the returned array. Yuk!
I do not agree that VB is aimed at casual programmers.

That's a fairly bold statement from a C++ programmer :-) Some of the things
I've listed above would say otherwise (continuous compile, lack of pointers,
less strict environment, having controls default to public + more verbose
syntax, simpler event handling, redim statement, withevents).

I know there's stuff you can do in C# that VB can't do but is there anything
VB can do that C# can't? I don't mean stuff like the handles keyword (which
I do quite like) because you can do it other ways in C#. As an example, VB
does not do pointers which means you cannot get the speed out VB that you
can out of C#.

Michael
 
Zach said:
After having taken a looong break from VB (last used 6.0), I started
getting back into programming again, this time with VS 2005. I began
reading up on VB.NET from various sources (books, internet, etc.) and
found out about the CLR and how all of the .NET languages access it, the
major difference being the syntax and structure of the individual
languages. What I'm wondering, since VB.NET is obviously easier to
learn/use than C#.NET and C++.NET, why do these others exist (in the
.NET "format", not the standard library/compile to standalone .exe
versions)?

C++/CLI is the migration/maintenance path for C/C++ code.
C# is the migration path for C/C++ and Java programmers.
VB is for people who love to be productive!
 
Michael C said:
Personally for me just having to type all the keywords that are required
in vb is enough to make me prefer c#. eg function, sub, dim, as,
directcast, not, I must type these 1000+ times a day and am really sick of
typing them, especially directcast. :-)

I wonder if you have ever used VB in the VS IDE, as most keywords are
inserted automatically and/or provided in context-aware IntelliSense menus.
 
Cor Ligthert said:
Although it is always told about verbose by C programmers (which are
probably only talking about Basic 1.0)

String A = "Hello";
DataSet B = new Dataset()

Dim A = "Hello"
Dim B as New Dataset

What is in your opinion more verbose

Well, you could shorten the above code using C#'s 'var' keyword!
 
Herfried,

You are right, that was the way I had made it first in my message.
However you cannot go around that ';' and senseless empty method
parentheses
(I forgot one ";", you probably have seen that)

-)

Cor
 
Zach said:
After having taken a looong break from VB (last used 6.0), I started
getting back into programming again...

I appreciate the info and feedback. Looks like a small can of worms
might have been knocked over during some of the discussions but what the
hell...that's what keeps it interesting. I think I'll get up to speed
with VB then dive into the shallow end of C# before swimming into deeper
waters. I still program with Delphi and have always liked it but want
to add another language or two to my toolbox. Nothing wrong with
keeping current and besides, this is one old dog that can learn new tricks.

Zach
 
Hi Zach -

Over the years, the differences between VB.NET and C# have been slowly
wearing away. There are only a handful of applicable differences now, with
each language having some unique features the other doesn't. I think for
about 90% of projects, you'll never run into these differences.

The greatest complaint you hear is that VB.NET is much more verbose than C#.
This is true, but in practice it doesn't matter much. Visual studio fills in
the code block End X statements so you don't have to type them out.

The second complaint you hear is that VB.NET code is poorly written. I think
this is unfair. The fact is that VB.NET's verbosity makes it more
approachable to new programmers. Of course these new programmers are going
to make mistakes and have lousy code. But there is nothing intrinsic about
C# that makes the resultant MSIL better.

The whole argument is ridiculous. It's like saying that a novel written in
British English is intrinsically better than American English because it
refers to the car's storage area as a "boot" instead of a "trunk".

I can't believe this is still a matter being discussed. This acutally came
up in a conversation I had at lunch recently. I was dining with a young man
who knew C#. It was the only language he knew. He thought very lowly of
other languages, but when it came down to it, it was really a matter of him
looking at VB code and being out of his comfort zone.

I think people get used to a particular language and that's the one they
stick with. Most of the time, their language decisions weren't even theirs;
their company standardized on one or the other, and that's simply where the
bulk of their experience lies. It's uncomfortable to work in a language that
you're not used to. There's a learning curve involved.

Anyway, that's what it comes down to, IMHO. Just a preference, nothing more.
It's always a good idea to diversify and learn many languages so you can
fluff your resume a bit, though. Good luck with your training.

Cheers,

-M
 
Zach,

VB is the number 1 program language for Microsoft
C++ is the number 2 program language for Microsoft
C# is the number 3 program language for Microsoft.

For a VB6 developper is VB for sure easier to learn, for schoolkits C# is
definitly better in this situation, because with VB you have plenty of
posibilities to get to the same result and most starting programmers have
much problems with that.

If VB is better than C# is mainly a personal taste, as you are all day busy
as casual as possible to create working business programs, then VB is in my
idea absolute better, because the time you need to make a program is
probably 50% as with C#.

I don't believe that for 1 second. Not one. 50%. LOL.
 
I wonder if you have ever used VB in the VS IDE, as most keywords are
inserted automatically and/or provided in context-aware IntelliSense menus.

The appear in C#'s to. Plus, you don't have to press enter to get your menus
for adding using statements or auto-implementing interfaces or classes. C#'s
IDE is better, IMHO.
 
Back
Top