Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
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.
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.
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.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.