Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsDiscussion Forum → C/c++/c#
12
C/c++/c#
2005-03-09, 12:26 AM #1
Hey there,

I'm thinking of learning programming, and I noticed that a lot of people on this forum and elsewhere have mentioned the languages C, C++, and C# as 'the best'.

I'm just wondering. Are C/C++/C# all versions of the same language or are they seperate things? Like can C 'code' be used with C++ and C# or are they completely different? I am guessing that C is the 'parent' language, but please correct me if I am wrong.

Also, are any of these good languages to start with? I used BASIC a long time ago, but only did really simple things.

Thanks in advance for any help.
2005-03-09, 12:29 AM #2
C and C++ are based on the C coding language. C++ is an updated, and easier variant of the two to learn, and is among the most common languages in use for nearly all applications.

C# (and anything with a # for that matter [pronounced C-Sharp]) is a variant of the base language, in this case C, combined with Java (if I recall, I'm not a sharp programmer by any means). This would add a TON of versatility.

That aside, just don't ever learn Oracle. because it's a pain. and you will hate yourself for the rest of your life.
-=I'm the wang of this here site, and it's HUGE! So just imagine how big I am.=-
1337Yectiwan
The OSC Empire
10 of 14 -- 27 Lives On
2005-03-09, 12:31 AM #3
Unless you want to start with python or something, you might as well start with c/c++. Some people will invariably tell you to start with Java or visual Basic, but I disagree. Java isn't a bad choice, though. As for C#, it hasn't really caught on yet, it's a meld of C and java conceived by Microsoft and based on MS .NET framework. You'll do best to either delve right into C++ or learn Java and then jump to C++ from there. java and C++ have very similar syntax, and it's pretty easy to pick up one when you know the other.
"it is time to get a credit card to complete my financial independance" — Tibby, Aug. 2009
2005-03-09, 12:32 AM #4
I meant to mention Python. It's a great place to start. The great thing about it is all of the resources are completely free.

http://www.python.org
-=I'm the wang of this here site, and it's HUGE! So just imagine how big I am.=-
1337Yectiwan
The OSC Empire
10 of 14 -- 27 Lives On
2005-03-09, 12:50 AM #5
C and C++ were both developed by AT&T Bell Laboratories.

C was designed to be the language of choice for UNIX development. As a result, C and C-derivatives are considered standard for software development. C is more prominent in Linux development these days as part of its UNIX heritage. A complete conversion of the kernel to C++ was evaluated, but eventually decided against.
C is a formal language, one of the lowest-level cross-platform programming languages available today, and ideal for both system programming and application development.

C++ is an extension of C. All C code is still valid C++ code, which means C++ inherits all of the benefits of vanilla C.
The story behind C++ is quite long. The improvements available in C++ make large-scale project management far simpler and open up some degree of metaprogramming to developers.
The addition of objects is more or less illusory. It's not truly object-oriented. It's more like a procedural language wearing a pretty dress and a bow. If you don't understand how polymorphism and member procedure calls unroll you can make some pretty enormous mistakes.

C# is a C++-derivative developed by Microsoft to suit the .NET Framework. C# natively supports .NET types, a few new features (like for each), automatic referencing, garbage collection, overflow protection, reliable runtime type reflection, among other things. It's not C++ mixed with Java so much as C++ mixed with VB.

Ultimately C and C++ are tools designed for system programmers, while C# is suited for application development only. In my opinion C++ is the strongest language, since it allows you to do the absolute most. But they're all just tools, and C# has its place.

