![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Feb 2005
Posts: 67
Rep Power: 4
![]() |
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. |
|
|
|
|
|
#2 |
|
Programming Guru
![]() Join Date: Oct 2004
Location: namespace std
Posts: 1,246
Rep Power: 5
![]() |
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. |
|
|
|
|
|
#3 |
|
Programming Guru
![]() ![]() ![]() |
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#4 |
|
The Supreme Ruler
![]() Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6
![]() |
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. |
|
|
|
|
|
#5 |
|
Programmer
Join Date: Apr 2005
Location: Estonia
Posts: 42
Rep Power: 0
![]() |
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! |
|
|
|
|
|
#6 |
|
Hobbyist Programmer
|
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. |
|
|
|
|
|
#7 |
|
Expert Programmer
Join Date: Sep 2004
Location: Ontario, Canada
Posts: 548
Rep Power: 4
![]() |
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 |
|
|
|
|
|
#8 |
|
Programmer
Join Date: Dec 2004
Location: Scotland
Posts: 66
Rep Power: 4
![]() |
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. |
|
|
|
|
|
#9 |
|
The Supreme Ruler
![]() Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6
![]() |
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 |
|
|
|
|
|
#10 |
|
Professional Programmer
|
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 |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|