Sunday, April 4, 2010

comp.lang.c - 4 new messages in 3 topics - digest

comp.lang.c
http://groups.google.com/group/comp.lang.c?hl=en

comp.lang.c@googlegroups.com

Today's topics:

* In the Matter of Herb Schildt: a Detailed Analysis of "C: The Complete
Nonsense" - 2 messages, 1 author
http://groups.google.com/group/comp.lang.c/t/caf17fab4e7d8530?hl=en
* Implementing strstr - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c/t/a3fe05ab352d5774?hl=en
* implement stack and queue in C or in asm - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c/t/42b5b866d80be770?hl=en

==============================================================================
TOPIC: In the Matter of Herb Schildt: a Detailed Analysis of "C: The Complete
Nonsense"
http://groups.google.com/group/comp.lang.c/t/caf17fab4e7d8530?hl=en
==============================================================================

== 1 of 2 ==
Date: Sat, Apr 3 2010 10:28 pm
From: spinoza1111


On Apr 4, 6:15 am, Seebs <usenet-nos...@seebs.net> wrote:
> On 2010-04-03, Morris Keesan <mkee...@post.harvard.edu> wrote:
>
> > On Sat, 03 Apr 2010 16:34:07 -0400, Seebs <usenet-nos...@seebs.net> wrote:
> >> I didn't actually read it.  Is it funny?  I could totally go back and
> >> read it, if it's actually funny.
> > It's not funny enough to bother reading the whole thing, but here's one
> > howler:
> > [regarding the use of %f and %d printf format specifiers for sizeof]
> >> Although I do not know why Herb used %f and %d format codes, he did
> >> know, as Seebach seems not to, that all ints are floats and all floats
> >> are doubles in well-structured languages. Because at the time and
> >> even, to an extent, now, C was almost as divers of the languages of
> >> China, Herb used the educated programmer's maxim, which is to first
> >> code as if the compiler writers and language designers knew at least
> >> as much as the intelligent programmer, and fix problems later.
> > I have absolutely no idea what spinoza thinks he's saying here, especially
> > the part about "all ints are floats and all floats are doubles".

You wouldn't, because you don't know "programming languages"
independent of a set of facts about a specific programming language.
It's as if I'd decided to program all computers as if they were IBM
1401s, and apart from liking Rexx (which is based in part on the
legacy and internal IBM belief that all computers should support
decimal arithmetic with unlimited precision), I didn't.

If you like to learn from books, please read "Programming Language
Pragmatics" by Michael L. Scott (Morgan Kauffman). You need to learn
theoretic constructs such as the fact that in sensible programming
languages, numbers form a nested set down from double to short or
byte. You also need to learn that competent programmers try to write
sensible code based on these constructs, adapting their language to
their model rather than celebrating its mistakes.

>
> There certainly exist languages in which you can use numeric types and
> expect automatic conversions.
>
Correct.

> The problem is that (and no one, I think, disputes that this design choice

Correct.

> causes some problems), in C, when you're passing stuff to the variadic part
> of a variadic function, you don't know what types of objects you get except
> insofar as the earlier arguments told you.  Thus, passing "%f" and passing
> an integer doesn't necessarily cause the integer to get converted to float;
> what it does is "undefined behavior", of which the two most common forms
> are:
>
> 1.  You get random stack garbage because floats and integers are passed
> differently.
> 2.  You get a float-sized chunk of space which contained part of an integer,
> or an integer, or an integer plus some other stuff, depending on their
> respective sizes.
>
> Either way, it's garbage.

Point taken. 6 errata out of 20 points but note that the maximum
number of errata will still be only 20, and you haven't addressed the
contradictory language at the beginning of the post.

>
> My guess would be that the actual motivation was "there is a float object,
> I'm typing quickly, I'll write %f".  Because I've made that mistake; the
> difference is that I recognize that it's a mistake and fix it.

But our experience is that you DON'T fix or see trivial errors such as
off by one. However, it seems that here, and at most 20 other place
(and, probably more like 6), Herb ran out of time to test code which
was in the process of being transformed into a hard-to-change PDF.
This is common in software publishing, and it's why computer books
disclaim warranty.


