I've been reading "Amiga Active" for 3 months now, and their C course
is horribly bug-ridden. Even in the first chapter, they used void main()
throughout the entire chapter. This was not particularly dangerous (on
the Amiga platform, void main() performs like int main(), except that
the return code is garbage), but what alerted me was a piece of code
in the third chapter:
char *reply="";
gets(reply);
FIRST, the magazine doesn't know that gets() is potentially dangerous.
SECOND, the example reads input into a non-writable block of memory.
On a non-memory-protected OS such as AmigaOS, this can cause a crash,
if another program happens to be using the memory immediately after
the "" string.
Should I complain to "Amiga Active" about the horrific way they
(mis)teach C newbies?
--
/-- Joona Palaste (pal...@cc.helsinki.fi) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #80 D+ ADA N+++ |
| http://www.helsinki.fi/~palaste W++ B OP+ |
\----------------------------------------- Finland rules! ------------/
"To err is human. To really louse things up takes a computer."
- Anon
Why not? :) If you think it's worth your time, go bonkers. Maybe you could even send them links to the comp.lang.c FAQ? :) Or
even links to relevant discussions in comp.lang.c via DejaNews.
-Garen
> char *reply="";
> gets(reply);
> Should I complain to "Amiga Active" about the horrific way they
> (mis)teach C newbies?
Do that - with a BIG flamethrower. Those poor unprepared coders
will certainly anti-learn more than learn from this kind of rubbish.
-- Timo Suoranta -- tksu...@cc.helsinki.fi --
>I don't know if this is off-topic or on-topic, but here goes...
>
>I've been reading "Amiga Active" for 3 months now, and their C course
>is horribly bug-ridden. Even in the first chapter, they used void main()
>throughout the entire chapter. This was not particularly dangerous (on
>the Amiga platform, void main() performs like int main(), except that
>the return code is garbage), but what alerted me was a piece of code
>in the third chapter:
>
>char *reply="";
>gets(reply);
>
>FIRST, the magazine doesn't know that gets() is potentially dangerous.
Why "potentially"? Do you know of any situation when gets() is not
dangerous?
>SECOND, the example reads input into a non-writable block of memory.
THIRD, it writes past the end of the memory block every time the user
input consists of more than the Return key.
>On a non-memory-protected OS such as AmigaOS, this can cause a crash,
>if another program happens to be using the memory immediately after
>the "" string.
On a memory protected OS that stores string constants in the text segment,
this will reliably crash the faulty program.
>Should I complain to "Amiga Active" about the horrific way they
>(mis)teach C newbies?
People who learn C from magazines get what they deserve.
Post the name of the guy who writes these articles.
Dan
--
Dan Pop
CERN, IT Division
Email: Dan...@cern.ch
Mail: CERN - IT, Bat. 31 1-014, CH-1211 Geneve 23, Switzerland
>People who learn C from magazines get what they deserve.
And how in the hell else is a hobbyist supposed to learn this on his own?
Not everyone can afford a library of $50-75 hard to find books, dude. Don't
be such an asshole.
John
I'd find out if there is any significant readership first. :)
--
Any hyperlinks appearing in this article were inserted by the unscrupulous
operators of a Usenet-to-web gateway, without obtaining the proper permission
of the author, who does not endorse any of the linked-to products or services.
He's not an asshole. And please don't resort to ad hominem attacks on
someone you don't know for expressing an opinion most likely derived from
experience.
I'm sorry, but I have to agree with the previous guy (from experience, too).
Learning how to program from a magazine is like trying to learn Taoist Kung
Fu by watching poorly dubbed Chinese martial arts movies. You get tidbits
that, at best, usually end up being incoherent to a well-developed
understanding of the entire process.
The best method is to earn a degree in Computer Science. The next best is
to take courses in programming in general or the language of your choice.
The last resort is to learn from books with a friend or such as teaacher or
with the occasional foray onto the internet for assistance (when
available). Anything less is useless.
For those unfortunates who cannot afford an entire library of computer
programming books, well, have you ever heard of :"THE LIBRARY" or even "THE
USED BOOK STORE"? When I first started learning, I had about two nickels to
rub together and used a friends computer. The library was indispensible.
Still, with well placed questions and some investigation, one can usually
determine the 4 to 10 books that will be most useful in procuring a decent,
working knowledge of programming and the language of interest.
So, my advice, from experience, is drop the mags and buy some good general
programming books. Or just keep learning the useless hard way. Your
choice.
--
Robert Templeton
----------------
Member of
- James Randi Educational Foundation
- Planetary Society
- Mars Society
----------------
* A4000/040 = AmigaOS 3.5, CyberStorm MK-II 060/50, 144MB Fast RAM, GVP
Spectrum 28/24, X-Surf, MelodyZ2, 6.1GB HD, 32x CD-ROM, internal Zip100
ATAPI, Floppy, External XL floppy
* PC = Windows 98SE, PIII 600MHz overclocked to 744MHz, 256MB RAM, 20GB HD,
DVD-ROM, 4x8 CDR, 3Dfx Voodoo3 3000 16MB, SB Live!, 100Mbps LinkSys
* PC = Windows NT 4.0 SP4, PII 400MHz, 64MB RAM, 10GB HD, 40x CD-ROM,
100Mbps LinkSys
For instance, there are free tutorials online to learn from. And
public libraries in many places. And books that cost less than $50.
Gergo
--
Whenever I feel like exercise, I lie down until the feeling passes.
Dan's point is valid. Most of the code I've seen in hobbyist magazines
rates from fair to execrable. The example Joona quotes is
particularly bad. If that's what you're learning from, you are doing
yourself a disservice.
Good programming books are not *that* hard to find, and the better ones
aren't all that expensive.
--
www.biggerhammer.com | Low Technology Solutions for
| High Technology Problems
Get the FAQ's at http://www.eskimo.com/~scs/C-faq/top.html
Sent via Deja.com http://www.deja.com/
Before you buy.
Oh. My. God. I thought you had to *work* at writing code that bad.
> FIRST, the magazine doesn't know that gets() is potentially dangerous.
> SECOND, the example reads input into a non-writable block of memory.
THIRD, the memory block is too small to store anything useful.
> On a non-memory-protected OS such as AmigaOS, this can cause a crash,
> if another program happens to be using the memory immediately after
> the "" string.
>
> Should I complain to "Amiga Active" about the horrific way they
> (mis)teach C newbies?
Yes. Be sure to include at least the following words:
Imbecilic
Asinine
Stupid
You could easily blow that much money on magazines over a period of time. Even
if the fifteen or so issues amount to one good book, you will have to do a lot
of clipping and pasting to avoid flipping through the advertizing. You will
not have any coherent, unified treatment of the subject matter---heck, not even
an index in the back for quick reference.
Also, I would classify the Amiga-related magazine which is the subject of this
thread as much harder to find than any of the books recommended by the c.l.c
FAQ or regulars.
> >People who learn C from magazines get what they deserve.
>
> And how in the hell else is a hobbyist supposed to learn this on his own?
> Not everyone can afford a library of $50-75 hard to find books, dude. Don't
> be such an asshole.
Well, one book is all you need. A general book about C programming will do
just fine. You don't need a bloody library of books. Sure, if you are to
be an experienced programmer, then you will probably need many expensive
books -- and lots of time.
--
Uffe Holst
> Agreed, but if one is worried about mistakes in magazines, wouldn't free
> online tutorials be more likely, if anything, to contain errors?
Maybe. But it seems to me that online materials are more likely
to be receive peer review, if only because reported errata can be
corrected.
I'd be willing to bet the poster isn't familiar with what an ad hominem attack is (no pun intended). It's neat that someone else
out there is familiar with fallacies of argument, though. Bonus points to you for pointing that out.
>
> I'm sorry, but I have to agree with the previous guy (from experience, too).
> Learning how to program from a magazine is like trying to learn Taoist Kung
> Fu by watching poorly dubbed Chinese martial arts movies. You get tidbits
> that, at best, usually end up being incoherent to a well-developed
> understanding of the entire process.
I would agree that what you're describing might be quite common. But lets not generalize on all magazines that way. There are some
good ones out there too (even if they are a minority). One example is Dr. Dobb's IMHO.
>
> The best method is to earn a degree in Computer Science. The next best is
> to take courses in programming in general or the language of your choice.
> The last resort is to learn from books with a friend or such as teaacher or
> with the occasional foray onto the internet for assistance (when
> available). Anything less is useless.
>
Oh boy. Lets not even go there, please. :) As a Computer Science student myself, I wholeheartedly disagree that earning a degree
in C.S. is the "best method". It's not in my case, and for many many others out there. Certainly, it can be one method. But just
as a reminder, Computer Science != programming. If you infact earned a degree in C.S., you're probably already well aware of that
anyhow.
> For those unfortunates who cannot afford an entire library of computer
> programming books, well, have you ever heard of :"THE LIBRARY" or even "THE
> USED BOOK STORE"? When I first started learning, I had about two nickels to
> rub together and used a friends computer. The library was indispensible.
> Still, with well placed questions and some investigation, one can usually
> determine the 4 to 10 books that will be most useful in procuring a decent,
> working knowledge of programming and the language of interest.
>
> So, my advice, from experience, is drop the mags and buy some good general
> programming books. Or just keep learning the useless hard way. Your
> choice.
In the U.S., the bigger book store chains like Barnes & Noble and Boarders have scads and scads of computer related books. At the
ones near me they even have nice furniture that you can use to sit down in while you browse their books. I often go in for several
hours, make a list of the books I like (if I hadn't finished reading them in the store :)) and then later see if my local library
has got them.
>
> --
> Robert Templeton
> ----------------
> Member of
> - James Randi Educational Foundation
> - Planetary Society
> - Mars Society
> ----------------
Thats just dandy.
> * A4000/040 = AmigaOS 3.5, CyberStorm MK-II 060/50, 144MB Fast RAM, GVP
> Spectrum 28/24, X-Surf, MelodyZ2, 6.1GB HD, 32x CD-ROM, internal Zip100
> ATAPI, Floppy, External XL floppy
> * PC = Windows 98SE, PIII 600MHz overclocked to 744MHz, 256MB RAM, 20GB HD,
> DVD-ROM, 4x8 CDR, 3Dfx Voodoo3 3000 16MB, SB Live!, 100Mbps LinkSys
> * PC = Windows NT 4.0 SP4, PII 400MHz, 64MB RAM, 10GB HD, 40x CD-ROM,
> 100Mbps LinkSys
>
I'm curious, why is it usefull to post all of this information about your computer hardware? It makes your signature a lot longer.
Excessively so. I would suspect you're just trying to show off. If thats so, the downfall is, I don't think comp.lang.c will be
impressed by it. Maybe comp.sys.amiga.programmer would, but I don't know.
-Garen
>In <8qv7ie$t45$1...@oravannahka.helsinki.fi> Joona I Palaste
> <pal...@cc.helsinki.fi> writes:
>
>>I don't know if this is off-topic or on-topic, but here goes...
>>
>>I've been reading "Amiga Active" for 3 months now, and their C course
>>is horribly bug-ridden. Even in the first chapter, they used void main()
>>throughout the entire chapter. This was not particularly dangerous (on
>>the Amiga platform, void main() performs like int main(), except that
>>the return code is garbage), but what alerted me was a piece of code
>>in the third chapter:
>>
>>char *reply="";
>>gets(reply);
>>
>>FIRST, the magazine doesn't know that gets() is potentially dangerous.
>
>Why "potentially"? Do you know of any situation when gets() is not
>dangerous?
When the user doesn't enter lines that are too long. When standard input
is redirected to a file with lines of a known maximum length (coupled
with a correspondinly large buffer) . Well, you did ask. :-)
>>SECOND, the example reads input into a non-writable block of memory.
>
>THIRD, it writes past the end of the memory block every time the user
>input consists of more than the Return key.
>
>>On a non-memory-protected OS such as AmigaOS, this can cause a crash,
>>if another program happens to be using the memory immediately after
>>the "" string.
>
>On a memory protected OS that stores string constants in the text segment,
>this will reliably crash the faulty program.
>
>>Should I complain to "Amiga Active" about the horrific way they
>>(mis)teach C newbies?
>
>People who learn C from magazines get what they deserve.
>
>Post the name of the guy who writes these articles.
The worst C articles I've ever seen were in a copy of UK Computer Shopper
a number of years back. The author managed to cram most of Schildt's errors
plus a few of his own into a few magazine articles. :-)
--
-----------------------------------------
Lawrence Kirby | fr...@genesis.demon.co.uk
Wilts, England | 7073...@compuserve.com
-----------------------------------------
>Dan Pop wrote in message <8qvmt8$1vk$1...@sunnews.cern.ch>...
>
>>People who learn C from magazines get what they deserve.
>
>
>And how in the hell else is a hobbyist supposed to learn this on his own?
>Not everyone can afford a library of $50-75 hard to find books, dude. Don't
>be such an asshole.
"Library" seems to be the operative word here. There are also some good
tutorials to be found on the Web.
Assuming that our potential C student is so poor as to be unable to afford a
$50 C book, why not try the public library?
Would you try to learn to perform surgery from a magazine? To become a
racing car driver? To become a chef? Any skill worth learning requires a
reference and practice. Practice makes perfect when you practice what is
perfect. Practicing crap only leads to crap.
Even learning C from a *good book* is not for the faint-hearted. It is far
better to take a good class from a reputable instructor.
I suspect you are headed for the killfile, but I will give you one more
message. I should always trust my instincts, and my instincts say to
killfile, but I am trying to become a kinder, gentler poster.
--
C-FAQ: http://www.eskimo.com/~scs/C-faq/top.html
"The C-FAQ Book" ISBN 0-201-84519-9
C.A.P. FAQ: ftp://38.168.214.175/pub/Chess%20Analysis%20Project%20FAQ.htm
Not those that have been carefully reviewed by (for instance) this
newsgroup.
Tom Torf's tutorial and Steve Summit's class notes spring to mind.
> And where as I agree a book is far more worthwhile than magazine/online
> articles if you're serious about learning something, I think that the
> latter are very useful if you're not sure if you want to learn. Eg, I am
> learning graphics programming (under Windows, boo hiss) for which I
> started out on DirectX, and then decided that OpenGL was a better choice
> - all learnt with online tutorials, which may have contained errors or
> bad habits, but at least it means I haven't wasted money on a completely
> useless DirectX book.
Public Library. [FCOL]
If you don't have a public library with technical resources, I have found
that local colleges are often cooperative. And sometimes when they're not,
you can just walk in, sit down, and read anyway.
> Back to the original example, there may be people who aren't sure if C
> is for them, and don't want to buy a book just yet, so an article in a
> magazine they buy anyway would be useful.
How is a crappy, worthless article scribbled by some idiot-know-nothing
going to be helpful to decide if "C is for them?"
> Except when it crashes because
> of mistakes in the code and as a result they get put off of learning C,
> I wouldn't say it was the reader's fault.
It's the article's author who is at fault first and foremost. A teacher has
_far_ greater responsibility than the student. Next in line is the
organization that published it. Incompetent technical review (or complete
lack of it) is inexcusable. There is a tiny shard of blame that falls upon
the reader, since it only makes sense to check your sources. But when
something gets published in a professional forum, it is not surprising that
a complete neophyte will take whatever is said at face value.
Sometimes people have to make do with less than ideal reference
materials.
"People who learn C from magazines get what they deserve." is not truth,
it's arrogant bullshit. While it's technically possible Dan meant that 100%
literally, with zero emotional value implied, I have never heard such a
phrase spoken aloud even ONCE where it was anything other than total
contempt for the person it was directed toward. Tell me why Joona deserves
contempt? Now, tell me why Dan deserves so much defense.
John
> I'm sorry, but I have to agree with the previous guy (from experience, too).
> Learning how to program from a magazine is like trying to learn Taoist Kung
> Fu by watching poorly dubbed Chinese martial arts movies. You get tidbits
> that, at best, usually end up being incoherent to a well-developed
> understanding of the entire process.
>
> The best method is to earn a degree in Computer Science. The next best is
> to take courses in programming in general or the language of your choice.
> The last resort is to learn from books with a friend or such as teaacher or
> with the occasional foray onto the internet for assistance (when
> available). Anything less is useless.
Well, I have no degree in Computer science, a took no courses in
programming and did not learned with help of others. I only read the
Kernighan&Ritchie book "Programming in C" and well I'm able to write
well-working programs now in about 5 or 6 different languages.
But I agree this is not the best way, as it took me about 2 years, before
my programming skills where acceptable (from the current point of view
- 10 years later).
Ciao
____ _ _ ____ _ _ _ _ ____
| | | | | | \ / | | | the cool Gremlin from Bischofswerda
| __ | ____| | \/ | | | WWW: http://home.pages.de/~stoecker/
| | | | | | | | PGP key available on www page.
|____| _|_ |____| _|_ _|_ |____| I hope AMIGA never ends to make fun!
> Sometimes people have to make do with less than ideal reference
> materials.
And get bitten by them, and could've known that in advance. You don't
learn to drive by correspondence; you don't learn to program from
ragazines. At least, not if you want me to run your code.
> "People who learn C from magazines get what they deserve." is not truth,
> it's arrogant bullshit. While it's technically possible Dan meant that 100%
> literally, with zero emotional value implied, I have never heard such a
> phrase spoken aloud even ONCE where it was anything other than total
> contempt for the person it was directed toward.
Well, I've spoken such with total contempt for the person writing the
tutorial. Never for those trying to learn by them; they deserve pity,
not contempt.
> Tell me why Joona deserves contempt?
He doesn't. Neither does he try to learn C from any magazine.
> Now, tell me why Dan deserves so much defense.
Because he's right?
Richard
> However, I'd bet a bottle of bubbly that he won't find a copy of K&R
> Edition 2 in his local library unless its a heck of a lot better funded
> than most.
You'd lose a bottle of bubbly if his local library was in fact the
university libray (he's a college student, isn't he?), as it is in my case.
They even have some of the Amiga RKRM's. I'd bet a whole crate of bubbly on
them having K&R. Of course, you're probably going to take the being better
funded part in for your defence :)
Cheers,
Eelke
--
Eelke Blok, Enschede, The Netherlands
http://home.student.utwente.nl/e.blok ICQ: 19514933
Amiga-page: http://home.student.utwente.nl/e.blok/amiga
"Our Lady of Blessed Acceleration, don't fail us now!" - Elwood Blues
:> However, I'd bet a bottle of bubbly that he won't find a copy of K&R
:> Edition 2 in his local library unless its a heck of a lot better funded
:> than most.
: You'd lose a bottle of bubbly if his local library was in fact the
: university libray (he's a college student, isn't he?), as it is in my case.
: They even have some of the Amiga RKRM's. I'd bet a whole crate of bubbly on
: them having K&R. Of course, you're probably going to take the being better
: funded part in for your defence :)
Yep, I'm a college student. I bet there's K&R2 somewhere in the CS
department library... however, finding the Amiga RKRMs there would be
equivalent to finding a daffodil on the Moon...
--
/-- Joona Palaste (pal...@cc.helsinki.fi) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #80 D+ ADA N+++ |
| http://www.helsinki.fi/~palaste W++ B OP+ |
\----------------------------------------- Finland rules! ------------/
"It was, er, quite bookish."
- Horace Boothroyd
Ooh, lovely. Only today I had a discussion with my manager about certain
dangerous programming practices. It went something like this:
Me: 'If you do that, you have it coming and you shouldn't complain about
the problems you will invariably get.'
Him: 'Really big, major, expensive product XXX does precisely that.'
Me: 'Only last week you were telling me that that product crashes after a mere
half hour of operation.'
Weird huh?
>>FIRST, the magazine doesn't know that gets() is potentially dangerous.
>Why "potentially"? Do you know of any situation when gets() is not
>dangerous?
That would be when the user helpfully types less characters than fit in the
buffer. Some believe that is acceptable practice.
>>SECOND, the example reads input into a non-writable block of memory.
Not necessarily. The pointer is not marked as const, and IIRC in C that can
(but doesn't have to) mean the 'constant' is writeable. It all depends on the
compiler and its settings.
Hans Guijt
> Dan Pop (Dan...@cern.ch) wrote:
> >Why "potentially"? Do you know of any situation when gets() is not
> >dangerous?
>
> That would be when the user helpfully types less characters than fit in the
> buffer. Some believe that is acceptable practice.
The user typically does not _know_ how large the buffer is. The user
typically could not count characters to save his life. The user may well
be less than helpful, either on purpose or not. Since you do cannot
guarantee that you know in all cases who the user is, any use of gets()
is a bug.
> >>SECOND, the example reads input into a non-writable block of memory.
>
> Not necessarily. The pointer is not marked as const, and IIRC in C that can
> (but doesn't have to) mean the 'constant' is writeable.
The _pointer_ is writeable. But it hasn't been pointed anywhere that you
have the right to write. Therefore, what the pointer points to is not
writeable; trying to write through may crash the program, or it may
scribble into memory it shouldn't scribble into (your executable,
perhaps?), or it may do _anything_. Accidentally destroying your OS's
internal file tables, and because of that your data on disk, when the
program exits and flushes those tables, is _not_ an unexpectable effect
of writing through an uninitialised pointer.
Richard
For one example of where I've found ambiguity in K&R2, see my 9/23 post titled "Storage Class Specifiers". Note that I did not find
this mentioned in the eratta (http://cm.bell-labs.com/cm/cs/cbook/2ediffs.html). Also, my quick scan of the eratta list reveals (2)
counts of ambiguity that have been corrected in newer printings, and only one listed as being not corrected in any printing (and
only 19 total minor technical errors listed for the entire text).
I do still think K&R2 is very good, and the small number of errors is quite amazing IMHO. As far as the book "The Annotated ANSI C
Standard" goes, I haven't read it. But I know the author by way of his bad reputation for errors in his works. On the other hand,
I have seen another one of his reference books -- and I did like his writing style. If you have this book, check out a review
written by someone /else/ which points out scads and scads of errors: http://www.lysator.liu.se/c/schildt.html. If someone else
out there reading this post has a URL to an official eratta list, please let me know so I can add it to my bookmarks.
-Garen
: Dan Pop (Dan...@cern.ch) wrote:
: >>char *reply="";
: >>gets(reply);
:
: >>SECOND, the example reads input into a non-writable block of memory.
:
: Not necessarily. The pointer is not marked as const, and IIRC in C that can
: (but doesn't have to) mean the 'constant' is writeable.
No, all it means that the compiler is not obliged to complain if an
attempt is made to write through the pointer.
--
Mathew Hendry, Programmer, Visual Sciences Ltd.
Work <ma...@vissci.com>, Home <sca...@dial.pipex.com>
My local public library has two copies of K&R 2. They also have 22 other
titles under the topic C (computer programming language), including the
very good: C Programming : A Modern Approach / K.N. King.
Unfortunately, some of the books are pieces of Schildt.
On the way are four copies of C Unleashed, by Richard Heathfield et al.
How is Al anyway?
--
Next we can discuss what type of person puts their hate mail in their
.SIG file for everyone to see. That could get interesting.
- RATBoy (to me on rec.arts.tv)
>"Hans Guijt" <hgu...@inter.nl.net> wrote:
>
>> Dan Pop (Dan...@cern.ch) wrote:
>> >Why "potentially"? Do you know of any situation when gets() is not
>> >dangerous?
>>
>> That would be when the user helpfully types less characters than fit in the
>> buffer. Some believe that is acceptable practice.
>
>The user typically does not _know_ how large the buffer is. The user
>typically could not count characters to save his life. The user may well
>be less than helpful, either on purpose or not. Since you do cannot
>guarantee that you know in all cases who the user is, any use of gets()
>is a bug.
Especially since the user can redirect stdin to a file or to the output of
another program.
> My local public library has two copies of K&R 2. They also have 22 other
> titles under the topic C (computer programming language), including the
> very good: C Programming : A Modern Approach / K.N. King.
>
> Unfortunately, some of the books are pieces of Schildt.
Ave.
What's the problem with Schildt? I noticed many mails in this newsgroup
have mentioned him as a black sheep. Could you give some examples why he is
one? Shortly I saw a book (Teach yourself C) written by him, which I didn't
dare to buy because of mails like this... So, explain to me why that was a
wise decision of me ;-)
Grx,
--
Alex Barten
a.j.b...@chello.nl
The Netherlands
Read section 16 of the alt.comp.lang.learn.c-c++ FAQ at
<URL:http://www.faqs.org/faqs/C-faq/learn/>.
/A
--
Andreas Kähäri,
Uppsala University, Sweden.
------------------------------------{ GNU it yourself: www.gnu.org }----
16: Why do many experts not think very highly of Herbert Schildt's
books?
A good answer to this question could fill a book by itself. While
no book is perfect, Schildt's books, in the opinion of many
gurus, seem to positively aim to mislead learners and encourage
bad habits. Schildt's beautifully clear writing style only makes
things worse by causing many "satisfied" learners to recommend his
books to other learners.
Do take a look at the following scathing articles before deciding
to buy a Schildt text.
http://www.lysator.liu.se/c/schildt.html
http://herd.plethora.net/~seebs/c/c_tcr.html
The above reviews are admittedly based on two of Schildt's older
books. However, the language they describe has not changed in the
intervening period, and several books written at around the same
time remain highly regarded.
The following humorous post also illustrates the general feeling
towards Schildt and his books.
http://www.qnx.com/~glen/deadbeef/2764.html
There is exactly one and ONLY one C book bearing Schildt's name on
its cover that is at all recommended by many C experts - see Q 25.
25: Where can I obtain a copy of the standards for C and C++?
. . .
You could also buy "The Annotated ANSI C Standard", by the
afore-mentioned Herbert Schildt (question 16). Make sure that you
ignore the annotations completely, however.
. . .
Robert Templeton wrote:
> > And how in the hell else is a hobbyist supposed to learn this on his own?
> > Not everyone can afford a library of $50-75 hard to find books, dude.
> > Don't be such an asshole.
> >
> > John
>
> He's not an asshole. And please don't resort to ad hominem attacks on someone
> you don't know for expressing an opinion most likely derived from experience.
Calling your opponent names & "ad hominem attacks" may be the same, but the
nameless poster is NOT guilty of an "ad hominem" argument.
The nameless poster's argument was NOT that the original argument was invalid
because the original poster was an asshole. THAT would be a fallacy "ad
hominem".
The nameless poster's argument was in fact valid: he can't afford to buy books
on how to program, so he has to learn through magazines. This is entirely
valid argument. The premisses are correct, the implied assumptions are
reasonable, the construction of the argument with the premiss & implied
assumptions is correct, etc.
Since your argument is also valid, the natural conclusion is that he won't learn
how to program.
--
Jack Perry + jep...@eos.ncsu.edu - or - dev...@yahoo.com
>The nameless poster's argument was in fact valid: he can't afford to buy books
>on how to program, so he has to learn through magazines. This is entirely
>valid argument.
It would have been valid if magazines were free. But they aren't, so his
argument is invalid.
My point is, when someone asks a legitimate on-topic question, you shouldn't
be a dickhead. Funny, 10,000 self-described debate experts, and no one heard
that.
Calling the code stupid, well... I'm no expert, but it looks like that was
the truth.
Calling the coder stupid, well... hardly nice, but you have to wonder.
"People who learn C from magazines get what they deserve." is a euphimism
for "fuck off". That you would behave that way, without even knowing why
that person chose to use the magazine, is arrogant and elitist. Not that a
self-important prick like you would notice. I had assumed you were a halfway
decent person, who might've had a bad day, or been up 24 hours straight, or
any number of things, and needed to be reminded. Sounds like you are a
natural asshole though, through and through.
But one can imagine that the poster was some homeless person who
found discarded magazines in a dumpster where he was looking
for a few meager scraps to eat, or shelter from the elements.
Inspired by the glossy covers, he sought to raise himself from
abject poverty by learning how to program in C, only to find
that he had learned very bad programming habits. How cruel to
dismiss his efforts by saying that he got what he deserved!
But I haven't figured out how he got Usenet access. Maybe he
had to take a telephone support job (where his calm and friendly
manner will serve him well). And who deserves that?
--
MJSR
Sent via Deja.com http://www.deja.com/
Before you buy.
No, because you're ignoring other possibilities. One obvious one is that
since magazines don't work for learning to program, he simply has to wait
until he can afford to buy books if he wants to learn.
Michael
Seebach's reviews of Schildt.
http://herd.plethora.net/~seebs/c/c_tcr.html
Clive D. W. Feather's reviews of Schildt:
http://www.lysator.liu.se/c/schildt.html
Go here:
http://www.accu.org/bookreviews/public/reviews/t/t001453.htm
Read that review. Then read each of the reviews at the bottom of that page,
all of which tear him up.
Dan Pop can be 'ascerbic' but he's not a "natural asshole though, through
and through." But bear in mind Higgins, from Shaw's Pygmalion:
"The great secret, Eliza, is not having bad manners or good manners or any
other particular sort of manners, but having the same manner for all human
souls: in short, behaving as if you were in Heaven, where there are no
third-class carriages, and one soul is as good as another."
Dan Pop has taught me a great deal about the C language. If you read clc
for a while, you will learn that he is a capable and willing teacher.
Who's message was more crass... His or yours?
Big words from something calling itself ***@***.com. Care to repost that
using real credentials?
> Yep, I'm a college student. I bet there's K&R2 somewhere in the CS
> department library... however, finding the Amiga RKRMs there would be
> equivalent to finding a daffodil on the Moon...
Have you tried looking. My college library had the RKRMs a couple of years
ago -- don't know if they still do. So it might be worth visiting the
library.
--
Uffe Holst
>The user typically does not _know_ how large the buffer is. The user
>typically could not count characters to save his life. The user may well
>be less than helpful, either on purpose or not. Since you do cannot
>guarantee that you know in all cases who the user is, any use of gets()
>is a bug.
I was practicing the ancient art of sarcasm. Sorry for not mentioning it
before...
Hans Guijt
>That isn't even my point.
>
>My point is, when someone asks a legitimate on-topic question, you shouldn't
>be a dickhead. Funny, 10,000 self-described debate experts, and no one heard
>that.
>
>Calling the code stupid, well... I'm no expert, but it looks like that was
>the truth.
>
>Calling the coder stupid, well... hardly nice, but you have to wonder.
>
>"People who learn C from magazines get what they deserve." is a euphimism
>for ....
<expletive delieted, this _is_ a family group you know, and minors do
frequent it>
No, its a euphemism for "people who learn C from magazines get what
they deserve". Believe me, IF Kaz had wanted to say "make immediate
use of your reproductive organs" he'd have said it.
>That you would behave that way, without even knowing why
>that person chose to use the magazine, is arrogant and elitist. Not that a
>self-important prick like you would notice. I had assumed you were a halfway
more expletives, and in a paragraph all about not insulting people.
>decent person, who might've had a bad day, or been up 24 hours straight, or
>any number of things, and needed to be reminded. Sounds like you are a
>natural asshole though, through and through.
And again. Read your own words my friend, and apply them to yourself.
--
Mark McIntyre
C- FAQ: http://www.eskimo.com/~scs/C-faq/top.html
>On Fri, 29 Sep 2000 22:34:05 GMT, "**** ****" <***@***.com> wrote:
>
>>That isn't even my point.
>>
>>My point is, when someone asks a legitimate on-topic question, you shouldn't
>>be a dickhead. Funny, 10,000 self-described debate experts, and no one heard
>>that.
>>
>>Calling the code stupid, well... I'm no expert, but it looks like that was
>>the truth.
>>
>>Calling the coder stupid, well... hardly nice, but you have to wonder.
>>
>>"People who learn C from magazines get what they deserve." is a euphimism
>>for ....
><expletive delieted, this _is_ a family group you know, and minors do
>frequent it>
>
>No, its a euphemism for "people who learn C from magazines get what
>they deserve". Believe me, IF Kaz had wanted to say "make immediate
>use of your reproductive organs" he'd have said it.
Maybe Kaz would, but what about Dan? :)
>
> But I haven't figured out how he got Usenet access. Maybe he
> had to take a telephone support job (where his calm and friendly
> manner will serve him well). And who deserves that?
I can make a list of the respondents to this thread, if that will help...
But anyway, about this ad. for "hominem" - I haven't seen it in the shops,
is it any good?
Tony Whitley
Oh, him too ! Thats the risk of overtrimming posts I guess... :-?
[ more of the same ]
In my experience of Usenet, those who work themselves into
a lather of self-righteousness over the occasional sharp posting
are usually those who don't know what's going on in the given ng.
Any comp.lang.c regular would know that Joona, who posted the
original observations regarding the abysmal quality of C advice
in certain magazine articles, is a reasonably clueful person who
doesn't require the aid of self-appointed usenet policemen.
He or she would also know that the author of the sharp comment
is a prime source of very helpful and accurate advice.
Allin Cottrell.
A student buys some magazine to get information about several topics
related to computers. He isn't a CS student nor a programmer.
It happens that the magazine starts a tutorial about C programming.
The student gets interested and wants to give it a try.
Without having to initially spend much money from his little budget to
build a small library of reference books, he decides to begin this new
adventure following the tutorial. It may well decide that programming isn't
his bread. Or find out that programming is fun and finally build his own
library of books carefully chosen to his personal tastes (I think K&R2
may be used as a reference for C programmers but isn't a good tutorial).
That student doesn't deserve a tutorial that bad!
Joona doesn't try to learn C from magazines. He already knows C to some
degree, so that he is aware of the mistakes in the C code shown in the tutorial.
His point is: "Should we try to get better tutorials from magazines?".
"People who learn C from magazines get what they deserve" is not
pertinent nor does that student deserve a bad tutorial from the
magazine.
Claudio Di Martino cla...@unige.it
-------------------------------------------------------------
Unsolicited and/or junk e-mail to this address isn't accepted
<snip expletive loaded rant>
do you eat with that mouth?
When I were a lad, there were this local institution called a "library",
where they bought and displayed books that anyone (well, any citizen
with a suitable age and address) could arrange to borrow and read.
I gather they've abolished them?
--
Chris "and I've punched my own cards, too" Dollin
C FAQs at: http://www.faqs.org/faqs/by-newsgroup/comp/comp.lang.c.html
Well, okay then, what do you propose? You can become the head of an
international committee for the review of programming magazines. Read every
damn one of them and only grant your stamp of approval to ones that meet the
quality requirements. (Of course, could we then not say that those who learn C
from magazines that do not have your stamp of approval get what they deserve?)
I think that trusting magazines to have accurate information is simply
indicative of lack of ``street smarts''. The purpose of magazines is to get the
reader to look at page after page of glossy advertizement. People who trust the
stuff in between do get what they deserve; and there isn't a thing you can do
about it.
--
Any hyperlinks appearing in this article were inserted by the unscrupulous
operators of a Usenet-to-web gateway, without obtaining the proper permission
of the author, who does not endorse any of the linked-to products or services.
Huh? Are *you* proposing something?
... and we're all talking about
char *reply="";
gets(reply);
The pointer is not uninitialised. It is initialised to point to
the only member of a single-character array of chars. Whether
or not that char can be written to is implementation dependent.
Writing to the elements of a string literal produces undefined behaviour.
n869, section 6.4.5 (String literals)
[#6] It is unspecified whether these arrays are distinct
provided their elements have the appropriate values. If the
program attempts to modify such an array, the behavior is
undefined.
[snip]
I agree, he is an UNnatural asshole, through and through.
He does know a lot about C, though.
I have caught him out a few times, but not often.
Interestingly, even when caught out, he refuses to admit it.
Mike
--
char *p="char *p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
This message made from 100% recycled bits.
I can explain it for you, but I can't understand it for you.
I don't speak for Alcatel <- They make me say that.
)Seebach's reviews of Schildt.
)http://herd.plethora.net/~seebs/c/c_tcr.html
)
)Clive D. W. Feather's reviews of Schildt:
)http://www.lysator.liu.se/c/schildt.html
)
)Go here:
)http://www.accu.org/bookreviews/public/reviews/t/t001453.htm
)
)Read that review. Then read each of the reviews at the bottom of that page,
)all of which tear him up.
Actually, it is very difficult to say anything nice about Schildt's
writing.
Not true. Recently, there was a thread on strcmp() where it seemed his
shoes had been tied together. He was nailed for a number of mistakes,
each of which he acknowledged either immediately or in due course.
Rather, I have found that the kind of thread in which Mr Pop gets
involved in heated discussion often turns on a particular phrase at some
point in the thread which is capable of more than one interpretation.
Naturally, each possible interpretation is taken up by a different
contributor, leading almost inevitably to some fruitless but heated
discussion because *each one* in the debate assumes that his own
interpretation is (a) correct (b) the only possible one (c) therefore,
the same as everyone else's - so he can't understand why everyone else
is being such an idiot.
Perhaps we should all be a little more tolerant of each other.
Why is this going to comp.sys.amiga.programmer, by the way? (Not that I
mind, but they might...)
--
Richard Heathfield
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
66 K&R Answers: http://users.powernet.co.uk/eton/kandr2/index.html (31
to go)
>Why is this going to comp.sys.amiga.programmer, by the way? (Not that I
>mind, but they might...)
Because it all started with a post about an Amiga magazine that had a
Schildt-like C tutorial :-)