Efficency and the standard library

N

Nick Keighley

I think the missing spaces are an artifact of Google's posting
interface; I've seen this same glitch in other postings from GG
users, and I think it has something to do with whatever Google is
doing to try to hide/mask e-mail addresses.  Just sayin'.  

I use google and I hadn't noticed it lost spaces
 
N

Nick Keighley

The job of a linked list tool is NOT to "read" data.

fair enough. But you need at least one date structure to hold the
actual data.
It's to link data.

no. You are confusing two different sorts of link. Linked lists are so
called because the nodes that comprise them are linked together. The
question as how the data is held (embedded or linked) is orthogonal.
With very small data structures or few copies then copying may make
excellent sense.
Using links. Links are addresses.

not really.
If the data is addressable by
the time it gets to your linked list tool, it is not necessary to read
anything. Sure, if the original data is about to go out of scope, you
MIGHT want to copy it for posterity.

yes, exactly

This might be necessary for a good reason, but in my experience many
corporate programmers make unnecessary copies of data because it gives
them a warm, fuzzy, feeling of ownership.

I haven't seen this
One can only speculate that
this makes them feel good because they don't, in fact, own the tools
of production.

"well done Karl!"


spinoza is making the wrong distinction. It's not lack of abstraction
that is the problem, but lack of strong typing.


a handle? As in a small integer.

Eye roll.

Crotch grab.

I've seen you use this phrase before. Is it american in origin? What
does it mean?

The code needs to be abstract in a language (C) that doesn't permit
the sort of abstraction tools found in OO. The source needs to express
the operation of creating a node that points to an unspecified data
type. Instead of a void pointer, a preprocessor macro ensures that a
class of divergent operations (setting pointers to all sorts of
different types) are expressed in one place one way.

I'm not as much of a fan of the preprocessor as you obviously are.
Wouldn't tagged data give you what you want?

<snip>
 
N

Nick Keighley

On Sat, 20 Feb 2010 23:52:03 -0800, spinoza1111 wrote:
In the worst case, [shildt]
may have believed, as have many competent C programmers, that feof's
design wasn't <erroneous>, and that you could use it BEFORE the read that
fails owing to eof.

So you're saying he can't read?  After all, he had the very definition of
the mechanics of feof, from the standard itself, right in front of him -

not necessarily
he was, in fact, annotating that very standard.

we are talking about two different books he didn't necessarilyt write
them both at the same time.

What was irritating about Schildt and his publishers is that they made
no attempt to correct the errors (eg. issue an errata, correct them in
later editions). None of the errors were rocket science stuff but they
were very bad to have in a beginners book.

It would be difficult to find one worse.

now there's a challege. I've read some pretty poor books. There must
be a *really* bad one on C. "C In 21 Days"?

wha? Nowing how to use feof() is /error/?!

I came from Pascal and I had trouble with feof(). So I read the
documentation more carefully. Now I understand feof().
 
N

Nick Keighley

Pascal wasn't a disease. It was a better and more reliable language
than C one which, however, did not allow unethical and incompetent
people to hide their malfeasance and incompetence.

I think you under-estimate the cunning of incompetent people.

I liked Pascal. But
http://www.lysator.liu.se/c/bwk-on-pascal.html

the type of arrays was fundamentally broken, lack of proper strings
and a slightly twisted i/o system.

Ada might be regarded as a "grown-up" pascal

<snip>
 
B

blmblm

Sure, but would you not agree that a poster bears responsibility for
what he posts? If a newsreader is corrupting articles, the responsible
poster has some choices:

(a) accept responsibility for the corruption;
(b) fix the newsreader;
(c) get someone else to fix the newsreader;
(d) use a different newsreader.

(Did I miss any?)

Note that it was because of his spelling flame that I mentioned his
misquotation. If he doesn't want to receive such trivial criticisms, one
way to reduce their number is to refrain from offering them himself.

Yes (and yes I did understand why you pointed it out) ....

(a) seems like the most feasible to me -- scanning through quoted
text in search of manglings seems like potentially a lot of work.

I do think that continuing to take others to task for spelling
mistakes after getting my name wrong is -- not best behavior, maybe.
 
R

Richard Tobin

And what gives them the freedom to define things this way? Right; the
language standard, which is _not_ defined by the OSen.

First you deny that the OS defines what is correct C, then you say the
standard gives it the freedom to define it! Make your mind up.

You were addressing this assrtion:
but most competently written OSen allow you to
declare main in different ways.

The standard says you can declare main() as int main(void), int
main(int, char *), or in some other implementation-defined manner.
Is void main(void) correct C? The C standard doesn't determine
whether it is - the implementation does.

-- Richard
 
B

blmblm

I use google and I hadn't noticed it lost spaces

Well, the circumstances in which it does so are something you might
not have stumbled across. Thinking more about previous discussions,
I realize I didn't get it quite right above. As I understand things:

