About C++ and C#

About C++ and C#

Postby Yoda » Fri Aug 24, 2007 10:44 pm

Greetings.



Cuchulainn: You seem a little inclined toward C++. You seem

to be liking it more than C#. Perhaps just because you grew up

with it, among other things. Maybe I'm wrong because, as we

know, you're writing a book about C#. :) Or are you mainly

writing that book because it's easier to teach people C# and

you gradually plan to move toward C# in your courses?



Don't get me wrong. I have of course nothing against C++,

but the following are some of my thoughts.



I'm using C# in my work and I plan to stick with it for a while.

I like being able to just write my apps with ease and concentrate

on the part that should truly be the hardest part: To find out what

to program. It shouldn't be (in my opinion) one of the hardest and

time-consuming parts of the project to actually find out how to do

the actual coding. The project should be all about the ideas behind

the code.



People talk of performance. Today it may be true that C++ can, in

case of a very seasoned C++ programmer who knows what he's

doing, provide significantly better performance than C#.



However, I heard a story that goes something like this: When C was

invented, good assembly programmers complained that C was too

slow. Then we got better hardware and everyone was happy. Next,

we get OO languages and people started complaining again. Until we

got better hardware.



Perhaps we'll get to the point where languages like C# won't be

judged inefficient anymore? Plus, how more high-level than C#

can languages actually get? We will come to the point where we

need no higher level, while hardware will continue to get better.



Anyway, these were just some thoughts of mine. Feel free to

delete them if I have gone way off the topic that this forum is

supposed to be about. :?



Regards,

Yoda.
Yoda
 
Posts: 4
Joined: Wed Aug 22, 2007 10:39 pm

Postby Cuchulainn » Mon Sep 03, 2007 10:55 am

Hi Yoda,

Thanks for the post. I have posted a blog on C++ versus C# that may answer your questions.



Many production systems are in C++. C# has a good future IMO and is efficient and clean. So sticking with C# would not be a bad idea.





hope this helps



Daniel



You seem a little inclined toward C++. You seem

to be liking it more than C#. Perhaps just because you grew up

with it, among other things.[/q]



I started with C++ in 1989, 'grew up' on Fortran and Cobol :wink:
User avatar
Cuchulainn
 
Posts: 669
Joined: Mon Dec 18, 2006 2:48 pm
Location: Amsterdam, the Netherlands

Postby Yoda » Mon Sep 03, 2007 3:31 pm

Hi Daniel. Thanks for your reply! Very good indeed. :D
Yoda
 
Posts: 4
Joined: Wed Aug 22, 2007 10:39 pm

Postby Cuchulainn » Mon Sep 03, 2007 4:25 pm

Yoda,

You're welcome



If you have any Q you know where to find me.
User avatar
Cuchulainn
 
Posts: 669
Joined: Mon Dec 18, 2006 2:48 pm
Location: Amsterdam, the Netherlands

Postby zhouxing » Mon Jun 29, 2009 2:35 pm

C++ v.s. C# or C++ v.s. Java is a forever topic :-) In my view, they are not really apple-to-apple.



C++ is just a programming language that is suitable for writing (core/analytic) libraries or "simple" application for the past. By simple application, I mean things like console application. Of course, you can write many fancy GUI applications using C++ as many people have done. But first it's not an easy job (just comparing with writing same GUI using VB). And, for the sake of this discussion, you have to use some extensions, from Borland OWC to MSVC whatever. They are not party of the C++ standard. Threading, networking ... are all not part of the standard. (well, there are widely accepted libraries, but regardless, they are not the C++ standard)



By comparison, C#/Java can be viewed as next generation which not only contains almost all the C++ capacities (e.g. logic flow control, basic I/O, STL container alike ....), but also built-in support for developing modern applications (e.g. thread, GUI, distributed computing ....)



As such, if you just compare them within the context of writing core analytic library, clearly C++ has advantages because, to some extents, this is what C++ is designed for. (If we put OOP aside, FORTRAN can be equally good, if not better, in this space). But if you are thinking of writing an application with those features that non-geeks take for granted today, C#/Java may be much better and productive.
zhouxing
 
Posts: 4
Joined: Mon Jun 29, 2009 12:20 am

Postby Cuchulainn » Sat Aug 15, 2009 10:40 am

I find C++ vs C# a non-issue. Use both depending on what is more suitable.



And with C++/CLI you can use both at the same time.
User avatar
Cuchulainn
 
Posts: 669
Joined: Mon Dec 18, 2006 2:48 pm
Location: Amsterdam, the Netherlands

Postby Cuchulainn » Tue Oct 06, 2009 10:52 am

Here is a short note on the C#/C++/COM interoperability discussion. It may be useful as a guide.
Attachments
C# and C++ interoperability.pdf
(293.59 KiB) Downloaded 2434 times
User avatar
Cuchulainn
 
Posts: 669
Joined: Mon Dec 18, 2006 2:48 pm
Location: Amsterdam, the Netherlands


Return to C++

Who is online

Users browsing this forum: No registered users and 1 guest

cron