Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 6th, 2005, 11:46 AM   #1
Fred
Programmer
 
Fred's Avatar
 
Join Date: Feb 2005
Posts: 67
Rep Power: 4 Fred is on a distinguished road
C/C++ Which to start with?[Solved]

Hi everyone
I have decided, to start and learn C or C++, and I have a few question:
-Which is better to start with? C or C++? And why
-How do I use a compiler properly (I am used to python interpreters)...
-And where can I get a good free compiler and if possible an IDE?
Thanks for any help.
Fred

edit: goole answered

Last edited by Fred; Mar 6th, 2005 at 1:30 PM.
Fred is offline   Reply With Quote
Old Apr 12th, 2005, 3:14 AM   #2
bl00dninja
Programming Guru
 
bl00dninja's Avatar
 
Join Date: Oct 2004
Location: namespace std
Posts: 1,246
Rep Power: 5 bl00dninja is on a distinguished road
start with C++. you can learn good fundamentals with C, but the syntax will clutter your mind and you might as well use C++. you can code procedural C++ just like C, it just gives you more options. i don't beliece in that whole learn C first crap because you can learn the same procedural stuff just the same without the syntactical confusion. it won't hurt you to learn C first, but you might as well get used to the syntax of C++. C++ is C with more features, not some new thing entirely. hell, it even has GOTO.
__________________
i put on my robe and wizard hat...

Have you ever heard of Plato, Aristotle, Socrates?...Morons.
bl00dninja is offline   Reply With Quote
Old Apr 12th, 2005, 8:32 AM   #3
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
go with C++...

Free compiler / IDE at:

http://bloodshed.net
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Apr 12th, 2005, 3:46 PM   #4
Mjordan2nd
The Supreme Ruler
 
Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6 Mjordan2nd is on a distinguished road
I'm going to go against what everyone is saying here, and say, start with C. I think that if you start with OO, you will end up sticking with that, and there's a possibility that you'll never learn procedural programming. Of course, you can do procedural programming with C++, but most C++ books you pick up will teach you OO right off the bat.

I have nothing against OO, obviously, I use and like Java a lot, which is heavily oriented to OO, but I personally believe that starting with OO is not the way to go. First and foremost, when writing procedural code, you are in control of your program, not some engine running in the back. I personally find it much more rewarding to be in complete control of your code rather than having your code based on some other code, which is based on some other code, which goes on and on in a nearly endless pattern.

Secondly, writing procedural programs will force you to learn certain basic algorithms, which I believe are essential to a good programmer. It's sad, but in my Computer Science three class, there are quite a few students who don't know how to properly work a bubble-sort. Of course, this is through no fault of their own. We use Java, and it has a very simple sort() method in the Collections class, and that's all that they know how to use. They know how to use the sort() method, they don't know how it works. When learning C, you will almost definitely learn the basic sort and search algorithms.

Furthermore, I think it will be easier to learn procedural programming as a first language than it will be to learn OO. I have seen many instances where people portray C as a cryptic language which is arduous to learn. This is not true. When your computer functions, it thinks procedurally; one task after the next. Your brain functions in a similar manner. C was the first real language I started out with, and with a good book, it's no problem to learn at all, perhaps easier than C++.

The knowledge you gain from learning C is not going to fade out once you move on to OO, either. Learning C will teach you the fundamentals of programming, and you will carry these basic skills with you to whichever language you decide to go on to, aside from Assembly, Lisp, or some other esoteric languages like Brainfuck. You will find heavy application of the knowledge you gained while learning C, even when you move on to C++, and other high level languages.

Like I said before, I have nothing against OO programming. C++ is a great language, and if that's the way you want to go, then I say go for it wholeheartedly, but in my humble opinion, I think it's better for a student to start with procedural programming and then move on to OO. Once you pick up C, you will probably be able to pick up C++ in less than a week as a second language, if you applied yourself to it. They're both great languages, and they would both be good to start with, it's really all up to you.
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower

Last edited by Mjordan2nd; Apr 15th, 2005 at 11:25 AM.
Mjordan2nd is offline   Reply With Quote
Old Apr 12th, 2005, 4:04 PM   #5
Starter
Programmer
 
Starter's Avatar
 
Join Date: Apr 2005
Location: Estonia
Posts: 42
Rep Power: 0 Starter is on a distinguished road
 or some other crazy languages like Brainfuck