Google tries to hide/mask e-mail addresses, and in service of this
goal they replace anything that looks like one with a link that, when
clicked, brings up one of those CAPTCHA things you can use to get the
actual address.

And then apparently the posting interface works not from the original
message text but from their HTML-ized version, and spaces around links
(sometimes?) disappear. This affects other URLs (if any) in quoted
text. I've observed this in more than one newsgroup.

(They also send out text encoded as quoted-printable, which doesn't
play nice with the antique newsreader I use. I cope, since perhaps
that's my problem for using such an old tool, but .... )
 
S

santosh

What was irritating about Schildt and his publishers is that they
made no attempt to correct the errors (eg. issue an errata, correct
them in later editions). None of the errors were rocket science
stuff but they were very bad to have in a beginners book.

One thing that I personally don't like is how the publishers describe
Mr. Schildt in the blurb for his books. Phrases like "world famous
programmer" and "master programmer" come to mind.

Regardless of whether he is or is not a master programmer, don't they
(the publishers) realise that many readers are actually likely to be
put-off by these overly hyped descriptions?

<snip>
 
J

Julienne Walker

Your "linked list" tool copies node values unnecessarily into each
node, where competent individuals set the node to point to the data,
so that node creation doesn't take unpredictable amounts of time
depending on the size of the data.

I'd question your claim that taking ownership of data in a container
suggests that the author is incompetent, but that's a valid opinion.
My opinion is that competent individuals understand cost versus
benefit and can objectively choose the appropriate solution for their
needs.
Computer Science 101.

This I take issue with. Please cite your references so one can verify
the accuracy of your statement.
 
M

Malcolm McLean

Regardless of whether he is or is not a master programmer, don't they
(the publishers) realise that many readers are actually likely to be
put-off by these overly hyped descriptions?
I wouldn't tell a marketing person what to put on the blurb of a
dustjacket, any more than I would expect a marketing person to tell me
how to design a video game.
 
S

santosh

Malcolm McLean said:
I wouldn't tell a marketing person what to put on the blurb of a
dustjacket, any more than I would expect a marketing person to tell
me how to design a video game.

Even if I were a very good C programmer, I'd object to any publisher
who decided to describe me as "world famous programmer" on any C book
I were to write. Not everything is about marketing. I know evaluating
a book based on an emotional reaction to it's blurb is weak, but
still...

Are you telling me that you'd be perfectly fine with a publisher who
decided to portray you as, say, "world famous authority on
algorithms", in the blurb for your Basic Algorithms book? IMO an
author should ensure he is appropriately represented by the editors
and publishers of his works.
 
B

blmblm

But sometimes they make mistakes. Mr. Nilges is not the first person
to spell my last name differently from how I do, and there do seem to
be a lot of variations. Sort of a :).
No, they don't. I apologize for the haste in which I misspelled her
name. The Ms was honorific, intended to be polite.

I respectfully suggest that you take this as a sign that you
shouldn't be so quick to point out others' spelling mistakes.
 
M

Malcolm McLean

Are you telling me that you'd be perfectly fine with a publisher who
decided to portray you as, say, "world famous authority on
algorithms", in the blurb for your Basic Algorithms book? IMO an
author should ensure he is appropriately represented by the editors
and publishers of his works.
You do have a point. The strength of Basic Algorithms is that the
things you need to know for graphics-centred and general programming
are all collected under one cover, and with readable text explaining
how they work. It's also a good way of learning some post-school maths
for those who didn't do mathematics courses at university. Only one of
the algorithms in the book (a clustering method) is of my own
devising, everything else was invented by someone else and chosen by
me because of its general acceptance within the programming community.

To describe me as an "authority on algorithms" would be embarrassing.
 
B

blmblm

Ben Bacarisse <[email protected]> wrote:

[ snip ]
"Theft"? At worst I think I'm guilty of not being as explicit as
I might have been about sources. It was certainly not my intent to
"steal" any of your work, or to present it as my own, and I'm sorry
if that's how it comes across.

[ snip ]
But if you want to claim that I should have been more explicit
that these were your tests and not mine, well, fair enough, and
I do apologize for that.
If I post further versions of my code I will do what I can to
make sure credit is given where due.

Looking over what I posted .... Oh dear. I really *should* have
put something at the top of the file "spinoza-tests.c" indicating
that those lines were copied verbatim from your test suite -- but
the intent, again, was to keep to a common frame of reference,
and perhaps provide an easy way for others to run your tests,
rather than to plagiarize.

Indeed, I think originally I wasn't going to include your tests
at all, but only provide an easy way for others to do so -- the
comments in my tester.c code indicate that users are meant to find
the latest versions of your tests and put them in a file to be
#include'd. I can't quite remember now how I got from that intent
to actually posting something with insufficient comments indicating
authorship ....
Proposed comments for the file containing the tests:

/*
* The "spinoza1111tests", as developed by Edward Nilges.
* This version is copied from Usenet post Message-ID [whatever].
*/

