Need some advice!

G

Guest

Hello,

Okay, after a few searches on Google such as, "what is .NET" and "what is
C#" I am now starting to see what all this means...

C++ is a language, and so is C#. You can get these languages in Visual
Studio. We can somehow program in C# and when we require the power of C++, we
can call some C++ code... right?

Also C# posesses a large quantity of special classes and these are available
in .NET frameworks, or atleast I think so????

Anyways my question is this, I have some basic experience in C++
(approxomately 2 years) and now I see that C# may simplify coding. But at the
same time I do not want to loose what I have learnt in C++. Can someone
suggest me a good book that merges the the two languages or must I continud
learning C++ from one book and C#from another book?

Also, does one have to know C++ *very well* before they can go onto C#.

In the near future (5 to 7 years) will C++ be buried by C#? What do you
think about this?


With regards
Rob
 
G

Guest

One more thing I forgot to ask. This will help me understand what I am
getting into if I do decide to shuffle the two languages. In C#, can I write
a driver to communicate some data over USB? Just curious!

Thanks for all feedback!
 
R

raylopez99

Hello,

Okay, after a few searches on Google such as, "what is .NET" and "what is
C#" I am now starting to see what all this means...

C++ is a language, and so is C#. You can get these languages in Visual
Studio. We can somehow program in C# and when we require the power of C++, we
can call some C++ code... right?

Not exactly--it's hard to mix and match languages. Better to stick to
one or the other.
Also C# posesses a large quantity of special classes and these are available
in .NET frameworks, or atleast I think so????

Correct. The new .NET framework for GUIs is called ".Forms"--much
better than the old MFC library--it's drag and drop using wizards and
so-called "delegates"--a child could do it.
Anyways my question is this, I have some basic experience in C++
(approxomately 2 years) and now I see that C# may simplify coding. But at the
same time I do not want to loose what I have learnt in C++. Can someone
suggest me a good book that merges the the two languages or must I continud
learning C++ from one book and C#from another book?

For now, there's now book called "C# for C++ programmers" (unlike Ira
Pohl's excellent book "C++ for C programmers", which is how I learned C
++). The best book on C# has just been published by O'Reilly this
fall (released about a month ago). I am using an old book "C# Beta
version" from ~2000 and it's working fine, in conjuction with my C++
books (the two languages are very close, except essentially you use
tracking references in managed C++ rather than tracking pointers in
managed C++).

Also, does one have to know C++ *very well* before they can go onto C#.

No, but it helps.
In the near future (5 to 7 years) will C++ be buried by C#? What do you
think about this?

Yes, that's correct.

As for your last question, about writing a USB driver, this is very
hard to do in either language (the IO library of C++ is very
complicated and not well documented--I could not find a single book on
it when I once looked-- and to my knowledge--I could be wrong--there's
no equivalent in C#). Most drivers for USB are actually written (from
what I've heard) in C, not an OOP, but I'm sure the more experienced
programmers here will point out counterexamples.

Happy coding!

RL
 
C

Carl Daniel [VC++ MVP]

Robert said:
Hello,

Okay, after a few searches on Google such as, "what is .NET" and
"what is C#" I am now starting to see what all this means...

C++ is a language, and so is C#. You can get these languages in
Visual Studio. We can somehow program in C# and when we require the
power of C++, we can call some C++ code... right?

Yes, but you don't want to switch back & forth willy-nilly. There's
overhead and complexity envolved in the transition, so if (and it's a big
if) you use both C# and C++, you want to make a clear distinction between
which parts are implemented in which language, with a properly defined
interface between them.
Also C# posesses a large quantity of special classes and these are
available in .NET frameworks, or atleast I think so????

It's the .NET framework that has the classes. C# just uses them. You can
use them from C++/CLI (the CLR flavor of C++) as well.
Anyways my question is this, I have some basic experience in C++
(approxomately 2 years) and now I see that C# may simplify coding.
But at the same time I do not want to loose what I have learnt in
C++. Can someone suggest me a good book that merges the the two
languages or must I continud learning C++ from one book and C#from
another book?

I wouldn't recomment trying to merge them. While the languages are very
similar, they're also very different. Mastering either one gives you a good
foundation for mastering the other.
One more thing I forgot to ask. This will help me understand what I am
getting into if I do decide to shuffle the two languages. In C#, can
I write a driver to communicate some data over USB? Just curious!

No, you can't. Officially, you can't write a driver in C++ either, although
unofficially, people do. (It's not that C++ is inappropriate for drivers -
it's actually very appropriate. Rather, it's that Microsoft doesn't support
using their C++ compiler for writing drivers, and there are some gotchas if
you decide to go "off road" and do it anyway).
Also, does one have to know C++ *very well* before they can go onto
C#.

No. In fact, you're probably better off not knowing C++ at all when it
comes to learning C# (rather, I think the other way 'round is the more
natural learning curve; C# first then C++ when and if you need it).
In the near future (5 to 7 years) will C++ be buried by C#? What do
you think about this?

No, not a chance.

C#, like Java, will continue to displace C++ in certain application domains
and, like Java, will continue to leave some application domains unserved.
The CLR itself is actually written in C++, as is the C# compiler, the VB.NET
compiler, and much of the core of the .NET framework classes. There will
always be a place for C++.

-cd
 
P

Peter Oliphant

In the near future (5 to 7 years) will C++ be buried by C#? What do you
think about this?

No, not a chance. (you)

Interesting that both of you put your answers in absolutlely certain terms,
yet you totally disagree! :)

