Advertising (This ad goes away for registered users. You can Login or Register)

Learning C or C++

Programming on your favorite platform, for your favorite platform? Post here
Alpha Iono
Banned
Posts: 13
Joined: Wed Dec 14, 2011 9:40 am

Learning C or C++

Post by Alpha Iono » Sat Dec 17, 2011 10:46 am

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

snailface
Posts: 95
Joined: Tue May 24, 2011 8:02 pm

Re: Learning C or C++

Post by snailface » Sat Dec 17, 2011 11:11 am

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.
Advertising
Image

Alpha Iono
Banned
Posts: 13
Joined: Wed Dec 14, 2011 9:40 am

Re: Learning C or C++

Post by Alpha Iono » Sat Dec 17, 2011 11:43 am

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)

snailface
Posts: 95
Joined: Tue May 24, 2011 8:02 pm

Re: Learning C or C++

Post by snailface » Sat Dec 17, 2011 12:47 pm

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. :)
Image

Alpha Iono
Banned
Posts: 13
Joined: Wed Dec 14, 2011 9:40 am

Re: Learning C or C++

Post by Alpha Iono » Sat Dec 17, 2011 1:00 pm

Ok thanks for the help. Ill start with C++.

User avatar
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++

Post by Xian Nox » Sat Dec 17, 2011 4:22 pm

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.
Image
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.
Alpha Iono wrote:I decided to learn another OOP language but was stuck choosing. Pleasehelp
For you... hmm... C++. Once you get the basics, install Qt and start using Qt Creator as your main IDE.

Alpha Iono
Banned
Posts: 13
Joined: Wed Dec 14, 2011 9:40 am

Re: Learning C or C++

Post by Alpha Iono » Sun Dec 18, 2011 1:29 am

OK, thanks Xian nox ning nong. :)

User avatar
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++

Post by Xian Nox » Sun Dec 18, 2011 9:33 am

Alpha Iono wrote:OK, thanks Xian nox ning nong. :)
You're welcome. Please just write my nickname properly next time, or make it lowercase altogether.

User avatar
m0skit0
Guru
Posts: 3817
Joined: Mon Sep 27, 2010 6:01 pm

Re: Learning C or C++

Post by m0skit0 » Mon Dec 19, 2011 11:36 am

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.
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.
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 decided to learn another OOP language but was stuck choosing
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 ways :mrgreen: ). 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.
I wanna lots of mov al,0xb
Image
"just not into this RA stuffz"

Alpha Iono
Banned
Posts: 13
Joined: Wed Dec 14, 2011 9:40 am

Re: Learning C or C++

Post by Alpha Iono » Mon Dec 19, 2011 11:48 pm

Thank you moskito but I will stick with C++. And I will learn the OOP stuff later.

Post Reply

Return to “Programming”