LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-28-2008, 12:28 AM   #1
jmite
Member
 
Registered: Jun 2008
Distribution: Ubuntu
Posts: 266

Rep: Reputation: 36
How to learn c++?


So, I'm looking into getting into programming for linux, especially making KDE GUIs to cli programs. And KDE uses C++. I know NOTHING about programming.

What I'm wondering is how I should go about learning these languages, if I should learn C then move into C++, or C#, or something?

Are there any programs for linux which act as educational aides for teaching programming languages?

Thanks!
 
Old 09-28-2008, 01:43 AM   #2
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
C and C++ are different enough that you should find a good book on C++ (I can't think of any I'd recommend). If you learn C first you'll probably be programming in C for C++ and missing out on features of the language.

As you learn, have a look at the code for the simplest KDE programs you can find and move onto more complicated things as you learn to understand the code.
 
Old 09-28-2008, 06:17 AM   #3
ErV
Senior Member
 
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Blog Entries: 3

Rep: Reputation: 62
Quote:
Originally Posted by jmite View Post
How to learn c++?
How to learn C++ or any other programming language:
1) Get an software idea you'd like to implement. Game, joke program, application. Must be important for you. Idea == motivation. No motivation == less chances to learn.
2) Get a book about that language. ANY book. When in doubt which one - do a google search, and pick any one people recommend somewhere. Start learning from book. Write a lot of small programs. You should have fun in the process. NO fun == no interest. No interest == less chances to learn.
3) When the book is over, try another one or re-read current one.
4) When you can't get more info from books, analyze existing code made by other people, and keep writing your own programs until you are comfortable with language concepts and understand them by heart.
5) Done.

Things to be avoided in process:
1) Do NOT seek "the best" book, this is waste of time. Pick any recent book, because they mostly share same knowledge. If you have to learn, read ANY book. If you want "the best book", then you obviously don't want to learn.
2) Do NOT seek "the best" language, this is also waste of time. Pick any one you like (and comfortable with) and learn it. Do a google search when in doubt. In general all language are similar, so if you know how to code in C++, you'll be able to switch to java, C, python, php and many others, although it'll take a bit of time to learn syntaxic differences and new library functions. Asking in forums "which languages is best for you" is pointless - no one knows, you have to find it yourself.
 
Old 09-28-2008, 07:01 AM   #4
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
Quote:
Originally Posted by ErV View Post
Things to be avoided in process:
1) Do NOT seek "the best" book, this is waste of time. Pick any recent book, because they mostly share same knowledge. If you have to learn, read ANY book. If you want "the best book", then you obviously don't want to learn.
I wouldn't agree entirely with that - there are numerous truly awful books about C, C++, algorithms ... so it's always good to have a recommendation from someone who knows what they're talking about. Some of these books are so bad, it's difficult to resist the temptation to tear them up when I see them in book stores.
 
Old 09-28-2008, 07:41 AM   #5
almatic
Member
 
Registered: Mar 2007
Distribution: Debian
Posts: 547

Rep: Reputation: 67
For kde guis, you might also want to take a look at kommander (http://kommander.kdewebdev.org/). It's a modified qt-designer, which lets you create full featured guis and fill the widgets functionality with bash code and some simple commands. No big programming knowledge necessary, but still very powerful.
Other than that, the kdelibs have bindings for many languages, so you won't necessarily need c++ for creating guis.
 
Old 09-28-2008, 08:15 AM   #6
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
A book will definitely help, then just make some programs based on some FLOSS programs. However, do take note that C and C++ are notoriously difficult languages to learn, if you've never done any programming whatsoever before, then you will likely quit early if you start with these. I say try python or another easy interpreted language, maybe ruby, some prefer perl, then move on to learning C and C++. If you want to go through the pain, go ahead and start with C or C++, but be prepared.
 
Old 09-28-2008, 08:42 AM   #7
elprawn
Member
 
Registered: Feb 2005
Distribution: Gentoo 2008
Posts: 138

Rep: Reputation: 15
Get a good grasp of conventional programming and OOP in general and that'll make learning C++ easier. Other than that you just need to learn the syntax and the libraries.
 
Old 10-02-2008, 04:21 AM   #8
justmovedtolinux
Member
 
Registered: Sep 2008
Posts: 41

Rep: Reputation: 15
If you want to learn C++ - you can buy the book called "Computer Science C++" by "Sumita Arora"

If you want to learn C - check out "The C Programming Language" by "Brian Kernighan and Dennis Ritchie". The book is slightly advanced, but if you learn from it - its pretty much guaranteed that you'll be a master of the language!

I've used it during my school/college days. It teaches you the language in a simple and easy to understand manner.


Linux Archive

Last edited by justmovedtolinux; 10-03-2008 at 02:19 PM.
 
Old 10-02-2008, 04:53 AM   #9
Linuxmaster001
Member
 
Registered: Sep 2008
Posts: 40

Rep: Reputation: 15
i found a very nice book called "c in a nutshell", try that one

Linux Archive

Last edited by Linuxmaster001; 10-06-2008 at 02:28 AM.
 
Old 10-02-2008, 10:14 AM   #10
ErV
Senior Member
 
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Blog Entries: 3

Rep: Reputation: 62
Quote:
Originally Posted by pinniped View Post
I wouldn't agree entirely with that - there are numerous truly awful books about C, C++, algorithms ... so it's always good to have a recommendation from someone who knows what they're talking about. Some of these books are so bad, it's difficult to resist the temptation to tear them up when I see them in book stores.
I meant that finding one "good enough" book is better idea than wasting your time(probably weeks) reading flamewars about "which book is the best" or accumulating library (having many books on C++ doesn't automatically mean you can program). The first priority of anyone who wants to learn language is to start with _anything_ - just to see if language is good to you and you really have the will to learn it. When I was learning C++, I had been using one of Bjarne Stroustrup's books.

Last edited by ErV; 10-03-2008 at 05:54 PM.
 
Old 10-03-2008, 05:19 PM   #11
loperz7
Member
 
Registered: Sep 2008
Posts: 53

Rep: Reputation: 15
First buy a beginners book to programming which isn't geared towards certain programming language - they should teach you about loops and variables and what not. From there you can move on to a book about C++.
I learned via Pascal but that isn't needed by any means since the best lessons I had were via pseudo code which made programming easier to understand.

Debian

Last edited by loperz7; 10-10-2008 at 05:26 AM.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
learn QT sailu_mvn Linux - General 4 04-11-2011 02:34 PM
Looking to learn something new Malfo Linux - General 9 07-12-2008 08:54 AM
Hello everyone Looking to learn as most as I can Smoken LinuxQuestions.org Member Intro 3 10-28-2005 06:49 AM
Learn C/C++ objorkum Programming 15 07-30-2005 09:56 AM
how do you learn? titanium_geek Programming 26 08-20-2003 11:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration