NUMERICAL RECIPES

N

nmm1

"schools of thought" - this is group opinion that is inappropriate on
objective matters. If there are no scientific studies on the
ergonomics of source code readability that you can reference, you are
just speaking dogma in the manner of a religious fanatic.

Well, there are. Lots. Of course, you will have to go into a
decent library and look up journals of the 1960s and 1970s to
find them. And, no, I can't remember the references after all
this time.

Of course, those results do NOT discourage the use of heterogeneous
tuples as loop controls - the reason that those never took off is
because nobody ever worked out a simple, clean syntax for them.
In C terms, things like:

for (i = 0, ptr = base, total = 0.0;
++i, ptr = ptr->next, total += ptr.value;
i < limit && ptr != NULL && total < maximum)

But - and this is CRITICAL - where the compiler checks that i, ptr
and total are NOT otherwise changed in the loop, and where the
above usage paradigm is enforced.

Some languages have such paradigms, and Fortran has the FORALL
construct, but it is not a success for reasons other than simple
readability.


Regards,
Nick Maclaren.
 
A

aruzinsky

Then again, there is a school of thought that the only things that
should appear in the loop control expression are things that *actually
control the loop*; IOW, just because you *can* initialize other
variables in the loop control expression doesn't mean you *should*.  I
prefer to keep my loop control expressions as clean as possible.

"schools of thought" - this is group opinion that is inappropriate on
objective matters. If there are no scientific studies on the
ergonomics of source code readability that you can reference, you are
just speaking dogma in the manner of a religious fanatic.
Given that I'm reading this in comp.lang.c, and since a lot of us in
c.l.c. aren't also C++ experts, it's a little much to expect us to
immediately understand something that specific to C++.

I'm reading and writing this in sci.math.num-analysis. If you want to
do something constructive, kill the cross poster for fooling you.
Yo.  His version was clearer for me to read at a glance than yours.

I meant vote between Jens Thoms Toerring's version of pointer use
versus a version using indexing instead of array pointers. Which do
you most want to see in Numerical Recipes?
 
N

nmm1

You are begging the question here. Statistically, "simple, clean
syntax," i.e., the simplicity and cleanliness of syntax should only be
determined by scientific studies and not informal group opinion,
whereas, you previously said, "Of course, those results do NOT
discourage the use of heterogeneous tuples as loop controls." You do
not have valid reasons for knowing why "those never took off" and you
should take an agnostic position.

Have you read those studies? I did. And you are suffering from
delusions if you think that you know what they found without doing
so, or you think you know what I have read and learnt.
Again, you wrongly pretend that "readability" is a property of
language and not a statistical property of people. Readability should
to be scientifically studied using statistical methods on a large
sampling of people. Until then, you should take an agnostic
position.

I am a statistician, incidentally, and those studies were considerably
more scientific than your claims of The One True Procedure.

Anyway, enough is enough.


Regards,
Nick Maclaren.
 
A

aruzinsky

Well, there are.  Lots.  Of course, you will have to go into a
decent library and look up journals of the 1960s and 1970s to
find them.  And, no, I can't remember the references after all
this time.

Of course, those results do NOT discourage the use of heterogeneous
tuples as loop controls - the reason that those never took off is
because nobody ever worked out a simple, clean syntax for them.

You are begging the question here. Statistically, "simple, clean
syntax," i.e., the simplicity and cleanliness of syntax should only be
determined by scientific studies and not informal group opinion,
whereas, you previously said, "Of course, those results do NOT
discourage the use of heterogeneous tuples as loop controls." You do
not have valid reasons for knowing why "those never took off" and you
should take an agnostic position.

That is not to say that you shouldn't have personal preferences. Just
don't pretend that your preferences apply to everyone or even most
people.

In C terms, things like:

for (i = 0, ptr = base, total = 0.0;
    ++i, ptr = ptr->next, total += ptr.value;
    i < limit && ptr != NULL && total < maximum)

But - and this is CRITICAL - where the compiler checks that i, ptr
and total are NOT otherwise changed in the loop, and where the
above usage paradigm is enforced.

Some languages have such paradigms, and Fortran has the FORALL
construct, but it is not a success for reasons other than simple
readability.

Again, you wrongly pretend that "readability" is a property of
language and not a statistical property of people. Readability should
to be scientifically studied using statistical methods on a large
sampling of people. Until then, you should take an agnostic
position.
 
A

aruzinsky

Have you read those studies?  I did.  And you are suffering from
delusions if you think that you know what they found without doing
so, or you think you know what I have read and learnt.

No, I am talking your word for it that "those results do NOT
discourage the use of heterogeneous tuples as loop controls." If by
"nobody" you mean no researcher in those studies, then it does not
logically follow this is the cause for them "not taking off."
I am a statistician, incidentally, and those studies were considerably
more scientific than your claims of The One True Procedure.

I don't recall making any "claims of The One True Procedure."

Your profile shows that, out of 6120 posts, you have ZERO in
sci.stat.math. Thusly, it seems that you have absolutely no interest
in your profession.
Anyway, enough is enough.

By what statistical procedure did you determine that "enough is
enough" such that you feel qualified to pontificate on how much is
enough?
 
T

Tim Rentsch

[snip]

I suggest that you try and think of a construct where phase 8 has
the concept of an array value (or even an array object) - you may
find it harder than you think :)

It's obvious the Standard considers array objects as existing at
runtime - simply witness the numerous uses of the term 'array
object' in subsections of 6.5, describing execution-time semantics.

And, while the conversion can often be done in phase 8 (just as
sizeof() can be), it is conceptually a phase 7 operation.

This statement is nonsense. Just because some conversions can be
done at compile time in some specific instances, the operation of
converting is still conceptually a run-time operation, in the same
way that '+' is a run-time operation even though '+' is done at
compile time in some constant expressions. If anyone needs
convincing, consider code like

int x[5][10];

...

int *p = x;

Here it isn't even known until execution which array object is being
converted, so the conversion must take place at run time.

You can
see that if you look at the specification of function declarations
and calls in detail, or consider code like:

double a[100], b[sizeof(a+0)];

A specious argument, because the sizeof operator works on types, not
values; no array-to-pointer conversion occurs in this code (either
at run time or at compile time), because the argument to sizeof is
never evaluated.
 
T

Tim Rentsch

aruzinsky said:
"schools of thought" - this is group opinion that is inappropriate on
objective matters. If there are no scientific studies on the
ergonomics of source code readability that you can reference, you are
just speaking dogma in the manner of a religious fanatic.

Do you have any scientific studies to back up that statement?
Or is it just your opinion?
 

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

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top