BETZ-A@osu-20.ircc.ohio-state.edu (Andrew Betz) (07/12/89)
I recently bought Borland's Turbo C 2.0 upon reccommendation from the Psych Dept's programmer, who claimed C was the best computer language in the world. A convinced consumer, I went out and got this package right away. It really is impressive. Here's the catch: I don't know anything about C and this is not the most user-friendly language I've ever seen. What I need is a good intro book to C programming and I don't know what's good and what's not. I'd appreciate any suggestions (hint: NOT Kernighan & Ritchie, please) as to what I should look into. Incidently, I am not familiar with structured programming (e.g., PASCAL) either. My goal is to learn C to a moderate degree of proficiency by simply reading a book or two and hacking away. Please send suggestions to: Betz-A@OSU-20.ircc.ohio-state.edu {InterNet} (or) TS7080.OHSTMVSA.BITNET {BitNet} Thanks in advance, Drew Betz
dmg@ssc-vax.UUCP (David Geary) (07/13/89)
In article <12509209925025@osu-20.ircc.ohio-state.edu>, Drew Betz writes:
+ I recently bought Borland's Turbo C 2.0 upon reccommendation from
+ the Psych Dept's programmer, who claimed C was the best computer
+ language in the world. A convinced consumer, I went out and got this
You probably won't find much argument in this newsgroup!
+ package right away. It really is impressive. Here's the catch: I
+ don't know anything about C and this is not the most user-friendly
+ language I've ever seen. What I need is a good intro book to C
+ programming and I don't know what's good and what's not. I'd
+ appreciate any suggestions (hint: NOT Kernighan & Ritchie, please)
+ as to what I should look into. Incidently, I am not familiar with
+ structured programming (e.g., PASCAL) either. My goal is to
+ learn C to a moderate degree of proficiency by simply reading a
+ book or two and hacking away.
One of the best books out (IMHO) for someone such as yourself would be:
C: Step-by-Step
by The Waite Group
ISBN: 0-672-22651-0
This book used to be "The C Primer Plus", which I've been using in
class for about 2 years. I've found it to be clear and entertaining
(not dry), especially for those with no "structured programming"
experience.
K&R is a great reference, and is actually a wonderful book if you
have been programming in HHL's for a long time and don't know C - or
if you *think* you know C ;-). However, K&R is not for the faint
of heart.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ David Geary, Boeing Aerospace, Seattle ~
~ "I wish I lived where it *only* rains 364 days a year" ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
walker@ficc.uu.net (Walker Mangum) (07/14/89)
In article <2790@ssc-vax.UUCP>, dmg@ssc-vax.UUCP (David Geary) writes: > In article <12509209925025@osu-20.ircc.ohio-state.edu>, Drew Betz writes: > What I need is a good intro book to C > + programming and I don't know what's good and what's not. I'd > + appreciate any suggestions (hint: NOT Kernighan & Ritchie, please) > > One of the best books out (IMHO) for someone such as yourself would be: > > C: Step-by-Step > by The Waite Group > I *highly* recommend _The C Puzzle Book_. I have long since passed mine to someone else, and I don't remember who wrote/published it. It is almost like one of the old "workbooks" you had in elementary school. It contains nothing but C statements and expressions, and the reader must solve each of them as a puzzle. It does not contain any actual C language definition or explanation, just a zillion puzzles. And the puzzles are somewhat entertaining - you will find yourself saying "awww, yeahhhh, I should know that...." a lot. Most important, the puzzles drill the language into you well enough to make you fairly proficient. Each chapter of the book introduces new language features. The puzzles in each section begin with easy ones and progress to quite difficult levels. When you complete the book, you will have rather vigorously exercised your own new knowledge of C, and will be (IMHO) far ahead of where you would be if you only read a language primer and hacked a few simple programs of your own. Don't write the answers in your book, however (the answers to all of the puzzles ARE in the back), since you will want to pass the book around to others........ -- Walker Mangum | Adytum, Incorporated phone: (713) 333-1509 | 1100 NASA Road One UUCP: uunet!ficc!walker (walker@ficc.uu.net) | Houston, TX 77058 Disclaimer: $#!+ HAPPENS
rsalz@bbn.com (Rich Salz) (07/15/89)
< What I need is a good intro book to C
< programming...
>I *highly* recommend _The C Puzzle Book_.
Ick. I highly disrecommend this book. It teaches you to debug code that
only a psychopath would write, and warps you into looking for things that
are almost never there. Stay as far away from such code as possible!
Some could say that this makes me a dilettante, but I prefer my psycho's
on the silver screen, not the CRT screen... :-)
/r$
--
Please send comp.sources.unix-related mail to rsalz@uunet.uu.net.
Use a domain-based address or give alternate paths, or you may lose out.
scs@adam.pika.mit.edu (Steve Summit) (07/15/89)
In article <1900@prune.bbn.com> rsalz@bbn.com (Rich Salz) writes: >>I *highly* recommend _The C Puzzle Book_. > >Ick. I highly disrecommend this book. It teaches you to debug code that >only a psychopath would write, and warps you into looking for things that >are almost never there. Stay as far away from such code as possible! I'll emphatically second Rich's motion. The more subtle problem is that computer languages are learned in part by imitation, just as are natural ones. One reason that so many people write horrid code is because that's all they saw when they were learning. The C Puzzle Book is chock-full of code that people should neither have to know how to understand or to write. "But wait," you say, "surely, having seen how hard to understand ugly code is, one would be inclined to shun it in one's own work." 'Fraid not. For one thing, since there's so little good code around, people figure that, as ugly as ugly code is, it's just a necessary part of computer programming. Then there's the "macho" attitude -- "I can understand this glop now, so I'll impress everyone with my erudition by writing some for myself." (I have talked to intermediate programmers who believed that they should start writing more cryptic code in order to be "advanced.") Finally, there's all sorts of paradoxical human psychology involved -- people are often drawn to that which they dread, especially if it's all they know. (Read Poe's "The Imp of the Perverse" sometime.) Steve Summit scs@adam.pika.mit.edu
gwyn@smoke.BRL.MIL (Doug Gwyn) (07/15/89)
In article <5005@ficc.uu.net> walker@ficc.uu.net (Walker Mangum) writes: >I *highly* recommend _The C Puzzle Book_. I have a problem with that book: It relies on nonstandard C implementation features for many of its examples, and the emphasis on puzzling C constructs does not encourage use of clean coding style.
vijay@bradley.UUCP (07/16/89)
>/* ---------- "Wanted: advice on a good C textbook" ---------- */ > > I recently bought Borland's Turbo C 2.0 upon reccommendation from >the Psych Dept's programmer, who claimed C was the best computer >language in the world. A convinced consumer, I went out and got this >package right away. It really is impressive. Here's the catch: I >don't know anything about C and this is not the most user-friendly >language I've ever seen. What I need is a good intro book to C >programming and I don't know what's good and what's not. I'd >appreciate any suggestions (hint: NOT Kernighan & Ritchie, please) >as to what I should look into. Incidently, I am not familiar with >structured programming (e.g., PASCAL) either. My goal is to >learn C to a moderate degree of proficiency by simply reading a >book or two and hacking away. > > Please send suggestions to: > > Betz-A@OSU-20.ircc.ohio-state.edu {InterNet} >(or) TS7080.OHSTMVSA.BITNET {BitNet} > > Thanks in advance, > > Drew Betz If you do not want to deal with K&R, then I suppose the best book would be "A Book on C" by Ira Pohl. I do not remember the ISBN or the publishers, but if you need additional information, let me know..... Have fun =============================================================I / / E-mail: vijay@bradley.edu I / / * * ___ ...!uiucdcs!bradley!vijay I / / / / / / / / I===================================I //___/___/__/_\/__/__/ I Exxon - Our gasoline contains no / / I sea water. Guaranteed!! / / I __/ __/ I ===============================================================
ari@eleazar.dartmouth.edu (Ari Halberstadt) (07/17/89)
Books I like (besides K&R): -- Andrew Koenig, "C Traps and Pit Falls", Addison-Wesley, Reading, Massachusetts (1989). ESSENTIAL! -- Stephen Kochan, "Programming in ANSI C", Hayden Books, Indianapolis, Indiana (1988). -- A Book on C (I can't remember the author/publisher...). UNIX books: -- Brian Kernigan and Rob Pike "The UNIX Programming Environment", Prentice-Hall, Englewood Cliffs, New Jersey (1984). -- Marc Rochkind, "Advanced UNIX Programming", Prentice-Hall, Engelwood Cliffs, New Jersey, (1985). I never liked the puzzle book. I more or less agree with the person who wrote (but I wouldn't have used such strong lanugage): >Ick. I highly disrecommend this book. It teaches you to debug code that >only a psychopath would write, and warps you into looking for things that >are almost never there. Stay as far away from such code as possible! In response to: >> What I need is a good intro book to C >> programming... <<>>I *highly* recommend _The C Puzzle Book_. -- Ari Halberstadt Ari Halberstadt: ari@dartmouth.edu
scs@adam.pika.mit.edu (Steve Summit) (07/17/89)
In article <9900013@bradley> vijay@bradley.UUCP writes: >If you do not want to deal with K&R, then I suppose the best >book would be "A Book on C" by Ira Pohl. I do not remember the >ISBN or the publishers... Oh, dear. The problem with this book, among other things, is that it tries to teach you to be a "C guru;" to immerse you in minutiae about word size, byte order, and character sets (ASCII vs. EBCDIC). (There are also a number of unfortunate errors, such as an observation that it is not necessary to cast a non-char pointer being passed to free(), "because no warning results... and the routine works properly.") Merely mentioning word size and other such difficulties, and exhorting the student to avoid them, would be fine, and indeed any good book on C should do so. This book, however, encourages you to explore the subject quite deeply; many of the exercises ask you to write programs to discover your machine's word size, to explain why programs with intentional overflow problems misbehave as they do, etc. Many of the (deliberately machine-dependent) examples contain unannounced VAXisms (e.g. passing long ints to printf %d) and would fail in ways other than intended when attempted by the already mystified student on other machines. If you find yourself, while writing a real program, skirting the edge of a machine dependency (and they do come up in practice), and if you've never been taught how to write a machine-dependent program, you'll be forced to go on and discover the correct, portable implementation. If you do know how to, and if you know all of your machine's particular idiosyncracies, it's just too tempting to write the machine-dependent program now, and deal with the portability problem later. When you (or, worse, someone else) eventually do try to port it, forgetting all of the embedded dependencies, the porting task becomes miserable indeed. Why do so many C authors and teachers become so immersed in implementation details, only to then have to dig their way out of all the problems introduced? Why not just teach how to avoid the troublesome areas in the first place? (K&R, invariably denounced in these requests for "beginner's C books," does so nicely: "...if you don't know how [machine-dependent details] are done on various machines, that innocence may help to protect you.") (Zork players may recall a button in the control room of Flood Control Dam #3 which floods the room with water, and that the contents of a nearby crumpled tube -- toothpaste -- can, astonishingly enough, be used to patch the leak and prevent drowning. One of the implementors tells the story of the amateur adventurer who believed that, during every game, the button had to be pressed and the hole patched, before going on to hunt for other treasures. Why not just not push the button in the first place?) So as to keep this posting from being wholly negative, I'll mention that one good introductory C book I know of is Programming in C, by Lawrence H. Miller and Alexander E. Quilici, John Wiley & Sons, 1986, ISBN 0-471-81875-5. (I don't claim it's the best one, not having exhaustively surveyed the field.) It does contain numerous suggestions about good programming style (and things to avoid). For the record, A Book on C is by Al Kelly and Ira Pohl, published by the Benjamin/Cummings Publishing Company in 1984, ISBN 0-8053-6860-4. Steve Summit scs@adam.pika.mit.edu
irab@amtfocus.UUCP (Ira Brenner) (07/17/89)
In article <9900013@bradley> vijay@bradley.UUCP writes: > >If you do not want to deal with K&R, then I suppose the best >book would be "A Book on C" by Ira Pohl. I do not remember the >ISBN or the publishers, but if you need additional >information, let me know..... > Title: "A Book on C" Authors: Al Kelley & Ira Pohl Publisher: The Benjamin/Cummings Publishing Company, Inc. ISBN: 0-8053-6860-4 This book isn't too bad and contains plenty of good examples, except it seems a little long and it takes forever to get into any of the meaty issues (read: slow reading through uneccessary garbage). Personally, I remeber Stephen Kochan's introduction to C book, "Programming in C" as being the most easily digestable in a short period of time. Title: "Programming in C" Authors: Stephen G. Kochan Publisher: Hayden Books (Howard Sams Company) ISBN: 0-8104-6261-3 Ike ******************************************************************************** Ira Brenner mcdchg.chi.il.us!amtfocus!irab Motorola, Inc. General Systems Group - AMT uunet!harper!amtfocus!irab "Uh ... sure, I know ALL the rules" ********************************************************************************
garys@bunker.UUCP (Gary M. Samuelson) (07/17/89)
In article <1900@prune.bbn.com> rsalz@bbn.com (Rich Salz) writes: >< What I need is a good intro book to C >< programming... >>I *highly* recommend _The C Puzzle Book_. >Ick. I highly disrecommend this book. It teaches you to debug code that >only a psychopath would write, and warps you into looking for things that >are almost never there. I haven't read _The C Puzzle Book_, but learning to debug code that only a psychopath (or should that be sociopath?) would write is a marketable skill. In some places, it is a requirement. I wish that everybody who had ever worked for or produced code for this company had learned how to write easily-readable source code, but such is not the case. One would hope that having to deal with psychopathic code would lead to the resolution never to write such code, but unfortunately, that doesn't necessarily happen, either. >Stay as far away from such code as possible! I do stay as far away as possible; sometimes, "as far as possible" is less than "as far as I would like." Gary Samuelson
acs60222@zach.fit.edu ( ENRIQUEZ) (07/18/89)
While on this subject, I have been looking for a good text on the subject of multi-user systems (i.e. games) programming. The closest thing I have found so far is a small section on the <curses> library for the school system here. Since this seems like a rather advanced (?) subject, any related material would also be greatly appreciated... Thanks.... me
keith@stellar.UUCP (Keith Crews @stellar) (07/18/89)
Another good introductory book that I have not seen mentioned in this discussion is "Software Engineering in C" by Darnell and Margolis. It is published by Springer-Verlag. It discusses both Ansi C and K&R C (the Ansi changes are clearly marked). It also points out pitfalls that the novice programmer is likely to encounter - eg confusing typedef with #define, problems with = and ==, etc. -- Keith Crews Stellar Computer Inc. 95 Wells Avenue, Newton, MA 02159
ethan@esosun.UUCP (Ethan Brown) (07/19/89)
I have seen a few incomplete references to "A Book On C". Here is the complete one: Title: A Book On C Subtitle: An Introduction To Programming In C Authors: Al Kelly and Ira Pohl Copyright: 1984 Publisher: The Benjamin/Cummings Publishing Company, Inc., 2727 Sand Hill Road, Menlo Park, CA 94025 ISBN: 0-8053-6860-4 Comments: An excellent book which, along with K&R, made learning the C language fun and easy. I had the pleasure of taking Numerical Methods from Al Kelly while I was at UCSC, and he is an great instructor. His talent for making things clear comes through in this book. Over the years I have lent the book to co-workers who wanted to learn C, and often they liked it enough to buy their own copy. The book was written before any of this ANSI nonsense (:-) so there is nothing about pragma's or prototyping. I know nothing about a new edition coming out that would include the new "standard" features; they may be waiting for ANSI to make up their collective minds.
diamond@diamond.csl.sony.junet (Norman Diamond) (07/19/89)
>>>> What I need is a good intro book to C >>>> programming... Please note the word "intro" >>>I *highly* recommend _The C Puzzle Book_. >>Ick. I highly disrecommend this book. It teaches you to debug code that >>only a psychopath would write In article <6381@bunker.UUCP> garys@bunker.UUCP (Gary M. Samuelson) writes: >I haven't read _The C Puzzle Book_, but learning to debug code >that only a psychopath (or should that be sociopath?) would write >is a marketable skill. In some places, it is a requirement. Yes it is a necessary skill, but it is not a good introduction. Please don't teach new students to write such nonsense. Actually I feel that structured programming should not be taught in first-year because students won't understand it. They'll think that just because they use "while" and "case," it's automatically structured. First-year students should figure out whatever kind of structure they wish. Second-year students should be forced to make revisions to the worst examples of first-year students' code (those psychopathic examples) and then make similar revisions to examples of good code. THEN teach the structuring techniques that produced the good code, and the students will understand! -- Norman Diamond, Sony Computer Science Lab (diamond%csl.sony.jp@relay.cs.net) The above opinions are inherited by your machine's init process (pid 1), after being disowned and orphaned. However, if you see this at Waterloo or Anterior, then their administrators must have approved of these opinions.
walker@ficc.uu.net (Walker Mangum) (07/20/89)
In article <6381@bunker.UUCP>, garys@bunker.UUCP (Gary M. Samuelson) writes: > In article <1900@prune.bbn.com> rsalz@bbn.com (Rich Salz) writes: > [in my previous posting] > > >>I *highly* recommend _The C Puzzle Book_. > > >Ick. I highly disrecommend this book. It teaches you to debug code that > >only a psychopath would write, and warps you into looking for things that > >are almost never there. > > I haven't read _The C Puzzle Book_, but learning to debug code > that only a psychopath (or should that be sociopath?) would write > is a marketable skill. Exactly the point. I suppose some of you are fortunate enough to only ever see your own beautifully styled, expertly crafted, well commented, and obviously lucid code. I'm not. Of course, my own code is beautiful ;-), but I swear some that I pick up comes from deranged minds. I don't actually have to maintain this crap, but I freely admit that I enjoy reading other peoples code, because: 1. I occasionally find a new and elegant solution to something. 2. I don't try to invent everything (I'm not big in NIH). If I find something I can use, I pack it away for future use. 3. It teaches me what not to do. I recognize vomit when I see it, and try not to do same. 4. It is fun to see how stupid some people are. 0.5 ;-) Anyway, there is a difference between being able to decode vomit and habitually puking. I think that it is a damned important skill to be able to do the former, and to avoid the latter. I presume that those of you who argue that exposure to bad code causes one to create bad code work alone, or only with other perfect programmers. Anyway, I still *highly* recommed _The C Puzzle Book_. I don't think that bad coding style (and, I agree, it's in there) is contagious from mere exposure. I didn't recommend using any of the styles in the book, and I don't give a crap what standard the puzzles do or don't conform to. The point is, if you can answer the puzzles correctly, you MUST possess a good working knowledge of C. Here's the publisher's info: Feuer, Alan R., THE C PUZZLE BOOK. Prentice-Hall, 1982. -- Walker Mangum | Adytum, Incorporated phone: (713) 333-1509 | 1100 NASA Road One UUCP: uunet!ficc!walker (walker@ficc.uu.net) | Houston, TX 77058 Disclaimer: $#!+ HAPPENS
djc@uop.EDU (Don Christensen) (07/20/89)
>>/* ---------- "Wanted: advice on a good C textbook" ---------- */ >>structured programming (e.g., PASCAL) either. My goal is to >>learn C to a moderate degree of proficiency by simply reading a >>book or two and hacking away. >> Drew Betz This sounds a lot like the way I learned C. I had a project to do for a class, and I didn't want to use Ada. I had heard a lot about C and decided to use it. With nothing but the compiler reference manual and the book "Advanced C: Food for the Educated Palette" by Narani Gehain, I managed to do quite well. I don't have it with me, but I can provide all necessary info if anyone wants it. The book has good examples and a good index, which is all I need. If you are a decent programmer, you should have no problem with a slightly advanced book of this sort. Don
ly@prism.TMC.COM (07/21/89)
I found the popular 'C Puzzle Book' somewhat silly. (A few years ago, I borrowed the book and went through all the puzzles myself.) In any case, using this book to learn C is as effective as learning English by playing Scrabble, or crossword puzzles, etc.
shaw@paralogics.UUCP (Guy Shaw) (07/24/89)
In article <1900@prune.bbn.com> rsalz@bbn.com (Rich Salz) writes: >Ick. I highly disrecommend this book. It teaches you to debug code that >only a psychopath would write, and warps you into looking for things that >are almost never there. AND In article <5091@ficc.uu.net>, walker@ficc.uu.net (Walker Mangum) writes: > I presume that those of you who argue that exposure to bad code causes > one to create bad code work alone, or only with other perfect programmers. > > Anyway, I still *highly* recommed _The C Puzzle Book_. I don't think > that bad coding style (and, I agree, it's in there) is contagious from > mere exposure. I didn't recommend using any of the styles in the book, > and I don't give a crap what standard the puzzles do or don't conform > to. The point is, if you can answer the puzzles correctly, you MUST > possess a good working knowledge of C. I also recommend _The C Puzzle Book_. Yes, I admit it. I have gotten a lot of flak about that over the years, especially from Pascal and Ada advocates who believe that the mere possibility of such a book is reason to condemn the C language. The other major category of criticism is not directed at C itself, but at the corrupting influence this book might have on impressionable, young programmers' minds. (Hmmm. Banning books is too extreme; perhaps, technical book stores should have adults-only sections for books like these.) The concern that this book teaches bad programming reminds me of the book, _How to Lie with Statistics_ by Darrell Huff. In the introduction, he writes: "This book is sort of a primer in ways to use statistics to deceive. It may seem altogether too much like a manual for swindlers. Perhaps I can justify it in the manner of the retired burglar whose reminiscences amounted to a graduate course in how to pick a lock and muffle a footfall: The crooks already know these tricks; honest men must learn them in self-defense." Just because I recommend this book does not mean that I recommend it as a primer or a style guide. Puzzle books, primers, style guides, and reference books all serve different purposes, and should be used by different people at different stages of learning and to address different problems. It never once occurred to me that someone would pick up _The C Puzzle Book_ and think, "Gee, maybe I can pick up some programming style hints." I, occasionally, do crossword puzzles, and I don't worry about the influence that they may have on my writing style. At least so far, I D E H L A E V T A EXPERIENCED N R Y T I E O F U F SIDE C T S. -- Guy Shaw Paralogics uunet!paralogics!shaw
decot@hpisod2.HP.COM (Dave Decot) (07/25/89)
Although I shouldn't expect style hints from a book called "The C Puzzle Book", I should expect puzzles. Most other puzzles one finds in real puzzle books are interesting, thought-provoking, and entertaining. The "puzzles" in "The C Puzzle Book" are just plain boring. Dave
jan@Arezzo.orc.olivetti.com (Jan Parcel) (07/26/89)
Although this is meant to be a supplement (It does not cover the basic language syntax), _THE _C_ _COMPANION_ by Allen I Holub seems to be a good book for both beginners and C programmers. It covers many of the same problems _THE _C _PUZZLE_ _BOOK_ covers except it gives the way to avoid a given problem rather than examples of the problem. According to the inside front page, it is published as part of the "Prentiss-Hall Software Series: Brian Kernighan, Advisor." It covers stack use and math operations, portability, the symbol table, and several areas of special interest to PC-DOS users (which I am not). Every time I lend it, I have trouble getting it back. Then the borrower goes out and buys it. Caveat: There is one sentence in the book (the first edition, I think) where Holub advocates the "one return per function" idea a la Pascal. The rest of the book is good.
reesd@gtephx.UUCP (David Rees) (08/03/89)
In article <10578@socslgw.csl.sony.JUNET>, diamond@diamond.csl.sony.junet (Norman Diamond) writes: > >>>> What I need is a good intro book to C > >>>> programming... I highly recommend _Programming in C_ by C. Kochan (Hayden Book Company). It was the second C book I read after K&R and it explained a lot of things for me. I have also recommended the book to others who, after reading it, agreed that it was an excellent introduction. In fact...just a sec... the C Language Reference for our system (Apollo) also recommends the book. -David BTW, I believe that there is a second edition out now... ------ "So what your saying is there are only women here.. a unlimited supply of Bud Light.... and we can never leave?" "That is correct." "We can live with that.."
Norman.Diamond@mamab.FIDONET.ORG (Norman Diamond) (08/05/89)
-- Fidonet: Norman Diamond via 1:363/9 Internet: Norman.Diamond@mamab.FIDONET.ORG Usenet: ...!peora!rtmvax!libcmp!mamab!Norman.Diamond