Learning C or C++
-
Alpha Iono
- Banned
- Posts: 13
- Joined: Wed Dec 14, 2011 9:40 am
Learning C or C++
Hey guys, Im currently on holiday from high school and was really interested in learning a programming language. I've learnt the concepts of basic variables,functions, boolean values, data types etc, for 'Python' but I later stopped learning it further because I found out you cant compile it into an executable file for windows (Please correct if wrong, Ive tried programs like py2exe) and is used rather as an "interpreting' language. I decided to learn another OOP language but was stuck choosing. Pleasehelp
Advertising
Re: Learning C or C++
You're going to get lots of different advice for your question but the following two links should be enough to get you off to a good start. They're popular choices and have worked for many people.
The IDE -- http://www.codeblocks.org/downloads
The tutorial -- http://www.cplusplus.com/doc/tutorial/
If you want a book I would suggest:
http://www.amazon.com/Programming-Langu ... 0201889544
Its pretty tough, but thorough. Since you've only got about a couple weeks of holiday break, I would stick with the brief online tutorial for now.
The IDE -- http://www.codeblocks.org/downloads
The tutorial -- http://www.cplusplus.com/doc/tutorial/
If you want a book I would suggest:
http://www.amazon.com/Programming-Langu ... 0201889544
Its pretty tough, but thorough. Since you've only got about a couple weeks of holiday break, I would stick with the brief online tutorial for now.
Advertising
-
Alpha Iono
- Banned
- Posts: 13
- Joined: Wed Dec 14, 2011 9:40 am
Re: Learning C or C++
Thanks for the help snail, but I couldnt finish what I was trying to say because of my PSPs text entry limit. I was wondering if I should learn C because it has better compilers for windows and it is the basis of C++ meaning I would then only need to know things like declaring 'stuff' for C++ ? ( P.S. I actually have my 8 weeks summer holiday right now)
Re: Learning C or C++
C and C++ are about 90% the same. C++ just mainly has OOP tacked on which you had mentioned is something you're interested in (and used to).
Yes, C is the basis for C++, but I've heard it's better to start with C++ if you want to get into OOP. However, I've heard mods around here recommend plain C for PSP programming. They also recommend learning on PC first which you are already doing. Safe bet is to learn C++ on PC first then backtrack to C to program on PSP if that's what you want to do. Shouldn't be a hard adjustment.
btw-- the point you brought up about C compilers being better on Windows is not true. The quality of both languages' compilers for Windows is excellent and not an issue at all.
Yes, C is the basis for C++, but I've heard it's better to start with C++ if you want to get into OOP. However, I've heard mods around here recommend plain C for PSP programming. They also recommend learning on PC first which you are already doing. Safe bet is to learn C++ on PC first then backtrack to C to program on PSP if that's what you want to do. Shouldn't be a hard adjustment.
btw-- the point you brought up about C compilers being better on Windows is not true. The quality of both languages' compilers for Windows is excellent and not an issue at all.
-
Alpha Iono
- Banned
- Posts: 13
- Joined: Wed Dec 14, 2011 9:40 am
Re: Learning C or C++
Ok thanks for the help. Ill start with C++.
- Xian Nox
- Retired Mod
- Posts: 2749
- Joined: Fri Nov 05, 2010 5:27 pm
- Location: Over the hills and far away
Re: Learning C or C++
Alpha Iono wrote:I've learnt the concepts of basic variables,functions, boolean values, data types etc, for 'Python' but I later stopped learning it further because I found out you cant compile it into an executable file for windows (Please correct if wrong, Ive tried programs like py2exe) and is used rather as an "interpreting' language.

First of all, why compile it? You can easily make a shell script that launches your main script with the appropriate parameters? Other options are writing a small C/C++ app to launch it if you don't think that shell scripts are fun.
Also, py2exe obviously works, you just obviously failed at using it. RTFM for crying out loud.
For you... hmm... C++. Once you get the basics, install Qt and start using Qt Creator as your main IDE.Alpha Iono wrote:I decided to learn another OOP language but was stuck choosing. Pleasehelp
-
Alpha Iono
- Banned
- Posts: 13
- Joined: Wed Dec 14, 2011 9:40 am
Re: Learning C or C++
OK, thanks Xian nox ning nong.
- Xian Nox
- Retired Mod
- Posts: 2749
- Joined: Fri Nov 05, 2010 5:27 pm
- Location: Over the hills and far away
Re: Learning C or C++
You're welcome. Please just write my nickname properly next time, or make it lowercase altogether.Alpha Iono wrote:OK, thanks Xian nox ning nong.
Re: Learning C or C++
Personally, I do not recommend OOP for learning programming. OOP introduces abstractions and mechanisms which are not easily understandable by novices, specially if they do not know why they were introduced and how to use them properly (understand the paradigm). OOP is not for novices, since to correctly program in OOP you need to know how to correctly structure your program to fullfil OOP paradigm (layering, encapsulation, inheritance, polymorphism, and so on...). OOP languages offer mechanisms to write OOP programs efficiently. People trying to write "supposed" OOP programs end up writing imperative stuff using an OOP language. This is not OOP even if you're using an OOP language. OOP is beyond the language itself and refers to a methodology. For example I've seen A LOT of supposed C++ programs which actually are no more than C with very few C++ elements, and people writing that claim it's OOP just because it was written in C++. Nonsense.
). If you insist in learning OOP despite what I've said before, stick to Python. It's a great language to learn with. If you hopefully changed your mind about OOP, then go with C. C will teach you how a computer actually works without having to deal with assembly, which can be too freaky for a novice.
PS: Alpha Iono, please abstain of useless posts in programming forums. Next time you get a warning.
So? What's the problem with interpreted languages? Compiled vs interpreted, each one has pros and cons. Java is most popular language nowadays, and it's interpreted. Microsoft's .Net languages (C#, VB...) are interpreted (.Net is actually a Java copycat...). Actually most modern languages are interpreted. Why? Because this way you don't have to rewrite the code for diferent platforms. You write it once and execute on any platform you like.Alpha Iono wrote:I've learnt the concepts of basic variables,functions, boolean values, data types etc, for 'Python' but I later stopped learning it further because I found out you cant compile it into an executable file for windows (Please correct if wrong, Ive tried programs like py2exe) and is used rather as an "interpreting' language.
Then I don't understand the topic title where C is mentionned. C is not OOP. In fact C++ came in to transform C into an OOP language (this is why C++ sucks in so many ways, but also why C++ is great in so many other waysAlpha Iono wrote:I decided to learn another OOP language but was stuck choosing
PS: Alpha Iono, please abstain of useless posts in programming forums. Next time you get a warning.
I wanna lots of mov al,0xb

"just not into this RA stuffz"

"just not into this RA stuffz"
-
Alpha Iono
- Banned
- Posts: 13
- Joined: Wed Dec 14, 2011 9:40 am
Re: Learning C or C++
Thank you moskito but I will stick with C++. And I will learn the OOP stuff later.


