ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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.
now that we are speaking about this, the book that I'm using is the one of Deitel and Deitel "C++ :How to program" (6th edition), it is a REALLY long book, but (for anyone who has read it) is it a good option? I mean, when I finish it will I have enough grounding?
Don't know the book. I only learned from books in college, because I paid a lot of money for them and mainly they were written by the prof, so they taught fully to the book.
I TRIED learning from books in my career, I have a moderate collection of C, C++, Qt, Linux, and RTOS references mostly all in pristine condition.
I say "do" versus read; albeit Chapters 1-2 or 3 of the books were good overviews as well as pointers towards the areas which I was looking. For instance I had to learn how to do GUI software and the first example was a board running Qt, so I leapt in and now I know quite a lot about Qt which is also C++. Java was learned due to a necessity to make Android apps. Therefore your intention is to do game software. I would look for game source code you can build and modify that is written in one or more of the languages discussed and compile it, debug it, modify it; start learning by doing with that language and others' examples. The books, the wiki's, references are still very good for the actual details of the language. The other part of all this is the structure and/or architecture of code as well as the design methodologies. IMHO the canned ways that designer tools set up projects are not good for a real project. My point there is that I don't use Qt Designer, I write the code in my intended form and the Qt framework is used in my Make process. If I were to rely on the structure established by the Qt Designer, I'd have a ton of fluff files; many of which I wouldn't understand their intent, and I'd probably have learned less about the programming environment also if that were the case. Further, literally every answered question online for Qt was C++ code examples, not "Go to the <blah-blah> menu on your Designer and click ..."
The only book I would recommend is Stanley Lippman's C++ Primer. I've just linked to a DRM-free, all-formats copy you can buy on InformIt. You can also buy it from Amazon for less money, but pay a hidden cost in DRM and lockin.
EDIT: the Deitel & Deitel books I've seen (C# and Java) have all been garbage.
Yeah. Correct me if I'm wrong, but I don't think Linus said C++ was a horrible language, just that it was wrong for what his team was doing.
Please keep in mind that a) "a horrible language" and "a horrible language for game development" are not synonymous, and b) the current version of C++ is not as horrible as it used to be.
I just searched and funnily enough they were his exact words!
[ apologies it was just my inner troll ]
I gave C++ up and went back to C two years ago and feel much healthier.
I realised I was spending a whole lot more time thinking about C++ than the actual problem!
now I couldn't care less how to de-reference a private virtual member base class constructor smart pointer friend operator
and I also get a lot more work done.
Last edited by bigearsbilly; 07-22-2014 at 04:17 AM.
a problem with C++ is that it takes time to understand and learn
time that no one takes
and C++ is nearly nowhere taught (properly).
well, ok, there are even university courses teaching C++
applying GOF patterns with C++ and such mess,...
and teachers do not come from the (practical) C++ world.
usually and/or often you learn C, and than move on to java, or nowadays python
than people apply what they have learned to and with C++
additionally copy and past from some quick Internet research
the outcome is very often horrible, yes
but
horrible programmers write horrible code
no matter which language they use
If you search for the best resources available and respect the advices it is possible to have also a good start with C++
just go there http://www.stroustrup.com
read through the FAQ and than use his books
than continue
and this is a fact, if you step through C++, what takes a live and more,
you have the most power full and flexible tool that you can think about and that is currently available
arguing that less is more has something of Orwell's newspeak
but of course
for very many approaches C++ is the best tool
for much more not,
about Linus and C++,
when he looked at C++ the common understanding of the language was a different one than it is today
he had years of C experience, no C++ experience, and had to deliver something.
this is not the best way to learn how to deal with C++
especially it you think you have to start with
'how to de-reference a private virtual member base class constructor smart pointer friend operator'
:-)
so Linus had good and valid reason to stay with C
so deciding for a language needs to consider much more reasons than just technologically ones
but
horrible programmers write horrible code
no matter which language they use
His other argument is that horrible programmers never learn C, whereas some of them “learn” C++ (since in some cases it's easier, e.g. you can compare strings like you would numbers), so if your project is in C, you scare off all of those horrible programmers.
Now I'm not sure if that holds any more though. I guess it's yet another argument not to write in Java or Python though.
I don't believe in knocking or attacking C++ as a language. I've had to use it a ton for Qt development.
I don't use all the available properties/benefits of C++, especially things like function inheritance, polymorphism, and exception handling; therefore my C++ is very much like C, except I have classes.
There's one concept where a class inherits from another, and that's about the sole benefit I draw from it.
For instance some sort of widget has a method that is best customized for my needs, so I make a class of MyWidget based off of the original Widget and change just that one method. Likely I'm also copying that concept from someone's example because I googled for something like "How in the world can I make my widget dance on its head?" and found that there's no method that does exactly what I need/want it to do.
To me C++ is a viable language and I've survived very well programming in it without becoming someone who quotes or parrots that language as "the" language to use.
Having said all that, "it is one language, there are many", I know a few languages, you're best advised to be capable to deal with that language to some degree, and probably the properties of inheritance are pretty important to you, because I know they're important in non-game GUI programming.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.