>
> Note that "in well-structured languages" is totally irrelevant; according
> to Nilges, C is not a well-designed language, and a book purporting to be
> about C which then relies on conventions or policies that only exist in other
> languages is, as I said:  Complete.  Nonsense.

No, using a poorly structured language makes the search for good
structure even more important. This is why I developed "virtually
structured programming" for assembler and Fortran, and it is a point
made long ago by Brian Kernighan in The Elements of Programming Style.

My suspicion of any programmer who uses the mistakes of a language to
use his own poor practice is covering up his incompetence, and this
has been confirmed, for me, by your code here.


>
> I'm glad to see that Nilges is continuing to support my theory that only
> sheer madness can make C:TCR 3rd Edition look remotely coherent.

Petitio principii:

1. Nilges is mad

2. Therefore anything he says is wrong (a questionable assumption on
two bases: on the monkey/typewriter model, approximately 50% of what I
say is true, and on a Romantic basis, I might have special insight)

3. He thinks C:TCR is coherent

4. Therefore he's mad

Dweebach, CTCR is not at issue here: CTCN has to stand on its own
merits. It may be incoherent. I noticed long ago that many computer
books are semi-coherent, and I learned why: computer book publishing
is a business, not "truth".

But CTCN fails to make your case. It's self-contradictory, misuses
words such as "clarity", and is completely disorganized. To make your
case, you would have had to list the "hundreds" or "dozens" of errors
you refer to in CTCN. It is illogical to reason from 20 to 24 or 100.


>
> > spinoza then, at the end, goes into one of his typical babbling rants
> > about "I am not a gadget", Hitler, Fascism, etc.
> > He does make one point which may be valid, if true: according to spinoza,
> > Schildt's book is in its 4th edition, with some errata fixed, and "C:
> > The Complete Nonsense" refers to the first edition.
>
> No, he's not right.  C:TCN is based on the THIRD edition, with I believe
> one or two references back to things that have been fixed since the second.

The book is in its fourth edition. Therefore, you are dishonest,
because you're telling people about the flaws, with page numbers, in
an edition that is out of print. Dishonest enough to believe that in
the above, you may be lying, and that CTCN is based on the first
edition. This is verifiable by checking page numbers.