(I'm not actually sure I correctly copied and pasted the latest
version of your tests. Something else to fix.)

Proposed comments for the file containing the driver code:

/*
* Correctness tests use the TESTER macro interface proposed
* by Edward Nilges in [another reference to a Usenet post].
*/

[ snip signature ]
Thanks for this, I appreciate it.

Probably moot, since it's unlikely that I'll need/want to post
another version; Chris Thomasson seems to have come up with a
testing framework that's as good as mine or better, and others
are taking on the job of benchmarking various people's code.

Still, I apologize again for the appearance of plagiarism -- it
was careless, and I know better.

To be accused of "theft" for what I believe was an honest mistake
rankles, but -- whatever.
 
S

Seebs

Yes, but possibly not in the way you intend. Your continual defence of
the indefensible simply exposes more and more of the problems in
Schildt's writings to those who might not otherwise have been aware of
them. This is a Good Thing - in fact, it is possibly the most useful
thing you've ever done.

Yes.

But what makes him think that the term was EVER in "C:TCN"?

I just went back to a 1998 saved copy on another machine, and the term
was not there, either. So far as I can tell, the only changes since 1997
have been some HTML cleanup. (It's hard to be sure, because that cleanup
was moderately invasive making diffs hard to generate, but a quick scan
through a per-token diff shows nothing more elaborate than, say, changing
the capitalization of tags and adding a DOCTYPE.)

So Nilges has publically asserted that I used a term, and specifically that
I used it in that document, but it wasn't so. Why is he so willing to resort
to blatant (and easily-disproved) lies in order to prove a point?

Because he's a kook.

Nilges: You have to get this through your head.

*YOUR MEMORY IS NOT RELIABLE.* You make stuff up and think it happened. You
can't tell people apart. In the middle of a thread discussing your confusion
between me and Peter Siebel, you then confused us again. You can't remember
who said what, or when things happened.

You need to get that looked at. Either something is physically wrong with
your brain, preventing you from being able to tell what happened and what you
imagined, or you are so blinded by obsession that you are lying to yourself
on a truly epic scale. Either way, this is a problem for a competent health
care professional, not one Usenet can help you with.

-s
 
S

Seebs

But sometimes they make mistakes. Mr. Nilges is not the first person
to spell my last name differently from how I do, and there do seem to
be a lot of variations. Sort of a :).

But how often do they do so in order to call you a douche?

Never ascribe to incompetence that which is clearly much better explained
by malice, especially coming from someone with a long and visible public
history of excessive malice.

-s
 
S

Seebs

The Annotated C Standard is two different books?

No, but the really blatant, horrible, feof() errors are in "C: The Complete
Reference". (At least in the 3rd and 4th editions; I haven't checked in
previous ones.)

So it's theoretically possible that he wrote that material without having
read the standard. Certainly, the annotations in the Annotated ANSI C
Standard do not suggest that he ever read the standard.
And again, you make the point; it is precisely that one *does not know*
that leads to such errors, which is excusable in someone just coming to C
from a Pascal background, but is hardly excusable in someone claiming
sufficient C competency to be annotating the standard.

Agreed.

It particularly impresses me that it survived even though several other errors
from the 3rd edition were fixed in the 4th.

-s
 
K

Keith Thompson

Seebs said:
No, but the really blatant, horrible, feof() errors are in "C: The Complete
Reference". (At least in the 3rd and 4th editions; I haven't checked in
previous ones.)

Not exclusively. He makes the same kind of error in "The Annotated
ANSI C Standard". Quoting <http://www.lysator.liu.se/c/schildt.html>,
which in turn is quoting Schildt:

The following fragment illustrates how files are commonly read:
do {
ch = fgetc (fp);
/* ... */
} while (!feof (fp));

I don't have my copy of TAACS handy, so I can't directly confirm the
quotation. I guess (or hope) that the indentation is better than
what's shown.
So it's theoretically possible that he wrote that material without having
read the standard. Certainly, the annotations in the Annotated ANSI C
Standard do not suggest that he ever read the standard.

No, they suggest that he read it but either didn't understand it or
didn't believe it.

[snip]
 
M

Moi

Not exclusively. He makes the same kind of error in "The Annotated ANSI
C Standard". Quoting <http://www.lysator.liu.se/c/schildt.html>, which
in turn is quoting Schildt:

The following fragment illustrates how files are commonly read: do {
ch = fgetc (fp);
/* ... */
} while (!feof (fp));


Well, this is so very wrong; my guess is even Spinoza would have got it right!
I don't have my copy of TAACS handy, so I can't directly confirm the
quotation. I guess (or hope) that the indentation is better than what's
shown.


No, they suggest that he read it but either didn't understand it or
didn't believe it.

AvK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,122
Messages
2,570,717
Members
47,283
Latest member
VonnieEwan

Latest Threads

Top