A final option would be Managed C++ - basic C++ that supports .NET Framework types and garbage collection at the expense of multiple inheritance.
2005-03-09, 12:55 AM #6
Oh, and regardless of which language you decide on (C/C++/C#) you'll want to do yourself a favor and pick up a copy of Visual Studio. Visual Studio is the most powerful IDE on the market today and it has a lot of features that will be absolutely invaluable to your learning progress.
2005-03-09, 1:25 AM #7
Quote:
Originally posted by Jon`C
Oh, and regardless of which language you decide on (C/C++/C#) you'll want to do yourself a favor and pick up a copy of Visual Studio. Visual Studio is the most powerful IDE on the market today and it has a lot of features that will be absolutely invaluable to your learning progress.

Yes. Listen to him. If you are a university student, you can probably pick up VS for a decent price. You will LOVE the debugger.

I swear by C++. I really don't like to do anything "C-style" If I can make classes, I will make classes. My operating systems class was a struggle because EVERYTHING was done in C. I had not done C programming for a while. I wasn't used to procedural programming and having globals. My first kernel I wrote in C++ (never did work too well).

I vote for C++ because of classes, polymorphism, and inheritance. It makes GUI programming A LOT easier and I have a lot of reusability. This is an important concept in programming. It's a waste of time to have your programs be written from scratch every time.

I have not (really) tried to use C#. Call me a stubborn old kurmudgeon, but I see no need for me to learn C#. Yes it might be easier in application development. But, I've survived with C++. But experiment around with the Cs to see what you like.
Quote:
Originally posted by Yecti
That aside, just don't ever learn Oracle. because it's a pain. and you will hate yourself for the rest of your life.

DEATH TO PL/SQL AND ALL ITS SATANIC INCARNATIONS!!!
Code to the left of him, code to the right of him, code in front of him compil'd and thundered. Programm'd at with shot and $SHELL. Boldly he typed and well. Into the jaws of C. Into the mouth of PERL. Debug'd the 0x258.
2005-03-09, 1:32 AM #8
Good info and suggestions, especially about Visual Studio. If you're a college student, you may be able to get it at a discount or for free. It's widely used among commercial software developers, so learning to use it is a plus if you plan to program professionally.

One other thing. C++ is not a complete superset of C, so there are some instances where C code will not compile as C++, or, even worse, where it will behave differently than intended. It's unlikely that a beginner would run into many (if any) of these issues, but it's a good thing to remember if you plan to learn both languages.
2005-03-09, 1:33 AM #9
Quote:
Originally posted by JediGandalf
DEATH TO PL/SQL AND ALL ITS SATANIC INCARNATIONS!!!
As with all things, it has its place. Although I'm slightly confused as to why it was mentioned in this thread in the first place... It's not an application programming language at all.
2005-03-09, 12:26 PM #10
the question was just what programming language.

You can write an ap in Oracle, you would just need to distribute it with all the source DLLs in tact in order to make it work (which would be either A-very costly or B-very illegal).

And to be honest, I was just stating my distaste for the language. /me goes back to writing oracle garbage.
-=I'm the wang of this here site, and it's HUGE! So just imagine how big I am.=-
1337Yectiwan
The OSC Empire
10 of 14 -- 27 Lives On
2005-03-09, 2:19 PM #11
I have to learn Oracle this year and next year at school... its so gay.. SQL is easy.. but its so boring... I would much rather be doing C++ programming.
2005-03-09, 7:02 PM #12
Am I the only one here who despises C++? Ill take C anyday, or short of that, Perl.



And C#...geeze, dont get me started...
And when the moment is right, I'm gonna fly a kite.
2005-03-09, 7:05 PM #13
What's so bad about C++?
2005-03-09, 8:00 PM #14
Quote:
Originally posted by gbk
Am I the only one here who despises C++? Ill take C anyday, or short of that, Perl.



And C#...geeze, dont get me started...
I would like to hear what you think are the disadvantages of C++ and C#. I'd also like to hear how much time you've spent working with both languages.
2005-03-09, 8:04 PM #15
Quote:
Originally posted by Jon`C
I would like to hear what you think are the disadvantages of C++ and C#. I'd also like to hear how much time you've spent working with both languages.

I bet you would like that, wouldnt you? :p
And when the moment is right, I'm gonna fly a kite.
2005-03-09, 8:08 PM #16
Quote:
Originally posted by gbk
I bet you would like that, wouldnt you? :p

The alternative would be to make up my own theory about your level of programming knowledge and post it here.
2005-03-09, 8:17 PM #17
Quote:
Originally posted by Jon`C
The alternative would be to make up my own theory about your level of programming knowledge and post it here.

Go for it, Im sure it would prove to be quite entertaining.
And when the moment is right, I'm gonna fly a kite.
2005-03-09, 8:19 PM #18
Quote:
Originally posted by gbk
Go for it, Im sure it would prove to be quite entertaining.

I'd rather you post your actual argument against C++ and C# first.

I can understand how you'd like Perl, but it's not terribly useful for systems-level programming. I'm interested to hear how you arrived at the conclusion that C was so much better than C++ and a language that has basically no support on your OS of choice.
2005-03-09, 8:21 PM #19
Memory allocation makes me so hot...

Wait...

Yay C++.

I'd say it's much better to start with C++ and not something like VB. A lot of things that never really made sense with VB made a lot more sense after learning C++.
2005-03-09, 8:26 PM #20
Quote:
Originally posted by Jon`C
...I'm interested to hear how you arrived at the conclusion that C was so much better than C++ and a language that has basically no support on your OS of choice.


I never said C was better, I said I preferred it. Distinct difference.
And when the moment is right, I'm gonna fly a kite.
2005-03-09, 9:37 PM #21
People typically have strong feelings against programming languages they don't understand or have experience with. Case in point: GBK. But there's no need to explain it, it's pretty well known GBK is a pseudo programmer.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2005-03-09, 9:40 PM #22
I know, I was just trying to get him to admit it.

It's like an intervention.
2005-03-10, 4:35 AM #23
The only thing C has over C++ is speed. :\
D E A T H
2005-03-10, 5:06 AM #24
Agreed. I think you should go for C++. It's what I use now. I tried C, and I prefer C++ to it. I have never tried C#, only seen code examples of it, so I don't now how good it is. And for VB, don't go near it. I started with it, and looking back now, I don't see any reason for doing so.
2005-03-10, 5:14 AM #25
It doesn't even have that. If you know what you're doing, C++ is every bit as fast as C. I'd even argue that some things are faster, since you have access to metaprogramming concepts that allow some calculations to be performed before compile.
The only overhead C++ carries is for things like polymorphism, but that's a compile time penalty. And then there's the penalty associated with runtime type information/reflection, but that is an extremely rarely-used and never-needed feature and it's always disabled by default in every single compiler I've ever used.

C++ is a superset of C. Stating that C is faster is implying that C++ carries a performance penalty for features that aren't being used, which simply isn't true.
2005-03-10, 5:15 AM #26
Bah, sometimes it would be nice to return to programming... nah.

I'll rather stay uneducated and complain why your glorious languages can't even break existing thing's source codes out of them. :rolleyes:
Star Wars: TODOA | DXN - Deus Ex: Nihilum
2005-03-10, 6:12 AM #27
Quote:
Originally posted by Jon`C
I know, I was just trying to get him to admit it....

Why? Its not as if Ive ever said anything else. Im not a programmer. I dont want to be one and Ive never professed to be one. Hell, I was never even that great of a cogger.


However, I *could* write my own version of CGI::IRC. It wouldnt be all that difficult.
And when the moment is right, I'm gonna fly a kite.
2005-03-10, 6:20 AM #28
I was 'taught' C programming in my first year at uni. Well, I went out, bought C for Dummies, and ditched the awful lectures.

I thought it was ok at the time, but on reflection wasn't all that special for what I need to do day to day. Despite my moaning about it, for making the sort of programs that are useful to me, MATLAB is the way forward.

(Most of the time spent in C classes was trying to get a graph to render: with MATLAB, you just tell it what data to plot, and it just does)

But that's because I'm going nowhere near as complexified as you guys :/
2005-03-10, 6:20 AM #29
Go with C++, the most used programming language in the computing industry. You get all the object-oriented aspects too. C is old. C#, from my understanding (I have used it only once or twice), is an application development language, based on C++ and the rapid visual interface development of VB. One doesn't need to learn the basics of C#, since it's really just the ability to use GUI objects.

I agree with ya, Darth, after learning Java and C++ after VB, I realized that there is so much lacking in the education of VB that is integral in programming, unfortunately.
2005-03-10, 7:26 AM #30
C is faster than C++ in every natural situation. My friend tried writing a DC game (he's working on one) in C++, then switched to C, and saw it run and compile much much faster. But of course, it also depends on how much you would use the various C++ functions for. If you use tons of objects and all the functions therein, it'd be extremely useful to use C++. Otherwise, you could probably do just as well with C (and it does have some very basic OO programming. Very basic)
D E A T H
2005-03-10, 8:05 AM #31
Quote:
Originally posted by Dj Yoshi
C is faster than C++ in every natural situation. My friend tried writing a DC game (he's working on one) in C++, then switched to C, and saw it run and compile much much faster. But of course, it also depends on how much you would use the various C++ functions for. If you use tons of objects and all the functions therein, it'd be extremely useful to use C++. Otherwise, you could probably do just as well with C (and it does have some very basic OO programming. Very basic)

What?

Wait... "tons of objects and all the functions therein". What do you mean? Operator overloading? RTTI (which is totally useless in every real situation)? I don't understand what you mean.

The only real overhead the OOP model incurs lies in function calls. If you derive a class 50 times, you're calling 50 constructors when you instantiate it. But pretty much any modern optimizing compiler should inline most of those unless they're huge. Additionally, all member functions have an extra hidden argument ('this' - thiscall, unless the function is static) that might impact performance... uh... slightly.

Virtually all of the performance differences between C and C++ are the result of beginner mistakes, like passing a huge class as a function argument (something that's automatically assumed to be a reference in true OOP languages).
2005-03-10, 8:23 AM #32
I meant polymorphism, inheritance, etc. just to clear that up.
D E A T H
2005-03-10, 12:28 PM #33
John Carmack finally switched to C++ for Doom 3 because when he started writing it he believed C++ was finally fast enough for (his) games. There was a big thing about it. And surely you believe your one and only god John Carmack, Yoshi.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2005-03-10, 12:38 PM #34
But the fact remains: it's ridiculous to say that C is faster than C++ if C code compiles in a C++ compiler. No one's forcing you to use late-binding or reflection, Yoshi. And those two things are your only real performance hits in C++. Unless you're a complete moron, inheritance is not going to slow anything down.
"it is time to get a credit card to complete my financial independance" — Tibby, Aug. 2009
2005-03-10, 3:24 PM #35
Yoshi is still learning the basics of programming. What he's saying is probably relayed from a high school teacher who is behind the times.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2005-03-10, 3:27 PM #36
Quote:
Originally posted by Emon
John Carmack finally switched to C++ for Doom 3 because when he started writing it he believed C++ was finally fast enough for (his) games. There was a big thing about it. And surely you believe your one and only god John Carmack, Yoshi.


Screw you too man.

I am just learning the basics, but I'm talking about compile time AND runtime, not just run time. I know at least that C++ compiles tons slower on the archaic machines we use (though I can't really judge seeing as how they're...archaic).
D E A T H
2005-03-10, 3:30 PM #37
If you're just learning the basics, then the stuff you're compiling shouldn't take more than a few seconds at most on any slightly modern machine...

So comparing compile time of C vs. C++ on fairly basic programs isn't going to be very accurate seeing as how it should take almost no time at all to compile with either.
2005-03-10, 3:37 PM #38
Well, as I said, my friend relayed information to me about how C ran faster on the DC than C++. That's what I'm basing it on (though why this is remains to be seen.)
D E A T H
2005-03-10, 6:10 PM #39
Quote:
Originally posted by Dj Yoshi
I am just learning the basics, but I'm talking about compile time AND runtime, not just run time. I know at least that C++ compiles tons slower on the archaic machines we use (though I can't really judge seeing as how they're...archaic).

So stop acting like you have any real world experience.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2005-03-10, 6:18 PM #40
Maybe I did act like I was all-knowing, but all previous indications I'd had were with C being faster than C++. You don't have to jump all over my *** like I insulted your god or something.
D E A T H
12

↑ Up to the top!