Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / October 2007

Tip: Looking for answers? Try searching our database.

Need some advice!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Robert - 23 Oct 2007 07:45 GMT
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
Robert - 23 Oct 2007 07:58 GMT
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!

> Hello,
>
[quoted text clipped - 21 lines]
> With regards
> Rob
Carl Daniel [VC++ MVP] - 23 Oct 2007 15:20 GMT
> Hello,
>
[quoted text clipped - 4 lines]
> 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
Peter Oliphant - 23 Oct 2007 16:05 GMT
> In the near future (5 to 7 years) will C++ be buried by C#? What do you
> think about this?

>>Yes, that's correct (raylopez99)

>> 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==]

>> Hello,
>>
[quoted text clipped - 57 lines]
>
> -cd
Brian Muth - 23 Oct 2007 16:35 GMT
> Interesting. Does this mean MS is trying to inhibit us from writing ANY
> hardware drivers? If not, what does MS expect us to use?

C

Brian
Carl Daniel [VC++ MVP] - 23 Oct 2007 16:56 GMT
>> In the near future (5 to 7 years) will C++ be buried by C#? What do
>> you think about this?
[quoted text clipped - 8 lines]
> 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
David Wilkinson - 23 Oct 2007 17:09 GMT
> 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
[quoted text clipped - 5 lines]
> 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

Signature

David Wilkinson
Visual C++ MVP

raylopez99 - 23 Oct 2007 09:45 GMT
> Hello,
>
[quoted text clipped - 4 lines]
> 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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.