It in fact appears that you posted a response to the first edition,
and failed to keep it up to date. You may have changed it (recently,
perhaps, in response to this thread) but you're still basically
dishonest. You were asked, and offered money, to be a tech editor and
have a real shot at accomplishing something (which my son accomplished
wrt to Stroustrup's book on C++ at the age of 13) but you refused.

This is because you are grandiose. You couldn't take trigonometry and
had to take calculus, and you wouldn't take computer science. There's
a disturbing pattern.


>
> e.g., the famous sizeof() example, in the 2nd edition, used <> instead of
> !=.  This was fixed in the 3rd edition (and the 4th edition "fixes" the
> exercise making it factually correct but completely uninformative.  D'oh!)
>
> > A little research shows that Schildt's website refers to "C: The Complete
> > Reference" as having been "fully updated for the C99 standard".  Schildt's
> > "Errata" page, however, links to errata for C++, C#, and Java books, but
> > contains no errata for any editions of any of his C books.
>
> I don't really care about errata for the 3rd edition at this point; the 4th
> edition is somewhat improved, but still does crazy Pascal-style EOF handling
> and in some cases appears to pass EOF to putchar() type functions due to
> doing things in the wrong order.  (Or possibly the flow is convoluted enough
> that it sometimes doesn't.  The flow is sufficiently confusing when you try
> to use feof() as a loop control as to make it a bit tricky to be sure without
> spending more time on it than I've wanted to.)

For each edition, you needed to inventory every error. Then, you
needed to form some sort of explanatory theory. Mine is that Microsoft
C is different and nonstandard, because C, if standardized would be a
new language.

You'd be laughed at since most computer books have under disclaimer of
warranty any number of errors, and you have said that your OWN book
will have errors. This is why you prefer the McCarthyite (and Fascist)
conspiracy theory that Schildt's books contain "hundreds" of errors
and their was a plot.

But you preferred a drive-by.

>
> -s
> --
> Copyright 2010, all wrongs reversed.  Peter Seebach / usenet-nos...@seebs.nethttp://www.seebs.net/log/<-- lawsuits, religion, and funny pictureshttp://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!

== 2 of 2 ==
Date: Sat, Apr 3 2010 10:30 pm
From: spinoza1111


On Apr 4, 4:32 am, Ian Bush <ianbush.throwaway.acco...@googlemail.com>
wrote:
> On 3 Apr, 19:25, spinoza1111 <spinoza1...@yahoo.com> wrote:
>
> > This is what Theodore Adorno calls the "culinary"
> > approach;
>
> This is the point that my laughing became out loud. I consider myself
> a tolerant person, did I loose it before or after other sane people in

Your illiteracy is causing me to "loose" it. The fact is that Adorno
saw things which I saw emerge in computing, including subhumanity, and
the "culinary" belief that the consumer (or hive mind) has any
artistic, or here scientific, wisdom.

> the group?
>
> Ian


==============================================================================
TOPIC: Implementing strstr
http://groups.google.com/group/comp.lang.c/t/a3fe05ab352d5774?hl=en
==============================================================================

== 1 of 1 ==
Date: Sat, Apr 3 2010 10:43 pm
From: spinoza1111


On Apr 4, 2:33 am, Seebs <usenet-nos...@seebs.net> wrote:
> On 2010-04-03, blmblm  myrealbox.com <blm...@myrealbox.com> wrote:
>
> > Isn't that more or less how shared libraries work?  with the caveat
> > that the code has to be position-independent?
>
> There exists a counterexample.  BSD/OS had a dynamic linker with
> special hooks for fixed-position mapping of particular shared libraries.
> This allowed the C library to be a shared library, but to have a fixed
> location so that the usual dynamic linker fixups weren't needed, shaving
> a few instructions and cache hits off every call into the C library.
>
> ... But this is a pretty specialized case.
>
> (I did see the post showing Nilges making up crazy theories about why the
> wrapper wanted to be a C program, but I really don't see any point in trying
> to respond further; so far as I can tell, everyone *else* either understands
> what I said or doesn't much care about Unix-like environments.)

But this proves nothing, here, since the cardinality of "everyone
else" is so small as to be statistically meaningless. Furthermore,
your behavior drives people away. You wind up with a small set of
losers who agree with your twisted beliefs.
>
> -s
> --
> Copyright 2010, all wrongs reversed.  Peter Seebach / usenet-nos...@seebs.nethttp://www.seebs.net/log/<-- lawsuits, religion, and funny pictureshttp://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!


==============================================================================
TOPIC: implement stack and queue in C or in asm
http://groups.google.com/group/comp.lang.c/t/42b5b866d80be770?hl=en
==============================================================================

== 1 of 1 ==
Date: Sat, Apr 3 2010 11:17 pm
From: Dr Malcolm McLean


On 3 Apr, 19:26, "io_x" <a...@b.c.invalid> wrote:
>
> than why stack and queue are seen from all one as
> different data structures?
> there is a push in the tail and a pop in the tail (stack)
> but could be
> a push in the head and a pop in the head too.
>
The obvious way to implement a stack is with a memory buffer which
grows in one direction, either upwards or downwards in memory, and
with a single "top" index or pointer. The obvious way to implement a
queue is with a fixed-size memory buffer which grows from one end and
shrinks from the other, eventually looping back on itself in a circle,
and with "head" and "tail" indices or pointers.
However the details aren't really important. You can implement
both with linked lists, for example. The reason we use the structures
is because of the algorithms. An algorithm that traverse a tree will
naturally use a stack. An algorithm that schedules jobs to be passed
to another process will naturally use a queue.

==============================================================================

You received this message because you are subscribed to the Google Groups "comp.lang.c"
group.

To post to this group, visit http://groups.google.com/group/comp.lang.c?hl=en

To unsubscribe from this group, send email to comp.lang.c+unsubscribe@googlegroups.com

To change the way you get mail from this group, visit:
http://groups.google.com/group/comp.lang.c/subscribe?hl=en

To report abuse, send email explaining the problem to abuse@googlegroups.com

==============================================================================
Google Groups: http://groups.google.com/?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate