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.
I was learning C++, until one of my friends convinced me to scrap it and learn C. He put across a very good argument (I can't remember precisely what he said), but he did a good job!
Now, I know about the legendary CProgramming.com, but I was wondering if any of you could recommend a good book to buy - you see, I find it much easier learning from books that from a screen!
How about learning both since C is used a lot in GNOME and GTK apps. C++ rules KDE and QT apps. Don't get sucked into other peoples views, do your own thing.
DevandeAsk: Thanks for those links! I managed to get a C Reference Manual from the second one, but the first one didn't have any C-related topics...great sites though, so thank you for the links!
reddazz: It seems we meet again... I'm not being pulled into his views, it's just that I've realized that he is correct. I haven't learnt any language fluently yet (far from it!), and that's one of the reasons I'm going for C instead of C++: it can get very complex, and I'm only a noob!
mohit dhawan: Thanks! I'll check them out.... I'm currently trying the cprogramming.com tut actually, so I'll see how that goes - although I'm quite depressed that the first program wasn't "Hello World!"...hehe!
Just to put in my 2 cents... C++ isn't anymore complex then C. You will still have to deal with the same basic memory management issues and whatnot. C++ just caters itself to a different programming paradigm then C does (OO verses procedure... not to say you can use either paradigm in either language).
I think C is much better than C++ since the syntax is much easier to write. ...
-----------------------------------
I think C++ is better than C. Because C++ has OOPs concepts which C doesn't ...
Interesting...But is OOP really that much of an advantage?
I'm just trying to find some reviews which will compare them in an unbiased fashion - and I can only hope that they are easy to find!
To the extent OOP is an issue, I strongly recommend Java as a first language.
C++ has way too much "other stuff"; Java has much less "baggage"; Java is (IMHO) much closer to "pure OO".
Java is also much easier to learn.
In other words, I strongly believe that it's easier for a beginner to learn Good Habits from Java than it is for the same beginner to AVOID learning BAD habits in C++.
IMHO .. PSM
PS:
I don't think you can go wrong learning C. And I completely agree with mohit dhawan: K&R is hands-down the single best book you can get!
Originally posted by J_K9
Interesting...But is OOP really that much of an advantage?
It really depends on the problem you are trying to solve. Some things are much easier to conceptualize with an OOD, and for some things trying to force it into an OO paradigm just doesn't work very well. The nice thing about C++ is that it lends itself well to both paradigms.
Another benefit of C++ is the ability to do generic programming via templates. (Something I found out has recently been added as an extension in the 1.5 Java SDK, and have heard is being included in the next C# release.) And the large collection of classes available in the STL. It's good to know the underlying mechanics of how to create your own linked lists and such, but once you know how, it is nice to be able to just use the standard containers in the STL to save some work.
microsoft/linux: Happy Birthday! Aside from that (heh!), what do you think of the Practical Programming books? I mean, I've had a good look at one before (Perl), but I didn't like it much - although they're bound to have it at the local bookstore, so I'll have a flick through!
Quote:
I started w/ C++, switched to C, now I'm taking a class in C++
This is what I'd like to do....learn C, and then - once I've become pretty good in it - switch over to C++ and learn that. And hey, if C is used a lot in GNOME and GTK, then I'm not complaining!
paulsm4: Hi! I've considered learning Java, but I - and you may not agree with me - find it a bit too high level to start out with...I mean, I first learnt Liberty BASIC, until I realized how useless it was. I then moved over to Perl, but gave up on it (and as the book didn't teach you using the "use strict" option, then it wouldn't have been a good way to learn how to program well). So, I then moved over to C++, and I'm just getting past loops right now, but I'm thinking of switching over to C: so, as you can see, I've dabbled in a few already... I may go on to learn Java afterwards, though, because it does seem to be the next up-and-coming language!
deiussum: Thank you for that! I found quite an advanced difference-review, which was quite interesting actually, so you may want to look at it...C vs. C++.
C++ is C with a few extra keywords that allow you to do Object Oriented Programming with it. I'd say your best strategy is to learn C first and become very comfortable with it before moving to C++. From there learning Java shouldn't be very hard at all.
I learned to program in C with "C By Example" by Greg Perry. ISBN# 0-7897-2239-9. I thought it was pretty decent. Since you already know a version of Basic, it should do you just fine.
Iztac: Thanks! I'd say your best strategy is to learn C first and become very comfortable with it before moving to C++ - I think I'll go with what you said. I'm going to check out your book as well as K&R2 (which there seems to be quite a lot of hype about, so I better have a good look at that one!)
Nylex: Oh, ok...cool. So, is it also possible to write KDE apps in QT using C, or is that strictly C++? (As I said, I'm one of those who prefer GNOME to KDE.... )
Originally posted by J_K9 Nylex: Oh, ok...cool. So, is it also possible to write KDE apps in QT using C, or is that strictly C++? (As I said, I'm one of those who prefer GNOME to KDE.... )
As far as I know, Qt is only C++. Like you, I prefer GNOME .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.