Well, I get to pick out my b-day present, and I was thinking about getting a C or C++ book.
Any recommendations?
I know PHP(regex, arrays, etc), but the thing I don't really understand about C, is how do you go to another file. Like, in PHP, you submit a form to a PHP script. How would you make a form and submit it in C?
kmj
05-02-2001, 08:42 PM
You mean for CGI? Anyone who would use C for CGI should have their head examined.
Hartmann
05-03-2001, 09:53 AM
KMJ is right, C/C++ isn't the best for CGI. However if you are looking to make some Linux progs then I would buy the C++ Bible and a book called Beginning Linux Programming it covers C/C++ and some GUI stuff so you can create some cool looking programs. :)
moose
05-03-2001, 11:35 AM
I don't know C/C++ at all. Why wouldn't it be good to use for CGI?
Just curious...
Moose
kmj
05-03-2001, 12:17 PM
Originally posted by moose:
<STRONG>I don't know C/C++ at all. Why wouldn't it be good to use for CGI?
</STRONG>
When you're doing cgi, chance are you're creating your webpages on the fly, which means doing alot of formatted printing... Perl, being a practical extraction and report language, has alot of tools which may this kind of thing easy...
C/C++? Not really; you'd be doing a whole lot of printf's... the files would be way bigger and more complex than they would otherwise need to be.
Also, I don't know much about web-development, but I don't think I know of any compiled languages running server-side. Could be that interpreted languages are more safe? I dunno... but I wonder...
Stuka
05-03-2001, 12:31 PM
kmj-
:D At having yer head examined for doin' CGI in C. (Although I have seen, but not used, a C++ class arrangement for CGI which MIGHT not be too bad...). Safety? Hard to say these days, as most interpreted languages have facilities to access file systems as easily as compiled languages...I think part of it is that a lot of Web/CGI stuff is done by Web developers, who are not necessarily hard-core programmers, and scripting languages seem to have less of a learning curve....but I could be wrong about that!
david
05-03-2001, 02:46 PM
ROFLMAO!!!
god no.... i don't wanna use it for CGI..
Sorry, I guess that's what it sounded like... I was jsut trying to relate :)
MrNewbie
05-03-2001, 04:34 PM
Not related, but what toolkit does Beginning Linux Programming use for creating GUI programs? GTK, QT, or just the XLibs or none of them?
Thanks
Hartmann
05-03-2001, 10:12 PM
I don't exactly remember (my friend is borrowing it) but I think it covers GtK and Qt and touches on Tk....
binaryDigit
05-03-2001, 10:42 PM
i don't recommend learning any of the gui programming from beginning linux programming.
it doesn't cover nearly enough. i think advanced linux programming goes a little more in depth but i can't imagine it covering the full spectrum. it may be a good way for you to find out what you like best, but i recommend buying a book specifically for the subject when you do.
kmj
05-03-2001, 11:02 PM
Originally posted by david:
<STRONG>ROFLMAO!!!
god no.... i don't wanna use it for CGI..
Sorry, I guess that's what it sounded like... I was jsut trying to relate :)</STRONG>
so you're asking how gui programming works in general, on non-web-based things? like say, normal programs?
I'll let you answer that before I answer the wrong question again. :)
david
05-05-2001, 02:55 PM
yes, like how normal programs work :)
I think I might have it figured out...
I had started trying to learn C, and IIRC, you use functions for everything? so you just make different files, and some functions in each, and then include them.
It's just kinda confusing, because it's totally different with PHP...
sans-hubris
05-05-2001, 03:08 PM
haha, I find it funny that no one's figured out by now that you just want to learn how to program in C/C++ :D
Anyway, some of the text books that colleges and universities are very good books to learn from (why would they use them if they weren't?). Here at my university, we started out with Problem Solving with C++ by Savitch, a good introduction to C++ programming. We then went on into C++ How to Program (Third Edition) by Deitel & Deital, a good generalized viewpoint of C++. Another (it was only recemmended though, not required) called Beginning C++ The Complete Language by Ivor Horton isn't bad either.
kmj
05-05-2001, 08:04 PM
Originally posted by david:
<STRONG>yes, like how normal programs work :)
I think I might have it figured out...
I had started trying to learn C, and IIRC, you use functions for everything? so you just make different files, and some functions in each, and then include them.
It's just kinda confusing, because it's totally different with PHP...</STRONG>
Okay... lets, see. "normal programs"... They're actually not that different; I would think, anyway, even though I don't know php. So are you saying normal programs in general? or GUI programs? The main difference between say, a php or perl CGI script and a normal programming language, is that normal programming languages are interactive, while CGI scripts really aren't, though they "fake" it. All programs take input and produce output, right? CGI scripts take the cgi params, make some decisions based on them, and write out formatted html. That's about it, right? (I may be oversimplifying, here) "Normal" programs can take initial parameters, and will produce output, but they can also stop and wait for external input while they're processing; whether this is keyboard input or data from a network connection. GUI programs are exactly the same, except they spend alot of time waiting for input from the operating system. When a key is pressed, the mouse moves, a button is clicked, etc., the operating system detects these occurances, called EVENTS, determines which program, if any, should received notification of the EVENT, and sends it to the program. The program then notices it received a message from the operating system and makes the program changes.. GUI programming isn't too hard at all. normal programming is easy.. all you have to do is try, and all you need is an editor and a compiler. (I'm sure you know that linux comes with many of each.) If you're looking to getting into programming, just say the word... the folks here will give you more than enough resources.
Well, I hope my little post had at least a little to do with your inquiry. :) If not, clarify further, and if it wasn't enough of an answer, be sure to say so...
david
05-06-2001, 03:20 PM
OMG...
yes, I just want to maybe start programming! :D :D
jeez, I never thought people could get so carried away on one thing..
Anyhow, I don't wanna spend any of my money at the moment(saving to go to quebec). So how about some good online resources? Like, idiot proof onces preferably :).
And which should I leanr first(or does it make a difference?), C or C++?
thank you all for your patience :)
jbstew32
05-06-2001, 09:05 PM
if anyone just wants to get started in programming C++, and they no absolutely nothing about programming, I suggest a book called C++ Programming 101 by Steve Perry...
its very good, and it explains the logic behind it. Anyway, it will only carry you up to very basic OOP (object oriented programming)....just stay away from Visual C++, Borland C++, MFC, and anything else that is program/OS specific. Try to find a book that only shows you C++ itself (the basic AT&T version). It would not be good to learn Visual C++, and then later decide to program in linux.....that would take a whole lot more work on your part to learn linux programming because Visual C++ is so windows dependent....
just my $.02
david
05-06-2001, 10:33 PM
Originally posted by jbstew32:
<STRONG>if anyone just wants to get started in programming C++, and they no absolutely nothing about programming, I suggest a book called C++ Programming 101 by Steve Perry...
its very good, and it explains the logic behind it. Anyway, it will only carry you up to very basic OOP (object oriented programming)....just stay away from Visual C++, Borland C++, MFC, and anything else that is program/OS specific. Try to find a book that only shows you C++ itself (the basic AT version). It would not be good to learn Visual C++, and then later decide to program in linux.....that would take a whole lot more work on your part to learn linux programming because Visual C++ is so windows dependent....
just my $.02</STRONG>
yeah, I was thinking about learning java too. Anyone thing that'd be a better idea than learning C/C++ right now? Or should I go with C/C++?
I just want to be able to create fairly simple programs, CLI and GUI. I think I might start off with some sort of client side program to manage MyForum.
RTFM
05-06-2001, 10:45 PM
The C Programming Language, by Kernigan and Ritchie. They are the folks that made C. They practically made Unix too, but... :)
Also, on using C/C++ for CGI:
-----
It can be done, and when being used on a VERY high-load server (ie, ebay, amazon, hotmail) it can be recomended. While the development times will be much larger, the programs themselves will be MUCH MUCH smaller and thus faster. You can also exercise a greatly larger amount of detail upon them as well. However, if you're just piddling around, you wont notice that big a difference :)
kmj
05-07-2001, 11:45 AM
What's that? What's that you say? Good programming resources online? Well, I think I might know one...
Hey, how about this one?
CCAE (http://codeexamples.org)
That's a nice one. :D
And if that one doesn't have what you want, you might want to check through the link directory (http://codeexamples.org/cgi-bin/links/links.cgi).
...oooh, I'm shameless.
david
05-07-2001, 02:47 PM
Originally posted by kmj:
<STRONG>What's that? What's that you say? Good programming resources online? Well, I think I might know one...
Hey, how about this one?
CCAE (http://codeexamples.org)
That's a nice one. :D
And if that one doesn't have what you want, you might want to check through the link directory (http://codeexamples.org/cgi-bin/links/links.cgi).
...oooh, I'm shameless.</STRONG>
lol... :D
I'll be sure to check it out. So long as you check myforum out(if you haven't already :)
stavefan
05-07-2001, 03:16 PM
"C++ how to program" by deitel and deitel is an excellent book for a beginnner. (in fact it was the book that was used for my college comp sci c++ classes)
lots of code examples and little hints about pitfalls and fequent coding mistakes.
i would recommend the book to the absolute C++ newbie to learn (since i was in that position when i bought the book) and to the seasoned programmer who needs a good reference by their side
hope that helps
stavefan
jbstew32
05-07-2001, 10:12 PM
you dont know whether to learn C or C++? Well, many programs are written in both. C++ compiler can understand C as well, so you can mix and match the code within a program, and sometimes it is very useful, though you could get by without it. I think it would be meaningful to learn both (but thats a LOT more work :(
Java is good too. The code is structured like C/C++...just gotta learn the new syntax. Not a switch that's TOO difficult.
pointreyes
05-09-2001, 03:33 PM
Originally posted by david:
<STRONG>So how about some good online resources? Like, idiot proof onces preferably :).
</STRONG>
You're goin' to love the URL for your request: http://www.programmingtutorials.com/main.asp
:cool:
justlinux.com
Copyright Internet.com Inc. All Rights Reserved.