C# vs. C++

  • Thread starter Thread starter Stuart Willcocks
  • Start date Start date
S

Stuart Willcocks

Hello

I am intending to upgrade to either C++.NET or C#.NET but
I need some guidance. I have a fair amount of experience
with VB6 and a little with Visual C++ 6.

My interest is mainly in industrial control applications.
I'm not really interested in database applications, web
development, etc.

In particular, the following questions come to mind:

1) How do C++.NET and C#.NET compare in terms of ease of
use and learning curve? My VB knowledge is fairly good, my
Visual C++ 6 is a little rusty.

2) Are things like serial communications more easily
achieved in one language than the other? I seem to recall,
for example, that I had to hunt around for a third party
serial port class for use with Visual C++ 6. Something
like VB's MSComm control would be great.

3) Is there any difference in the efficiency / speed of
the executables generated by each platform?

4) Is muti-threading easier to achieve in either language?

Thanks for reading this far - I'd be very grateful for any
opinions that you might have to offer.

Stuart Willcocks
 
Stuart,

please see remarks/comments inline

Stuart Willcocks said:
Hello

I am intending to upgrade to either C++.NET or C#.NET but
I need some guidance. I have a fair amount of experience
with VB6 and a little with Visual C++ 6.

My interest is mainly in industrial control applications.
I'm not really interested in database applications, web
development, etc.

In particular, the following questions come to mind:

1) How do C++.NET and C#.NET compare in terms of ease of
use and learning curve? My VB knowledge is fairly good, my
Visual C++ 6 is a little rusty.

Managed code using VC++ is dramatically different from MFC and Win32 API
VC++ programming. All of the things that you may have come to know and love
in classic VC++ are gone in MC++, or at best they work so different as to
not be recognizable. I've been programming in VC++ for the past 6 years,
and in C++ since the mid '80s, and a year or so ago took up the .Net
approach. The biggest problem for me with MC++ was forgetting that pointers
(and therefore arrays) operate very differently. C# for me was a lot easier
because it was a new language, ergo something that I would have to learn
(contrasted with MC++ as something that I would have to forget). That will
change significantly with Whidbey, but for now VC++ and MC++ have three
characters in common in the name - but the similarities are hard to find
beyond that.
2) Are things like serial communications more easily
achieved in one language than the other? I seem to recall,
for example, that I had to hunt around for a third party
serial port class for use with Visual C++ 6. Something
like VB's MSComm control would be great.

no difference there --
3) Is there any difference in the efficiency / speed of
the executables generated by each platform?

Don't know about that one -- we tend to get way more excited about developer
productivity, network bandwidth availability, and product stability. Most
of our apps are desktop user apps, and server apps that provide interfaces
to backend databases - raw speed at the desktop is not too critical,
especially if you have a user pondering information on the screen (VC++
waits on the user at pretty much the same speed as does C#). We like the
feature of language independent projects these days -- let the developer
choose what language to use for the task at hand. C# seems to win more
times than not (we do only C# and MC++, no VB)
4) Is muti-threading easier to achieve in either language?

Both langages support multithreading quite nicely in .Net - it is not quite
the same as CRT functions such as _beginthread and so on in classic VC++,
but, still quite functional.
Thanks for reading this far - I'd be very grateful for any
opinions that you might have to offer.

Pick the one you are most comfortable with. there seems to 100x more
literature, notes, support, and instructional info for C# than for MC++.
That may change in time, but for now it seems that C# is the favorite at
Microsoft, with the publishing community, and with developers.

roy fine
 
Stuart Willcocks said:
Hello

I am intending to upgrade to either C++.NET or C#.NET but
I need some guidance. I have a fair amount of experience
with VB6 and a little with Visual C++ 6.

My interest is mainly in industrial control applications.
I'm not really interested in database applications, web
development, etc.

In particular, the following questions come to mind:

1) How do C++.NET and C#.NET compare in terms of ease of
use and learning curve? My VB knowledge is fairly good, my
Visual C++ 6 is a little rusty.

C#, like Java, is intended to "clean up" the language and make it
approachable and more abstract than C++. Both C# and Java succeed in this
endeavor, so C# is definitely easier.
2) Are things like serial communications more easily
achieved in one language than the other? I seem to recall,
for example, that I had to hunt around for a third party
serial port class for use with Visual C++ 6. Something
like VB's MSComm control would be great.

In terms of componentization, the effort is the same between Managed C++ and
C#, although with C++ (any version) you're still mucking with the language a
bit more than in C#. You can still use MSComm in C#, by the way, although
most people, I have been told, hate it. There are third party serial port
components written in C# out there, though, and I think one might be
available for free.
3) Is there any difference in the efficiency / speed of
the executables generated by each platform?

C# is going to be slightly slower, particularly with object creation and
pre-JITting. If you are using an unmanaged component that does the bulk of
the work (like the new Managed DirectX 9.0 libraries, etc.) then this isn't
too much of an issue.
4) Is muti-threading easier to achieve in either language?

It is the same between Managed C++ and C#.

HTH,
Jon
 
-----Original Message-----
Stuart,

please see remarks/comments inline



Managed code using VC++ is dramatically different from MFC and Win32 API
VC++ programming. All of the things that you may have come to know and love
in classic VC++ are gone in MC++, or at best they work so different as to
not be recognizable. I've been programming in VC++ for the past 6 years,
and in C++ since the mid '80s, and a year or so ago took up the .Net
approach. The biggest problem for me with MC++ was forgetting that pointers
(and therefore arrays) operate very differently. C# for me was a lot easier
because it was a new language, ergo something that I would have to learn
(contrasted with MC++ as something that I would have to forget). That will
change significantly with Whidbey, but for now VC++ and MC++ have three
characters in common in the name - but the similarities are hard to find
beyond that.


no difference there --


Don't know about that one -- we tend to get way more excited about developer
productivity, network bandwidth availability, and product stability. Most
of our apps are desktop user apps, and server apps that provide interfaces
to backend databases - raw speed at the desktop is not too critical,
especially if you have a user pondering information on the screen (VC++
waits on the user at pretty much the same speed as does C#). We like the
feature of language independent projects these days -- let the developer
choose what language to use for the task at hand. C# seems to win more
times than not (we do only C# and MC++, no VB)


Both langages support multithreading quite nicely in .Net - it is not quite
the same as CRT functions such as _beginthread and so on in classic VC++,
but, still quite functional.


Pick the one you are most comfortable with. there seems to 100x more
literature, notes, support, and instructional info for C# than for MC++.
That may change in time, but for now it seems that C# is the favorite at
Microsoft, with the publishing community, and with developers.

roy fine

At the same time, developers have a choice of using VC++
or MC++ in .NET, right? E.g., if someone writes all of
their code w/o using managed extensions in VC++ .NET, it
will be all machine language, just like pre-.NET code. Am
i right?

P.S. On a side note, VC++ code that uses some managed
extensions is mostly machine language, and only the
managed parts of the code are decompilable?

Thanks,
rs.
 
You can write code in VC.NET that doesn't use
managedness, i.e. the .NET framework, but it's
technically more or less the same as writing it in VC6,
you just get a different IDE with its outlining, etc.
(Am I right?)
 
Back
Top