Killing me with laughter I never heard of brainfuck before :eek: The syntax surely looks funny =] No offence to Müller guy
I say go with C if you are oldschool! I like C because its almost like oldschool, for me anyways.
__________________
Uhuuu!
Starter is offline   Reply With Quote
Old Apr 12th, 2005, 4:27 PM   #6
Mad_guy
Hobbyist Programmer
 
Mad_guy's Avatar
 
Join Date: Oct 2004
Location: Sandstorm, Techno Club
Posts: 239
Rep Power: 4 Mad_guy is on a distinguished road
Send a message via AIM to Mad_guy Send a message via MSN to Mad_guy
I have to recommend C. Fuck learning C++ at start. C is lower level, hence it's faster, plus many people don't like the way C++ implements things, so naturally they prefer C.
When you mess with C++ you mess with a lot of bloat, frankly.


You can't learn C++ without knowing C, despite what you think. C++ is essentially C plus Objects and Classes, right? Well, upon browsing around many forums, I have noticed something: None of the 'c++ code' there makes ANY use of Object-Oriented concepts. All the code is C style. Nobody here knows C++ and not C, same thing with compilers, there is no compiler out there that can compile only C++ and not C.

Many people only use C++ for IO capabilities, personally, I'll take printf(); over cout; any day of the week. Besides, if you're going to use IO, you might as well learn Perl, since it is really good at that where languages like C and C++ will manage, but they won't always get you the exact things you need without your code getting exceptionally dirty with casts and such.



I personally prefer C over C++ just because of the way that C suits me, I don't really like the syntatical style of C++ in many situations. Now that I'm getting into OpenGL/DirectX and Computer Science, I don't really have a choice so I might as well stick with it.
I'd really only use C++ if I was ever writing a large scale game or application, that needed to be modular and easy to build on, so I could for example, reuse a game engine such as the HL2 engine. So I suppose that's fine for OGL/DX.



In conculsion I learn you recommend C first, it's an excellent language, extremely fast, and is just a good language to learn, period. When you want to get into big scale applications, then is when you'll need OOP experiance and C++ will be your language for that project.
Mad_guy is offline   Reply With Quote
Old Apr 12th, 2005, 4:58 PM   #7
Benoit
Expert Programmer
 
Benoit's Avatar
 
Join Date: Sep 2004
Location: Ontario, Canada
Posts: 548
Rep Power: 4 Benoit is on a distinguished road
I also think you should learn C before C++...Learning C before C++ will make you that much better at C++
__________________
Johnny was a chemist's son but Johnny is no more, for what Johnny thought was H2O was H2SO4
Benoit is offline   Reply With Quote
Old Apr 12th, 2005, 5:25 PM   #8
shadowhunter
Programmer
 
shadowhunter's Avatar
 
Join Date: Dec 2004
Location: Scotland
Posts: 66
Rep Power: 4 shadowhunter is on a distinguished road
Wink C or C++

After reading the other posts I think that you should consider learning C first and then C++. In a way I speak from personal experience when I say C++ can be a pretty tricky language of programming.

I went from Visual Basic to C++ for uni and since I have never really used Visual C++ before found it mind boggling. I have used Borland Turbo C++ but that is quite different from Visual C++. If you can get your head around C then I believe that Visual C++ will be more manageable for you.

Do yourself a favour don't jump into the deep end (C++ high level) when the shallow end (C low level) is the much safer option.
shadowhunter.
shadowhunter is offline   Reply With Quote
Old Apr 12th, 2005, 7:27 PM   #9
Mjordan2nd
The Supreme Ruler
 
Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6 Mjordan2nd is on a distinguished road
Wow. I just looked at the date to the original post.
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower
Mjordan2nd is offline   Reply With Quote
Old Apr 13th, 2005, 5:58 AM   #10
peace_of_mind
Professional Programmer
 
peace_of_mind's Avatar
 
Join Date: Sep 2004
Location: Hell if I know most of the time
Posts: 435
Rep Power: 4 peace_of_mind is on a distinguished road
Send a message via MSN to peace_of_mind Send a message via Yahoo to peace_of_mind
Yep, the original poster has yet to comment, so he may not even be reading this. But I found it very insightful.
__________________
Amateurs built the ark
Professionals built the Titanic

peace_of_mind is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:59 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC