Programming This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
|
09-16-2005, 07:24 AM
|
#1
|
Member
Registered: Nov 2004
Distribution: Slackware 11, Ubuntu 6.06 LTS
Posts: 700
Rep:
|
Learning C
Hi,
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!
Thanks in advance,
M.
Last edited by J_K9; 09-16-2005 at 08:07 AM.
|
|
|
09-16-2005, 08:22 AM
|
#2
|
LQ Newbie
Registered: Sep 2005
Posts: 8
Rep:
|
|
|
|
09-16-2005, 09:07 AM
|
#3
|
LQ Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298
Rep:
|
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.
|
|
|
09-16-2005, 10:28 AM
|
#4
|
Member
Registered: Mar 2005
Posts: 92
Rep:
|
the c programming language by kernigham and ritchie is wht u r looking for..
u could also try LET us C by yashwant kanitkar.
|
|
|
09-16-2005, 01:02 PM
|
#5
|
Member
Registered: Nov 2004
Distribution: Slackware 11, Ubuntu 6.06 LTS
Posts: 700
Original Poster
Rep:
|
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!
M.
|
|
|
09-16-2005, 02:40 PM
|
#6
|
Senior Member
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Rep:
|
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).
|
|
|
09-16-2005, 03:13 PM
|
#7
|
Member
Registered: Nov 2004
Distribution: Slackware 11, Ubuntu 6.06 LTS
Posts: 700
Original Poster
Rep:
|
Ah, ok then...well, now I'm in the same position as before!  Which to go for...C or C++...
M.
edit: Found the following two quotes (using Google) of a website - which I can't view, sadly enough, because it is blocked by the school:
Quote:
From FAQs.org
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! 
Last edited by J_K9; 09-16-2005 at 03:21 PM.
|
|
|
09-16-2005, 03:55 PM
|
#8
|
Senior Member
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Rep:
|
Practical C Programming...published by O'reilly.
OR
Practical C++ Programming...published by O'reilly.
Both of these books are what I'm using to teach myself. I started w/ C++, switched to C, now I'm taking a class in C++
|
|
|
09-16-2005, 04:34 PM
|
#9
|
LQ Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Rep: 
|
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!
|
|
|
09-16-2005, 05:29 PM
|
#10
|
Member
Registered: Aug 2003
Location: Santa Clara, CA
Distribution: Slackware
Posts: 895
Rep:
|
Quote:
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.
Last edited by deiussum; 09-16-2005 at 05:32 PM.
|
|
|
09-17-2005, 01:23 AM
|
#11
|
Member
Registered: Nov 2004
Distribution: Slackware 11, Ubuntu 6.06 LTS
Posts: 700
Original Poster
Rep:
|
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++.
Yours Confusedly,
M.
|
|
|
09-17-2005, 02:37 AM
|
#12
|
Member
Registered: Feb 2003
Distribution: VectorLinux 5.1
Posts: 116
Rep:
|
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.
Good Luck.
|
|
|
09-17-2005, 03:14 AM
|
#13
|
LQ Addict
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464
Rep: 
|
You can also write GUI apps in GTK with C++ if you use gtkmm.
|
|
|
09-17-2005, 07:41 AM
|
#14
|
Member
Registered: Nov 2004
Distribution: Slackware 11, Ubuntu 6.06 LTS
Posts: 700
Original Poster
Rep:
|
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....  )
M.
|
|
|
09-17-2005, 08:21 AM
|
#15
|
LQ Addict
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464
Rep: 
|
Quote:
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  .
|
|
|
All times are GMT -5. The time now is 02:15 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|