However, I believe you are correct, since C# is OWNED by MS, and thus can't
be sold by anyone else who makes computer languages. But anyone can write a
C++ compiler, the details for this language are in the public domain. If C#
completely replaced C++ in the world, then MS could charge $10,000 per copy
for C# and we would all have to buy. Hence, C++ is here to stay (at least as
long as C# anyway).
No, you can't. Officially, you can't write a driver in C++ either,
although unofficially, people do. (It's not that C++ is inappropriate for
drivers - it's actually very appropriate. Rather, it's that Microsoft
doesn't support using their C++ compiler for writing drivers, and there
are some gotchas if you decide to go "off road" and do it anyway).

Interesting. Does this mean MS is trying to inhibit us from writing ANY
hardware drivers? If not, what does MS expect us to use? I can't believe
they would push us to OTHER software package to write hardware drivers, as
new hardware is developed all the time, and of course require drivers. I
ould think MS would want us to use their tools to develop these as well.

And since I haven't seen anything like MS VS ASM 2005/2008
Express/PRO/whatever, I guess we can't use ASSEMBLY LANGUAGE either. What
ARE we suppose to use for hardware drivers then?

[==Peter==]
 
C

Carl Daniel [VC++ MVP]

Peter said:
Interesting that both of you put your answers in absolutlely certain
terms, yet you totally disagree! :)

This debate comes up every few months. C++ isn't going anywhere. C# is
here to stay. There's room for both.
However, I believe you are correct, since C# is OWNED by MS, and thus
can't be sold by anyone else who makes computer languages. But anyone
can write a C++ compiler, the details for this language are in the
public domain. If C# completely replaced C++ in the world, then MS
could charge $10,000 per copy for C# and we would all have to buy.
Hence, C++ is here to stay (at least as long as C# anyway).

Anyone can make a C# compiler - it's ECMA standard 334 (with additions).
See the Mono project for *nix, for example. The standard is, at this point,
pretty much controlled by MSFT, but at this point in the languages life,
that's probably not a bad thing.

-cd
 
D

David Wilkinson

Peter said:
Interesting. Does this mean MS is trying to inhibit us from writing ANY
hardware drivers? If not, what does MS expect us to use? I can't believe
they would push us to OTHER software package to write hardware drivers, as
new hardware is developed all the time, and of course require drivers. I
ould think MS would want us to use their tools to develop these as well.

And since I haven't seen anything like MS VS ASM 2005/2008
Express/PRO/whatever, I guess we can't use ASSEMBLY LANGUAGE either. What
ARE we suppose to use for hardware drivers then?

Peter:

You can use the VC++ compiler to write drivers in C, just not C++.

VC++ is really three compilers

C compiler
C++ compiler
C++/CLI compiler
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top