PDA

View Full Version : C++ vs. C-Sharp


danielclarkz
08-30-2002, 10:25 AM
Well. All this hype about .NET. Is C# any better than C++? Im sure this will be a nice debate :P Well, im just curious of what you guys would say here. I mean C# looks like a nice language to me but just to Microsoft. Like i dont think .NET is that great. So im sure this will get alot of nice responses.

Bradmont
08-30-2002, 12:52 PM
I don't know how well this can be debated, since the two languages are for very different purposes. C# vs Java would make more sense.

danielclarkz
08-30-2002, 01:32 PM
C++ and C# are for very diff purposes??? What do u mean?

sans-hubris
08-30-2002, 01:36 PM
Firstly, C# is a lot easier to implement than C++, from a compiler development stand point (Mono (http://go-mono.com) is already complete, but there are no fully standards-compliant C++ compilers, not even the venerable gcc (http://gcc.gnu.org).) C# is also easier on the memory than C++ since there is no memory management that the developer has to worry about. However, this means you have less control over speed and efficiency. ADDENDUM: C# is also fully OO like Java, whereas C++ provides OO capabilities in addition to C-like procedural programming (there are times when it's easier to deal with a global function than to have to call it from a class.) C++, unlike C#, provides the capability for complete multiple inheritance. Also unlike C#, C++ provides operator overloading, which can, in some instances, make coding easier (e.g. allowing for normal mathematical operations on some Matrix or Vector class.)

As Bradmont said, C# and C++ are very different creatures, and it would be like comparing a desktop computer and a laptop. The two are similar, but each has a very specialized purpose.

Strike
08-30-2002, 02:14 PM
sans-hubris: I like that desktop/laptop analogy, good show

Well, I was going to come in and say something like what sans-hubris and Bradmont said, but ... they already said it ;) For power, speed, and a focused user base - C++ would be my choice. For universality - C#

Strike
09-05-2002, 09:03 PM
Ack! THIS was the post that keeps coming back to haunt me! (or maybe they both did!) WTS! It has me listed as posting on this thread today, but the last post (before this) is OBVIOUSLY on August 30th!

AAAAAAAAAAAAAAAAAAAAAAAGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH!!!

kmj
09-05-2002, 10:34 PM
heh; I never use that "check new threads" thingy..

bwkaz
10-21-2002, 02:15 PM
Did someone (other than me) just vote on this poll?

The last post here is from a month and a half ago, yet this thread (and the C#/Java one) both just showed up as having unread posts.

(This wasn't in the "check new threads" thingy, just on the main forum view.)

Maybe the reason it seems possessed is that people keep voting in the poll?

And Strike, maybe it said you posted because the last "post" date was that day, and the last post was from you? Regardless of the fact that your post's date wasn't actually that day?

I'm wondering if this might be a bug in the forum software...

Strike
10-21-2002, 03:44 PM
I'm pretty convinced it has to do with the # sign in the topic name. I'm pretty convinced that that leads to some obscure vBulletin bug wreaking havoc. It did it again for me, but I seemed to be the only one mentioning it before so I thought it was a remote, one or two time thing. But it did it again here on Windows as well, so I'm convinced it's a bug, and the two threads that do it both have the common attribute of a "#" in the subject line.

sedarious
10-28-2002, 03:09 PM
Last Post: 10-28-2002 01:17 PM by Strike

Is this what we are talking about? Looks like a bug to me. I have never seen a misreport on last post time/date before this though.

sans-hubris
10-28-2002, 04:09 PM
Well, I'm going to change the title so that this thread can die a natural death. Note, however, I'm not going to actually close the thread, so if people want to respond, and keep it alive for some strange reason, feel free to.

bwkaz
10-28-2002, 05:56 PM
Is there anyone that hasn't voted on the poll yet? If so, wait a week and then do it; see if it comes back.

Go ahead and call me stubborn ( :P ), but I still think it's 'cause it's a poll. We shall see, though.

sans-hubris
11-06-2002, 01:44 AM
Hey, how'd this poll pop back up to the top?!

bwkaz
11-08-2002, 03:33 PM
OK, it just did it again. There are 18 votes now. Next time this thing comes to the top, my guess is that there will be 19. We shall see (I'm posting this more as a reminder for myself of how many votes there are now)...

Strike
11-14-2002, 09:43 AM
Originally posted by bwkaz
OK, it just did it again. There are 18 votes now. Next time this thing comes to the top, my guess is that there will be 19. We shall see (I'm posting this more as a reminder for myself of how many votes there are now)...
Yup, that clinches it (though the ad poll pretty much confirmed my suspicions).

7-12-Twice
12-29-2002, 04:32 PM
Thanks sans, I was always curious about what the differences were. I know C++, but barely know anything about C#. Just one question...
Originally posted by sans-hubris
C# is also fully OO like Java, whereas C++ provides OO capabilities in addition to C-like procedural programming (there are times when it's easier to deal with a global function than to have to call it from a class.) C++, unlike C#, provides the capability for complete multiple inheritance.
What is "multiple inheritance?"

Strike
12-29-2002, 06:17 PM
Inheriting from multiple base classes.

nanode
05-09-2003, 06:26 PM
To a novice C# has the appearance of multiple inheritance, but it's similar to java.

public class Foo : SomeBaseClass, InterfaceA, InterfaceB
{
//...
}

Just remember that any baseclass is first after the : and the rest have to be interfaces.

I liked c# so much I've started working @ MSFT as an API tester for the Visual Studio team. Open source and java are still my favorite, but I had a mortgage to pay etc...

sicarius
05-12-2003, 04:00 PM
Originally posted by sans-hubris
...Also unlike C#, C++ provides operator overloading, which can, in some instances, make coding easier (e.g. allowing for normal mathematical operations on some Matrix or Vector class.)



Actually, C# does provide for operator overloading.


If you are seriously considering the next language to learn for windows programming than C# is definitely what you want to go for. The .NET framework will eventually replace the older win32 API as MS's main API. Using the .NET framework from inside of C++ is possible, but not pretty. You also don't have the same benifits that C# would give you when using .NET because C# was specifically designed to make use of most of the Common Language Runtime's features.

c0nverg3
07-05-2003, 02:16 PM
All of the languages (C++, Java, C#) are for different purposes.


So comparing them is not really the easiest thing to do.


Even C# vs. Java is still kinda hard.

If you must know...


C# is:
70% Java
10% C++
5% Other
15% New

This is just my opinion...

-C0N VE RG E

gish
07-05-2003, 02:43 PM
yeah..that is your opinion...

since C# is 100% a new language. It may have been created to behave "70%" like java, and look 70% like Java to "steal" the java developers...and in my opinionl C# performs 170% better/faster. And no one can agrue that.

If one wishes to agrue regarding performance java vs C#, please provide a java and a C# application to compare results/speeds.