Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Question on app safety

158 views
Skip to first unread message

Rick C. Hodgin

unread,
Jun 19, 2018, 8:54:08 AM6/19/18
to
I had occasion today to write some code along these lines:

for (int pass = 1; pass <= 3; ++pass)
{
switch (pass)
{
case 1:
// Some code unique to pass-1 goes here
break;

case 2:
// Some code unique to pass-2 goes here
break;

case 3:
// Some code unique to pass-3 goes here
break;

default:
// ?? Something invalid
goto finished;
}

// Code common to all passes goes here
}
finished:

While lnPass should only ever be valid, what do you think about
a need to test the unexpected condition with the "default:" ?

--
Rick C. Hodgin

Rick C. Hodgin

unread,
Jun 19, 2018, 9:04:47 AM6/19/18
to
Let me try this again:

I had occasion today to write some code along these lines:

for (int pass = 1; pass <= 3; ++pass)
{
switch (pass)
{
case 1:
// Some code unique to pass-1 goes here
break;

case 2:
// Some code unique to pass-2 goes here
break;

case 3:
// Some code unique to pass-3 goes here
break;

default:
// ?? Something invalid
goto finished;
}

// Code common to all passes goes here
}
finished:

While "pass" should only ever be valid, what do you think about

Öö Tiib

unread,
Jun 19, 2018, 11:51:13 AM6/19/18
to
Given example contains strange design error that I have seen several
times in practice. To explain the design error I just rewrite the
code to equal one:

int pass = 1;
// Some code unique to pass-1 goes here
pass = 2;
// Some code unique to pass-2 goes here
pass = 3;
// Some code unique to pass-3 goes here
finished:

That is clearly superior way to write same thing as it is more
straight and robust?

If to imagine that the values of "pass" come from somewhere else
but from linear loop, then everything depends on contract with that
source. If it is contract violation (IOW programming or maintenance
error) then I abort the program. If it is required that I ignore
other values then I ignore those. If it is required that I throw 42
on other values then I throw 42. Simple?

james...@alumni.caltech.edu

unread,
Jun 19, 2018, 12:25:38 PM6/19/18
to
As Öö Tiib points out, that's a weird way to write the code; it could be written much simpler. But let's assume that it's some more reasonable context, such as removing the break statements, so each pass through the loop executes a smaller subset of the code. The loop-switch then provides a convenient way to re-use the code that's shared between different passes through the loop.

My own general rule is that if the validity of a variable's value is clearly and absolutely guaranteed by code within the same source code file, there's no need to write code to deal with the possibility that it's invalid. Otherwise, it's mandatory to check the validity at least once between evaluation of any code that could cause it to become invalid, and the execution of code that would be problematic if it is invalid.

This rule works fairly well for me, in part because I don't believe in writing source code files that are so large that it's hard to verify such things. Encapsulation helps too, because it often avoids having to check code in other modules.

Lew Pitcher

unread,
Jun 19, 2018, 12:38:54 PM6/19/18
to
Rick C. Hodgin wrote:

> Let me try this again:
>
> I had occasion today to write some code along these lines:
>
> for (int pass = 1; pass <= 3; ++pass)
> {
> switch (pass)
> {
> case 1:
> // Some code unique to pass-1 goes here
> break;
>
> case 2:
> // Some code unique to pass-2 goes here
> break;
>
> case 3:
> // Some code unique to pass-3 goes here
> break;
>
> default:
> // ?? Something invalid
> goto finished;
> }
>
> // Code common to all passes goes here
> }
> finished:

Gaak! WTF are you doing? Clearly, you've coded logic of the "Loop/Switch"
antipattern (https://en.wikipedia.org/wiki/Loop-switch_sequence). Don't do
that.


> While "pass" should only ever be valid, what do you think about
> a need to test the unexpected condition with the "default:" ?

I think that you should not code to that antipattern. Instead, you package
your "common code" into a function or macro. Then you unroll the loop, and
invoke your "common code" after each discrete step.

--
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request

Rick C. Hodgin

unread,
Jun 19, 2018, 12:43:05 PM6/19/18
to
On 6/19/2018 12:38 PM, Lew Pitcher wrote:
> Gaak! ... are you doing?

If you have any desire to communicate with me, and I with you, then
remove profanity from your posts.

I'm fine with your decision either way, Lew.

--
Rick C. Hodgin

Rick C. Hodgin

unread,
Jun 19, 2018, 12:43:23 PM6/19/18
to
Your rewrite is not the same. It would need to be this:

int pass = 1;
// Some code unique to pass-1 goes here
// Common code here
pass = 2;
// Some code unique to pass-2 goes here
// Common code here
pass = 3;
// Some code unique to pass-3 goes here
// Common code here

-----
My question was more along the lines of needing the default: clause
there, or if, given the constraint that pass will only be 1..3 in
this case, is it needed? And why do you think that?

--
Rick C. Hodgin

Mr Flibble

unread,
Jun 19, 2018, 12:50:54 PM6/19/18
to
OMFG, what profanity you egregious cunt of a cock womble?

/Flibble

--
"Suppose it’s all true, and you walk up to the pearly gates, and are
confronted by God," Bryne asked on his show The Meaning of Life. "What
will Stephen Fry say to him, her, or it?"
"I’d say, bone cancer in children? What’s that about?" Fry replied.
"How dare you? How dare you create a world to which there is such misery
that is not our fault. It’s not right, it’s utterly, utterly evil."
"Why should I respect a capricious, mean-minded, stupid God who creates a
world that is so full of injustice and pain. That’s what I would say."

Scott Lurndal

unread,
Jun 19, 2018, 12:51:05 PM6/19/18
to
"Rick C. Hodgin" <rick.c...@gmail.com> writes:
>On 6/19/2018 12:38 PM, Lew Pitcher wrote:
> > Gaak! ... are you doing?
>
>If you have any desire to communicate with me, and I with you, then
>remove profanity from your posts.

WTF you talkin' about, willis?

Rick C. Hodgin

unread,
Jun 19, 2018, 1:06:40 PM6/19/18
to
On Tuesday, June 19, 2018 at 12:50:54 PM UTC-4, Mr Flibble wrote:
> [snip]

*plonk*

If you want to be restored, you know how to email me. I will
require no more than an apology, and the promise to not treat
me with such disrespect in the future.

--
Rick C. Hodgin

Rick C. Hodgin

unread,
Jun 19, 2018, 1:07:08 PM6/19/18
to

james...@alumni.caltech.edu

unread,
Jun 19, 2018, 2:01:31 PM6/19/18
to
You deserve more respect than that? Why? You don't deserve to receive
any more respect than you give to other people, and you pay no respect
to the rules of usenet etiquette about using appropriate forums to
discuss your religious beliefs.

Öö Tiib

unread,
Jun 19, 2018, 2:07:46 PM6/19/18
to
I usually put common code that I need several times into a function.

> My question was more along the lines of needing the default: clause
> there, or if, given the constraint that pass will only be 1..3 in
> this case, is it needed? And why do you think that?

That default can only happen because of programming error. For example
you extend passes to 1..5, add handler to pass 4 but forget to add pass 5.
I would leave it there but make it to abort or assert(false).
Such checks help to detect errors as early as possible. There are no
much point to handle it in any other way because programs can not fix
programming errors; only programmers can.

Rick C. Hodgin

unread,
Jun 19, 2018, 2:16:51 PM6/19/18
to
The things I teach people are not religion. They're about forgiveness
of sin and the gaining of eternal life. Religion has nothing to do with
it. Religion destroys men. What He's offering frees men and restores
them to eternity.

Bottom line: Forgiveness of sin is required to enter in to the Kingdom
of God. The One I teach about hands out total forgiveness for the asking.

-----
It's important, James. There are no more important things.

And in addition, as I've cited many times, Matthew 28:18 states that
all authority in Heaven and Earth has been given to Him, and that He
then gives a command to all disciples to "go ye therefore and teach
all nations." The reference there to "all nations" is not of geography
or land or buildings or structures. It's the people who live in those
nations.

Someday everyone here will see the value in my teachings. My prayer
for all of them is it's before they leave this world so they are for-
given, and enter into eternity alive.

--
Rick C. Hodgin

Mr Flibble

unread,
Jun 19, 2018, 2:53:24 PM6/19/18
to
On 19/06/2018 19:16, Rick C. Hodgin wrote:
> On 6/19/2018 2:01 PM, james...@alumni.caltech.edu wrote:
>> On Tuesday, June 19, 2018 at 1:07:08 PM UTC-4, Rick C. Hodgin wrote:
>>> On Tuesday, June 19, 2018 at 12:51:05 PM UTC-4, Scott Lurndal wrote:
>>>> [snip]
>>>
>>> *plonk*
>>>
>>> If you want to be restored, you know how to email me.  I will
>>> require no more than an apology, and the promise to not treat
>>> me with such disrespect in the future.
>>
>> You deserve more respect than that? Why? You don't deserve to receive
>> any more respect than you give to other people, and you pay no respect
>> to the rules of usenet etiquette about using appropriate forums to
>> discuss your religious beliefs.
>
> The things I teach people are not religion.

Christianity is a religion mate.

Rick C. Hodgin

unread,
Jun 19, 2018, 3:03:09 PM6/19/18
to
On Tuesday, June 19, 2018 at 2:53:24 PM UTC-4, Mr Flibble wrote:
> On 19/06/2018 19:16, Rick C. Hodgin wrote:
> > The things I teach people are not religion.
>
> Christianity is a religion mate.

The world sees Christianity as a religion, Leigh. It's not at all
what I'm talking about. I'm talking about forgiveness of sin through
the atoning sacrifice of Jesus Christ at the cross.

It is about what it written in John 3:

https://www.biblegateway.com/passage/?search=John+3&version=KJV
3 Jesus answered and said unto him, Verily, verily, I say unto
thee, Except a man be born again, he cannot see the kingdom
of God.

You must be born again, Leigh. It's the only way to enter into the
Kingdom of God.

It's not religion. And religion is not what I teach. I teach that
you are a sinner and you must be forgiven if you want to escape
literal Hellfire.

It's the same for all people world-wide.

--
Rick C. Hodgin

PS -- I still see your posts on Google Groups. If you want to learn
more about this, the Bible's right there. The churches are in
your city. There are forums dedicated to this type of teaching.
There are YouTube videos. And more. Are you willing to seek
the truth? Are you willing to test your beliefs against true
teachings of God?

Mr Flibble

unread,
Jun 19, 2018, 3:20:55 PM6/19/18
to
On 19/06/2018 20:02, Rick C. Hodgin wrote:
> On Tuesday, June 19, 2018 at 2:53:24 PM UTC-4, Mr Flibble wrote:
>> On 19/06/2018 19:16, Rick C. Hodgin wrote:
>>> The things I teach people are not religion.
>>
>> Christianity is a religion mate.
>
> The world sees Christianity as a religion, Leigh. It's not at all
> what I'm talking about. I'm talking about forgiveness of sin through
> the atoning sacrifice of Jesus Christ at the cross.

Christianity is a religion mate.

Rick C. Hodgin

unread,
Jun 19, 2018, 3:35:56 PM6/19/18
to
On Tuesday, June 19, 2018 at 3:20:55 PM UTC-4, Mr Flibble wrote:
> On 19/06/2018 20:02, Rick C. Hodgin wrote:
> > On Tuesday, June 19, 2018 at 2:53:24 PM UTC-4, Mr Flibble wrote:
> >> On 19/06/2018 19:16, Rick C. Hodgin wrote:
> >>> The things I teach people are not religion.
> >>
> >> Christianity is a religion mate.
> >
> > The world sees Christianity as a religion, Leigh. It's not at all
> > what I'm talking about. I'm talking about forgiveness of sin through
> > the atoning sacrifice of Jesus Christ at the cross.
>
> Christianity is a religion mate.

There's more to the truth of who Jesus is than your gainsaying reply.

If you ever want to seek the truth, Leigh, you will find it. All who
seek the truth do. The rest will perish in their arrogance.

--
Rick C. Hodgin

Chris M. Thomasson

unread,
Jun 19, 2018, 9:48:17 PM6/19/18
to
How exactly do the letters Gaak! = profanity?

Rick C. Hodgin

unread,
Jun 19, 2018, 9:54:32 PM6/19/18
to
On 6/19/2018 9:48 PM, Chris M. Thomasson wrote:
> How exactly do the letters Gaak! = profanity?


How do you come into a mature thread and not read to the end before
posting a response?

--
Rick C. Hodgin

Joe Pfeiffer

unread,
Jun 19, 2018, 10:38:07 PM6/19/18
to
"Rick C. Hodgin" <rick.c...@gmail.com> writes:

That's how you find bugs in your code. Do it.

james...@alumni.caltech.edu

unread,
Jun 19, 2018, 11:53:25 PM6/19/18
to
On Tuesday, June 19, 2018 at 2:16:51 PM UTC-4, Rick C. Hodgin wrote:
> On 6/19/2018 2:01 PM, james...@alumni.caltech.edu wrote:
> > On Tuesday, June 19, 2018 at 1:07:08 PM UTC-4, Rick C. Hodgin wrote:
> >> On Tuesday, June 19, 2018 at 12:51:05 PM UTC-4, Scott Lurndal wrote:
> >>> [snip]
> >>
> >> *plonk*
> >>
> >> If you want to be restored, you know how to email me. I will
> >> require no more than an apology, and the promise to not treat
> >> me with such disrespect in the future.
> >
> > You deserve more respect than that? Why? You don't deserve to receive
> > any more respect than you give to other people, and you pay no respect
> > to the rules of usenet etiquette about using appropriate forums to
> > discuss your religious beliefs.
>
> The things I teach people are not religion.

It hardly matters whether or not you acknowledge the religious nature of the beliefs you're teaching. Either way, what you are teaching is off-topic here. Even if the things you believe were true, it would still be the case that there would need to be appropriate places to discuss things other than the truth of those beliefs; places where it would, in fact, be inappropriate, and in fact, downright rude, to discuss those matters - and this is one of those places. In the real world where the truth of your beliefs is strongly disputed by many others, there definitely needs to be a place (more accurately, MANY places) where it's inappropriate to argue over the validity of such beliefs, just for the sake of the general peace.

Christian Gollwitzer

unread,
Jun 20, 2018, 1:15:58 AM6/20/18
to
Am 20.06.18 um 03:48 schrieb Chris M. Thomasson:
It's not the Gaak, it's the "WTF" that he has omitted from the quote
(indicated by an ellipsis). Still doesn't make sense to me to plonk
anyone because of this.

Strangely, he has responded to Flibble's posts afterwards, so it seems
he hasn't fulfilled has promise to plonk everybody who posts WTF.

WTF WTF WTF! Holy smoke! ;)
Christian

Kenny McCormack

unread,
Jun 20, 2018, 2:16:08 AM6/20/18
to
In article <pgcnu6$fkp$1...@dont-email.me>,
To be plonked by RCH is indeed an honor.

--
Nov 4, 2008 - the day when everything went
from being Clinton's fault to being Obama's fault.

Kenny McCormack

unread,
Jun 20, 2018, 3:03:37 AM6/20/18
to
In article <43333e22-9a71-42d5...@googlegroups.com>,
RCH is entirely within his rights to state that unless you send him $1000,
he won't talk to you. He can make whatever conditions he likes.

As can you.

As can I.

Incidentally, lots of people on TV do exactly this - and people fall for
it. These people are often called "televangelists".

--
Atheism:
It's like being the only sober person in the car, and nobody will let you drive.

Rick C. Hodgin

unread,
Jun 20, 2018, 7:07:11 AM6/20/18
to
On 6/20/2018 1:15 AM, Christian Gollwitzer wrote:
> [snip]

You separate yourself, Christian (and others) because you choose by
your own choices to make yourself an enemy of God by disparaging
another human being. You disrespect the one pointing you to the One
who can save your soul. You choose to reject His guidance for your
life to love one another and help one another.

All people were created in the image and likeness of God. But not
all people will be saved. Those who reject Him will be damned (and
to attack His creation, your fellow human beings, is to reject Him).
Those who humble themselves, repent, ask forgiveness for their sin,
they are the ones who will be saved. They are the ones who seek to
serve Him in this world, to point others to Him, to teach of His ways
so that others may hear and be saved.

This world is being divided into two camps: saved, unsaved. It is
becoming so very clear which side everyone is on by their actions
and choices.

You may think you simply "get rid of Rick" in a case like this, but
what you have really done is rid yourself of eternity. By making
the choice to disparage me, you are disparaging God (see below), and
in so doing you maintain your enemy-of-God status, unrepentant, and
literally on your way to judgment and Hellfire after you leave this
world.

BTW, this is not just about disparaging me, but rather doing so to
any person world-wide, for we were all created in His image:

https://www.biblegateway.com/passage/?search=Matthew+25%3A32-40&version=KJV

These things I teach ... they are not my own. I repeat His words,
and even more importantly, I point you to His words to STUDY THEM
FOR YOURSELF! I do not want or ask you to take my word for it. I
ask you to examine for yourself if what I say is true. You will
not only find it is, but you will find the source of all truth, and
the wellspring of life eternal.

-----
*plonk*

If you want to be restored, you know how to email me. I will require
no more than an apology, and the promise to not treat me with such
disrespect in the future.

--
Rick C. Hodgin

Rick C. Hodgin

unread,
Jun 20, 2018, 7:25:25 AM6/20/18
to
On 6/19/2018 11:53 PM, james...@alumni.caltech.edu wrote:
> ... Either way, what you are teaching is off-topic here.

There's a hierarchy of authority, James. Jesus said in Matthew 28:18
that all authority in Heaven and Earth has been given Him. He then
commands us to go forth and teach all nations.

https://www.biblegateway.com/passage/?search=Matthew+28%3A18&version=KJV

18 And Jesus came and spake unto them, saying, All power is
given unto me in heaven and in earth.
19 Go ye therefore, and teach all nations, baptizing them in
the name of the Father, and of the Son, and of the Holy Ghost:

To bring this into our terms:

If you were an employee, and your co-worker or boss told you to do X,
but the president of the company told you to do Y ... what would you
do?

> Even if the things you believe were true, it would still be the
> case that there would need to be appropriate places to discuss
> things other than the truth of those beliefs;

I'm trying to teach you, James. Nobody knows when they will die.
The message is, therefore, an imperative to all people. Nobody
will enter into eternal life alive (in Heaven with God) unless they
are forgiven for their sin and born again. Only Jesus can do this,
which manes there are no inappropriate public forums to teach it.

I hope someday you understand this. If you do, you'll understand
why our best efforts to teach often fall on not only deaf ears,
but rebellious ears. It's because of what John 6:44 teaches below:

> places where it would, in fact, be inappropriate, and in fact,
> downright rude, to discuss those matters - and this is one of
> those places. In the real world where the truth of your beliefs
> is strongly disputed by many others, there definitely needs to
> be a place (more accurately, MANY places) where it's inappropriate
> to argue over the validity of such beliefs, just for the sake of
> the general peace.

I don't argue with people, James. I teach. It's up to the person
to receive it, for nobody can come to Christ unless God the Father
first draw them. It requires a movement of the spirit to bring that
new life into existence, for it is not a work of the flesh:

https://www.biblegateway.com/passage/?search=John+6%3A44&version=KJV

44 No man can come to me, except the Father which hath sent me
draw him: and I will raise him up at the last day.

Please consider these words. I don't write them just to espouse.
I'm trying to teach you the truth ... that you have need to be
forgiven or your entire eternal future will be horrendous for you.

--
Rick C. Hodgin

Rick C. Hodgin

unread,
Jun 20, 2018, 8:23:41 AM6/20/18
to
That's the answer. Thank you.

--
Rick C. Hodgin

Rick C. Hodgin

unread,
Jun 20, 2018, 8:28:06 AM6/20/18
to
On 6/20/2018 3:03 AM, Kenny McCormack wrote:
> Incidentally, lots of people on TV do exactly this - and people fall for
> it. These people are often called "televangelists".

God guide us to be discerning, Kenny. Those who are disciples of Christ
teach others to be the same way.

Not everyone who calls upon the name of the Lord will be saved, but he
who does the will of the Father, meaning they take up their cross and
follow Him daily.

We are servants, ambassadors, royal priests, and our mission is to go
out and teach others that they too can become servants, ambassadors,
and royal priests of Him here in this world.

It's a true change that's being described, Kenny. It's not religion.
It's a fundamental re-wiring from the inside out. It is literally what
Jesus calls, "Being born again."

You were born once into your flesh. When Jesus saves you, you are born
into spirit. You can't see the spirit, but the change is manifested in
your life by the way your insides work. You then hate the things you
used to love, and love the things you used to hate. It's a full change
of polarity. A true reversal, because the spirit seeks the things of
God, and the flesh seeks the things of this world, all of which are in
sin, and all of which lead to our soul's destruction in Hell.

Read John 3. You must be born again of the spirit to be saved.

https://www.biblegateway.com/passage/?search=John+3&version=KJV

If the KJV translation is too difficult to read, use a more modern
translation, but then come back to the KJV for a better translation.

--
Rick C. Hodgin

Scott Lurndal

unread,
Jun 20, 2018, 9:02:08 AM6/20/18
to
"Rick C. Hodgin" <rick.c...@gmail.com> writes:

>All people were created in the image and likeness of a god.

Actually, all people evolved from collections of amino acids. So
the rest of your thesis is null and void. Take it somewhere else.

David Brown

unread,
Jun 20, 2018, 10:12:23 AM6/20/18
to
It is /an/ answer - but not /the/ answer. And it is not a good answer.

(If my post here seems critical, it is critical of Joe's post - not yours.)

The best way to avoid bugs in the code is to program in a way that
reduces the likelihood of them occurring in the first place. This kind
of switch-in-a-loop is generally a poor structure to use, because it is
easy to get mixed up and write incorrect code.

If you can clearly see that "pass" is always valid then there is no need
for code to handle invalid values. And if you can't clearly see that
"pass" is always valid, then re-write the code until you can.

What you are doing here is writing code that should never be called,
which can never be tested, and /if/ something has gone wrong in the
program to give you an invalid "pass", it will cover up the problem so
you can't find it. It is /not/ "how you find bugs in your code" - it is
how you hide bugs and cause yourself bigger problems in the future.




Ben Bacarisse

unread,
Jun 20, 2018, 10:39:59 AM6/20/18
to
<snip>
> What you are doing here is writing code that should never be called,
> which can never be tested, and /if/ something has gone wrong in the
> program to give you an invalid "pass", it will cover up the problem so
> you can't find it. It is /not/ "how you find bugs in your code" - it is
> how you hide bugs and cause yourself bigger problems in the future.

I agree. The default case only exists because the structure permits the
cases to become synchronised from the loop.

Writing

// code unique to pass 1
code_common_to_all_passes(...);
// code unique to pass 2
code_common_to_all_passes(...);
// code unique to pass 3
code_common_to_all_passes(...);

is shorter and more explicit. If the number of passes needs to be
easily changed, I'd write

for (size_t n = 0; n < sizeof pass_fn/sizeof *pass_fn; n++) {
pass_fn[n](...);
// Code common to all passes goes here
// maybe still wrapped in a function.
}

As general rule for people starting out in programming, I'd say that
whenever you are pondering the merits of some code structure that you
are not sure about, ask yourself first if more functions would help.

--
Ben.

Rick C. Hodgin

unread,
Jun 20, 2018, 10:48:36 AM6/20/18
to
On 6/20/2018 10:12 AM, David Brown wrote:
> On 20/06/18 14:23, Rick C. Hodgin wrote:
>> On 6/19/2018 10:37 PM, Joe Pfeiffer wrote:
>>> That's how you find bugs in your code. Do it.
>>
>> That's the answer. Thank you.
>
> It is /an/ answer - but not /the/ answer. And it is not a good answer.

I disagree. To not have that code in there introduces the possibility of
there being an unexpected error at runtime which causes a crash, and the
cause of the crash may then be unknown as it may propagate to some other
point which calls something which crashes there and you don't know the
true source or root of the issue.

To have the default: code in there would do very little (mildly pollute
the instruction cache with typically unused opcodes, but those could be
minimized by simply having a call instruction in there), and it would
give root diagnostic information when something goes awry.

I am totally on board with Joe's concept here. I think it's brilliant.
It's a correct philosophy in my judgment, and I intend to incorporate it
at all points in my development in moving forward.

I may even add a compiler switch to CAlive to enable this kind of auto-
identifying of unspecified code without having to type them in when some-
thing like my example (without a default:) is given, or a way to at least
catch all passes that are un-tested, such as:

if (a == 1) {
// code here
} else if (a == 5) {
// code here
}

In this case there's no else {..} block there. The switch would auto-
inject an else {..} block in there and have it call a function with
line information allowing that location to be trapped and observed.

It's all useful information, and it's another tool in the toolbox.

-----
I know you disagree. I won't debate you. It won't affect you anyway
because it's going to be in CAlive, and you'll never use CAlive ... so
don't let it bother you.

--
Rick C. Hodgin

Joe Pfeiffer

unread,
Jun 20, 2018, 11:04:52 AM6/20/18
to
"Rick C. Hodgin" <rick.c...@gmail.com> writes:

> On 6/20/2018 10:12 AM, David Brown wrote:
>> On 20/06/18 14:23, Rick C. Hodgin wrote:
>>> On 6/19/2018 10:37 PM, Joe Pfeiffer wrote:
>>>> That's how you find bugs in your code. Do it.
>>>
>>> That's the answer. Thank you.
>>
>> It is /an/ answer - but not /the/ answer. And it is not a good answer.
>
> I disagree. To not have that code in there introduces the possibility of
> there being an unexpected error at runtime which causes a crash, and the
> cause of the crash may then be unknown as it may propagate to some other
> point which calls something which crashes there and you don't know the
> true source or root of the issue.

Note that my response was only to the question as asked, and other
people pointed out that the switch-in-a-loop is a bad idea in the first
place.

My response also wasn't clear enough, as it wasn't explicit enough about
what to do in the default: case. Just to make sure there's no
confusion, when I said it was a way to find bugs in your code I meant
that what should happen in that case is an error exit. It should *not*
be used (as others suggested I meant it to be used) to cover up errors.

Rick C. Hodgin

unread,
Jun 20, 2018, 11:24:31 AM6/20/18
to
Understood, and I agree.

To be honest, in my 30+ years of programming, I've never had a solid
teaching or belief on this issue. I've gone back-and-forth in my
thinking at times on what to do in those cases, and until your post
I've never had a solid direction.

Your simple reply has cleared up 30+ years of waffling, and given me
a solid course forward.

I also agree and disagree with the belief that you shouldn't use a
switch-in-a-loop coding style. It depends on what your goals are.
Sometimes it's nice to document everything when there are variables
per pass that can be set easily:

// Prior prologue code here
for (pass = 1; pass <= 3; ++pass)
{
// Prologue common code

switch (pass)
{
case 1: { x = 1; y = 9; z = 3; break; }
case 2: { x = 8; y = 6; z = 4; break; }
case 3: { x = 4; y = 1; z = 2; break; }
}

// Epilogue common code here
}
// Additional epilogue code here

In this type of model, when performance is not an issue, it greatly
aids in documenting the operation. You have a single source to view
the changes (if they can be aligned in this way, and in my particular
case they could be), and it is a nice way to organize your code. In
addition, the compiler should optimize out the code inefficiencies
and re-order things to be optimal for you. So, why not making it a
little easier for the next guy who comes after you to read and follow?
And if it does become a performance bottleneck, then refactor it.

Not everything written in C or C++ has to be blazing. Sometimes you
just need access to low-level abilities in some bits, but go ahead
and code other parts because you're there. I'm actually starting to
get away from that, which is why I made an announcement the other day
that CAlive will also support VXB code (an xbase language) natively,
so that the two are interchangeable without vxb {..} blocks as would
have been previously required. This will allow some operations to be
done in CAlive, and some in VXB, making the overall runtime faster
when needed, and more efficient as well (for the developer).

--
Rick C. Hodgin

Puppet_Sock

unread,
Jun 20, 2018, 12:35:59 PM6/20/18
to
On Tuesday, June 19, 2018 at 2:16:51 PM UTC-4, Rick C. Hodgin wrote:
[snip]
> The things I teach people are not religion.

For some reason, I flashed on that scene from Crocodile Dundee
about "That's not a knife. THAT'S a knife."

That's not a religion.

http://www.khemorex-klinzhai.de/e/culture/rituals/marriage.html

> The Klingon hearts destroyed the gods who created them
> and turned the heavens to ashes.

THAT'S a religion.

Mr Flibble

unread,
Jun 20, 2018, 12:40:33 PM6/20/18
to
Try not to confuse abiogenesis with evolution: they are two separate
processes but Kooky Rick will deny both of them just as he denies that the
speed of light in a vacuum coupled with what we can observe in the night
sky falsify his crazy 7000 year old Earth theory. He puts it all down to
a deception of Satan. You can't really have a sensible debate with that
kind of crazy.

Rick C. Hodgin

unread,
Jun 20, 2018, 12:43:15 PM6/20/18
to
I remember that. I remember when I heard it (back before I was a
Christian) thinking, "Oh ... how awful."

The Bible does warn about gods, by the way (lower-case g, and plural).
It says there are gods, but there is only one God Almighty, who is
God the Father, Son, Holy Spirit.

The Bible is logical. God created everything. He used a certain
type of "mixture" when He did it, and it's all held together with
truth. His Son, Jesus Christ, /is/ truth. Sin is non-truth.

So sin cannot exist in God's Kingdom. It's like a cancer trying
to exist in a body. That cancer destroys everything it touches.

It's why God isolates sin into a special place of confinement
called Hell. And it is filled with fire and brimstone so the
individual who wields sin (who is that cancer destroying the
healthy body) cannot move. Cannot think. Can only sit there and
respond to the pain with agony unending.

God gives everyone a chance to be a part of His Kingdom. He will
forgive all of our sin. But only those who will acknowledge their
sin as sin, repent of the same, and move forward, will be saved.
The rest will literally perish in their sin.

There are two births, and two deaths, one of the flesh, one of the
spirit. Those who are born twice will only die once, for the first
birth is flesh, the second is spirit and is eternal. But those who
are only born once will die twice, first in the flesh, and then in
eternity in Hell (Revelation 19).

--
Rick C. Hodgin

Rick C. Hodgin

unread,
Jun 20, 2018, 12:50:35 PM6/20/18
to
[Note: I still see your posts on Google Groups]

On Wednesday, June 20, 2018 at 12:40:33 PM UTC-4, Mr Flibble wrote:
> Try not to confuse abiogenesis with evolution: they are two separate
> processes but Kooky Rick will deny both of them just as he denies that the
> speed of light in a vacuum coupled with what we can observe in the night
> sky falsify his crazy 7000 year old Earth theory. He puts it all down to
> a deception of Satan. You can't really have a sensible debate with that
> kind of crazy.

I do not, Leigh. You misrepresent me. You do not listen to the things
I write. You assume over them and you make mistakes.

I told you that when we (developers) create a game scene in some game,
it is fully formed. Your NeoGFX does something similar in generating
a form. All of the parts are there. We create the foreground, the
background, and it all appears and is usable the moment that scene is
enabled.

With God, who operates on universe scales with infinite resources,
there's nothing illogical about Him creating everything where it is,
and then setting it in motion for our benefit.

God Almighty can wield universes like we wield computer software
instances. The difference is we are uncaring toward our creations.
He gave His creation a breath of life, and He does care about it.
He gives us the opportunity to become His sons and daughters.

You'll miss it, Leigh ... unless you seek the truth. It breaks my
heart to see you believing and repeating lies about what you think
I believe when you've been told information to the contrary multiple
times.

--
Rick C. Hodgin

Mr Flibble

unread,
Jun 20, 2018, 12:56:25 PM6/20/18
to
On 20/06/2018 17:50, Rick C. Hodgin wrote:
> [Note: I still see your posts on Google Groups]
>
> On Wednesday, June 20, 2018 at 12:40:33 PM UTC-4, Mr Flibble wrote:
>> Try not to confuse abiogenesis with evolution: they are two separate
>> processes but Kooky Rick will deny both of them just as he denies that the
>> speed of light in a vacuum coupled with what we can observe in the night
>> sky falsify his crazy 7000 year old Earth theory. He puts it all down to
>> a deception of Satan. You can't really have a sensible debate with that
>> kind of crazy.
>
> I do not, Leigh. You misrepresent me. You do not listen to the things
> I write. You assume over them and you make mistakes.
>
> I told you that when we (developers) create a game scene in some game,
> it is fully formed. Your NeoGFX does something similar in generating
> a form. All of the parts are there. We create the foreground, the
> background, and it all appears and is usable the moment that scene is
> enabled.
>
> With God, who operates on universe scales with infinite resources,
> there's nothing illogical about Him creating everything where it is,
> and then setting it in motion for our benefit.

If God created everything where it is 7000 years ago the night sky would
be almost empty as we couldn't observe things further than 7000 light
years away. Sorry mate but your crazy creationist theory just doesn't
hold water; it doesn't stand up to observable facts and logic.

>
> God Almighty can wield universes like we wield computer software
> instances. The difference is we are uncaring toward our creations.
> He gave His creation a breath of life, and He does care about it.
> He gives us the opportunity to become His sons and daughters.
>
> You'll miss it, Leigh ... unless you seek the truth. It breaks my
> heart to see you believing and repeating lies about what you think
> I believe when you've been told information to the contrary multiple
> times.

Sadly it is you who believes fictions as the truth and there is no helping
you as you are too far gone.

Rick C. Hodgin

unread,
Jun 20, 2018, 2:42:25 PM6/20/18
to
On Wednesday, June 20, 2018 at 12:56:25 PM UTC-4, Mr Flibble wrote:
> If God created everything where it is 7000 years ago the night sky would
> be almost empty as we couldn't observe things further than 7000 light
> years away. Sorry mate but your crazy creationist theory just doesn't
> hold water; it doesn't stand up to observable facts and logic.

He could put the light there en-route, Leigh.

> > God Almighty can wield universes like we wield computer software
> > instances. The difference is we are uncaring toward our creations.
> > He gave His creation a breath of life, and He does care about it.
> > He gives us the opportunity to become His sons and daughters.
> >
> > You'll miss it, Leigh ... unless you seek the truth. It breaks my
> > heart to see you believing and repeating lies about what you think
> > I believe when you've been told information to the contrary multiple
> > times.
>
> Sadly it is you who believes fictions as the truth and there is no helping
> you as you are too far gone.

You say what you believe about evolution is true. But there is a
huge and growing body of evidence that it's false. Even staunch
evolutionists like Richard Dawkins are now believing in intelligent
design (thanks largely to genetic research which describes how
complex DNA is). So now we get wild theories like aliens came here
and seeded our planet, and they grew up in some kind of Darwinian
evolution.

There's a man who dedicated a whole series to prove how wrong it is,
and how many things we've been taught in school were proven wrong
even 140+ years ago:

Lies in the textbooks:
https://www.youtube.com/watch?v=yKYTH-fkg5Q

It continues through many days after that. The series just ended a
few days ago actually.

--
Rick C. Hodgin

Mr Flibble

unread,
Jun 20, 2018, 3:35:25 PM6/20/18
to
On 20/06/2018 19:42, Rick C. Hodgin wrote:
> On Wednesday, June 20, 2018 at 12:56:25 PM UTC-4, Mr Flibble wrote:
>> If God created everything where it is 7000 years ago the night sky would
>> be almost empty as we couldn't observe things further than 7000 light
>> years away. Sorry mate but your crazy creationist theory just doesn't
>> hold water; it doesn't stand up to observable facts and logic.
>
> He could put the light there en-route, Leigh.

Of course he did! As I said you are too far gone.

> You say what you believe about evolution is true. But there is a
> huge and growing body of evidence that it's false. Even staunch
> evolutionists like Richard Dawkins are now believing in intelligent
> design (thanks largely to genetic research which describes how
> complex DNA is). So now we get wild theories like aliens came here
> and seeded our planet, and they grew up in some kind of Darwinian
> evolution.

False assertion made without evidence. Assertions made without evidence
can be summarily dismissed without evidence.

>
> There's a man who dedicated a whole series to prove how wrong it is,
> and how many things we've been taught in school were proven wrong
> even 140+ years ago:
>
> Lies in the textbooks:
> https://www.youtube.com/watch?v=yKYTH-fkg5Q
>
> It continues through many days after that. The series just ended a
> few days ago actually.

Speed of light mate.

Scott Lurndal

unread,
Jun 20, 2018, 3:59:31 PM6/20/18
to
Mr Flibble <flibbleREM...@i42.co.uk> writes:
>On 20/06/2018 19:42, Rick C. Hodgin wrote:
>> On Wednesday, June 20, 2018 at 12:56:25 PM UTC-4, Mr Flibble wrote:
>>> If God created everything where it is 7000 years ago the night sky would
>>> be almost empty as we couldn't observe things further than 7000 light
>>> years away. Sorry mate but your crazy creationist theory just doesn't
>>> hold water; it doesn't stand up to observable facts and logic.
>>
>> He could put the light there en-route, Leigh.
>
>Of course he did! As I said you are too far gone.
>
>> You say what you believe about evolution is true. But there is a
>> huge and growing body of evidence that it's false. Even staunch
>> evolutionists like Richard Dawkins are now believing in intelligent
>> design (thanks largely to genetic research which describes how
>> complex DNA is). So now we get wild theories like aliens came here
>> and seeded our planet, and they grew up in some kind of Darwinian
>> evolution.
>
>False assertion made without evidence. Assertions made without evidence
>can be summarily dismissed without evidence.

Yeah, and RCH is bearing false witness vis-a-vis Professor Dawkins. If it so
easy for RCH to lie about Professor Dawkins, well, that says much about RCH.


"Dawkins is a prominent critic of creationism, a religious belief that humanity, life, and
the universe were created by a deity[130] without recourse to evolution."

"The Blind Watchmaker, contains a sustained critique of the argument from design,"

"Dawkins has opposed the inclusion of intelligent design in science education, describing it as "not a scientific argument at all, but a religious one"

Ben Bacarisse

unread,
Jun 20, 2018, 4:39:33 PM6/20/18
to
"Rick C. Hodgin" <rick.c...@gmail.com> writes:
<snip>
> I also agree and disagree with the belief that you shouldn't use a
> switch-in-a-loop coding style.

I'm not certain (though I've not gone back to check) that that was the
point being made. The problem is a pattern that needlessly introduces
the possibility of an error. Enumerating passes is just a very simple
state machine, and that's often done with a loop and a switch.

> Sometimes it's nice to document everything when there are variables
> per pass that can be set easily:
>
> // Prior prologue code here
> for (pass = 1; pass <= 3; ++pass)
> {
> // Prologue common code
>
> switch (pass)
> {
> case 1: { x = 1; y = 9; z = 3; break; }
> case 2: { x = 8; y = 6; z = 4; break; }
> case 3: { x = 4; y = 1; z = 2; break; }
> }
>
> // Epilogue common code here
> }
> // Additional epilogue code here

If you must do this, you can avoid the current issue altogether like
this:

for (int pass = 1; pass > 0; pass++) {
switch (pass) {
case 1: printf("specific code for pass %d\n", pass); break;
case 2: printf("specific code for pass %d\n", pass); break;
case 3: printf("specific code for pass %d\n", pass); break;
case 4: pass = -1; continue;
}
printf("common code for pass %d\n", pass);
}

It's not free from potential problems either (what code is?) but there's
no need to add error cases that don't otherwise naturally arise.

(Depending on the actual code, you might prefer to replace the case 4
with a default case label, and in case it is not clear, I still prefer
to use functions. You get all sort of benefits from adding functions,
not least of which is having more and simpler testable units.)

--
Ben.

David Brown

unread,
Jun 20, 2018, 4:42:54 PM6/20/18
to
On 20/06/18 16:48, Rick C. Hodgin wrote:
> On 6/20/2018 10:12 AM, David Brown wrote:
>> On 20/06/18 14:23, Rick C. Hodgin wrote:
>>> On 6/19/2018 10:37 PM, Joe Pfeiffer wrote:
>>>> That's how you find bugs in your code.  Do it.
>>>
>>> That's the answer.  Thank you.
>>
>> It is /an/ answer - but not /the/ answer.  And it is not a good answer.
>
> I disagree.  To not have that code in there introduces the possibility of
> there being an unexpected error at runtime which causes a crash, and the
> cause of the crash may then be unknown as it may propagate to some other
> point which calls something which crashes there and you don't know the
> true source or root of the issue.

The default clause there makes the code continue on - hiding the problem
far better than a crash would. If the default clause were to print an
error message an exit, you would have a point.

But even if you did that, it is still a bad technique. First, it is
always better to write code that clearly can't go wrong than to write
code that spots when something has gone wrong. Second, it is always bad
to write untestable code.

I have seen this sort of coding in practice. I have seen where the
so-called "safety" code goes wrong and gets triggered unexpectedly, and
then mishandles it - all because that code was never tested or checked.

>
> To have the default: code in there would do very little (mildly pollute
> the instruction cache with typically unused opcodes, but those could be
> minimized by simply having a call instruction in there), and it would
> give root diagnostic information when something goes awry.

Your example does not give any diagnostic information - it hides the
problem. And it is not the waste of instruction cache that bothers me -
it is the untestable code.

There are certainly times when you want to write code that has extra
checks for things that you think should not happen. That is what the
"assert" macro is for. But when you can structure your code so that the
failure cannot occur, prefer that method - and it is easy to do in cases
like this.

>
> I am totally on board with Joe's concept here.  I think it's brilliant.
> It's a correct philosophy in my judgment, and I intend to incorporate it
> at all points in my development in moving forward.
>

I can't teach you to be a better programmer. I can only offer advice in
answer to your question.

> I may even add a compiler switch to CAlive to enable this kind of auto-
> identifying of unspecified code without having to type them in when some-
> thing like my example (without a default:) is given, or a way to at least
> catch all passes that are un-tested, such as:
>
>    if (a == 1) {
>      // code here
>    } else if (a == 5) {
>      // code here
>    }
>
> In this case there's no else {..} block there.  The switch would auto-
> inject an else {..} block in there and have it call a function with
> line information allowing that location to be trapped and observed.

I often write a sequence of tests like this in my code. And I most
certainly do /not/ want a default case if I have not written one myself.

>
> It's all useful information, and it's another tool in the toolbox.
>
> -----
> I know you disagree.  I won't debate you.  It won't affect you anyway
> because it's going to be in CAlive, and you'll never use CAlive ... so
> don't let it bother you.
>

It does not bother me, as such. It is a little frustrating to see
someone latch onto such a bad idea as though it was the best thing since
sliced bread, but it will not keep me awake at night. As you say, I
would not ever use CAlive - it is riddled with with such poorly
considered ideas. But you make it the way you want it to be - take my
advice or leave it.


Rick C. Hodgin

unread,
Jun 20, 2018, 5:05:51 PM6/20/18
to
On Wednesday, June 20, 2018 at 3:59:31 PM UTC-4, Scott Lurndal wrote:
> Yeah, and RCH is bearing false witness vis-a-vis Professor Dawkins.
> If it so easy for RCH to lie about Professor Dawkins, well, that
> says much about RCH.

I have not lied. In an interview with Ben Stein for the movie "No
Intelligence Allowed" he states that nobody knows how life started,
but includes discussion on how intelligent design might have come
about:

https://www.youtube.com/watch?v=BoncJBrrdQ8

In The Blind Watchmaker, he says that what we see has the appearance
of intelligent design, but holds to the idea that it is of random
Darwinian-like processes.

http://transcripts.cnn.com/TRANSCRIPTS/0804/18/sitroom.02.html

"Biology is the study of complicated things that give the
appearance of having been designed for a purpose."
-- Richard Dawkins, The Blind Watchmaker

You put these two together and he has not flatly dismissed intelligent
design, stating that life appears to be created by intelligent design,
but what it does incorporate from Dawkins' is that it could not have
come from God. He states that aliens could've seeded the planet, and
that it's an intriguing possibility to him.

Richard Dawkins' primary driving force, though, in his total denial of
God. He doesn't want to be held accountable to anyone. But, he is now
getting quite old (77 years) and his time is almost up. He will soon
learn the truth about the nature of our existence.

Something that did embarrass Richard Dawkins' in front of people was
this panel discussion. Craig Venter, a renowned DNA sequencing ex-
pert who has sequenced over 60 million genes from ocean sampling,
as well as many other forms, tells the panel that there is no tree
of life, but rather a "bush of life" (meaning sources which seem to
have clearly each originated on their own, as per the intelligent
design model where each one was crafted for itself, and they did
not have a common ancestor):

https://www.youtube.com/watch?v=A0ZLJP9Zc9U

Richard Dawkins goes into damage control mode and does a video with
Craig Venter where he leads the discussion and continuously re-asserts
Darwinian evolution, and to much disappointment, Craig Venter appears
to go along with it as he does not refute it, but just let's Dawkins
speak. This "uncut" version published by the "Richard Dawkins
Foundation for Reason & Science" YouTube channel:

"Craig Venter - The Genius of Charles Darwin: The Uncut
Interviews - Richard Dawkins"
https://www.youtube.com/watch?v=3E25jgPgmzk

Even the title there makes it sound like Craig Venter is on board
with evolution. From the earlier interview before the damage control
mode, he was not. Venter said the tree of life is a holdover from an
early viewpoint that isn't really holding up to modern scientific
scrutiny.

Since then, Craig Venter has gone on to do additional research, but
has (to my knowledge) remained largely quiet about the issue of the
origin of life. I've wondered why that is because it seems to have
been triggered from this panel interview, the subsequent damage control
video, and thereafter.

-----
Modern genetics has revealed such complex patterns in our DNA that
it is no longer possible to hold to evolutionary theories. The reason
is because our DNA is sequenced in multiplexed ways, meaning a single
strand of DNA, that's copied to RNA and processed, can go through more
than a single processing machine. In one machine it may use a section
from here to there, and in another, it may use a different section.
And yet a third it may use another. And to date they've discovered up
to twelve separate uses for a single strand of DNA through twelve sep-
arate machines. To make a single change to that DNA would result in
having to make a change that aligns with all twelve machines simultan-
eously, and that's just not possible.

In addition, we now know the cause of many genetic diseases and some
of our abnormalities. Single bit errors in our entire strand of DNA
can result if fatal or severely debilitating diseases.

The "junk DNA" they used to believe was leftover as a type of evolu-
tionary baggage, has now been found to be 80% expressed in our bodies,
and that's only what they can rigorously prove. The remaining 20% is
believed to also be used, but they cannot prove it yet.

There are scientists who look at the data in DNA and still believe in
Darwinian evolution, but their arguments are very easily dismissed as
non-science when they are scrutinized. When you begin to question how
you get from A to B to C in the few million years that are stated, there
is not one viable model. They have not found any transition fossils.
Thy have found incredible explosions of life which seem to have just
appeared out of nothing. And they do find evidence of Noah's Flood,
and the creation of different kinds of animals in the laboratory today.
Those things can be proven with scientific methods which lend credence
to the Biblical account. There simply is no such evidence for the
evolutionary account. In fact, the belief in evolution is even more
of a matter of faith than creation is because we see point after point
after point which backs up the Biblical account of creation.

Even the root Chinese alphabet contains aspects of the Biblical account:

https://answersingenesis.org/genesis/chinese-characters-and-genesis/

The symbols used for some of the words are comprised of symbols which
talk about Noah and his family on the ark, for example, and

> "Dawkins is a prominent critic of creationism, a religious belief that humanity, life, and
> the universe were created by a deity[130] without recourse to evolution."
>
> "The Blind Watchmaker, contains a sustained critique of the argument from design,"
>
> "Dawkins has opposed the inclusion of intelligent design in science education, describing it as "not a scientific argument at all, but a religious one"

You are being deceived by old information and lies told to you from
back then. There is new information in all areas of genetics research
which absolutely deny the possibility of evolution.

Look at the research. And do not follow mainstream technical journals.
You cannot be mainstream in this world without "towing the party line."
You have to look at the science, and the scientists who come forth and
state things credibly, and not just by mass groups.

And look at "the other side" of the argument. Dr. Georgia Purdom is a
geneticist who has done research and analyzed other people's research:

https://www.youtube.com/watch?v=0ACCIu3jPrc

And look at this movie which demonstrates how DNA actually works (from
2012, the models have been advanced since then and reveal even more
complex operations that literally are mind boggling):

Programming of Life:
http://www.youtube.com/watch?v=00vBqYDBW5s

--
Rick C. Hodgin

David Brown

unread,
Jun 20, 2018, 5:10:13 PM6/20/18
to
On 20/06/18 22:39, Ben Bacarisse wrote:
> "Rick C. Hodgin" <rick.c...@gmail.com> writes:
> <snip>
>> I also agree and disagree with the belief that you shouldn't use a
>> switch-in-a-loop coding style.
>
> I'm not certain (though I've not gone back to check) that that was the
> point being made. The problem is a pattern that needlessly introduces
> the possibility of an error. Enumerating passes is just a very simple
> state machine, and that's often done with a loop and a switch.
>
>> Sometimes it's nice to document everything when there are variables
>> per pass that can be set easily:
>>
>> // Prior prologue code here
>> for (pass = 1; pass <= 3; ++pass)
>> {
>> // Prologue common code
>>
>> switch (pass)
>> {
>> case 1: { x = 1; y = 9; z = 3; break; }
>> case 2: { x = 8; y = 6; z = 4; break; }
>> case 3: { x = 4; y = 1; z = 2; break; }
>> }
>>
>> // Epilogue common code here
>> }
>> // Additional epilogue code here
>
> If you must do this, you can avoid the current issue altogether like
> this:
>
> for (int pass = 1; pass > 0; pass++) {

Here I would use:

for (int pass = 1; true; pass++) {

"pass > 0" is a tautology - it is always true - but it looks like a test.

Rick C. Hodgin

unread,
Jun 20, 2018, 5:17:28 PM6/20/18
to
I think the goal is to not get past the error condition without
crashing, but rather to diagnose it when/if it occurs.

In addition, your logic does not match my logic. In my case, pass
will be 4 when it exits the loop (provided there is no error).

> It's not free from potential problems either (what code is?) but there's
> no need to add error cases that don't otherwise naturally arise.

I disagree. There should never be a case where a non 1..3 value is
encountered, but if there is it should be flagged. In fact, for
this purpose I think I will add an opcode to my CPU that enables a
global catch-all function for this kind of unexpected error, that
does reduce code density and allows it to be setup generically.

> (Depending on the actual code, you might prefer to replace the case 4
> with a default case label, and in case it is not clear, I still prefer
> to use functions. You get all sort of benefits from adding functions,
> not least of which is having more and simpler testable units.)

I appreciate your model. I disagree with it.

--
Rick C. Hodgin

Rick C. Hodgin

unread,
Jun 20, 2018, 5:20:47 PM6/20/18
to
On 6/20/2018 4:42 PM, David Brown wrote:
> On 20/06/18 16:48, Rick C. Hodgin wrote:
>> On 6/20/2018 10:12 AM, David Brown wrote:
>>> On 20/06/18 14:23, Rick C. Hodgin wrote:
>>>> On 6/19/2018 10:37 PM, Joe Pfeiffer wrote:
>>>>> That's how you find bugs in your code.  Do it.
>>>>
>>>> That's the answer.  Thank you.
>>>
>>> It is /an/ answer - but not /the/ answer.  And it is not a good answer.
>>
>> I disagree.  To not have that code in there introduces the possibility of
>> there being an unexpected error at runtime which causes a crash, and the
>> cause of the crash may then be unknown as it may propagate to some other
>> point which calls something which crashes there and you don't know the
>> true source or root of the issue.
>
> The default clause there makes the code continue on - hiding the problem far
> better than a crash would.  If the default clause were to print an error
> message an exit, you would have a point.

That's the idea, David. The default: clause calls some function which
then essentially logs the error condition and prepares to exit the
program because it never should have occurred.

In CAlive, it will enter a state called an "inquiry" where it basically
traps to a debugger-like environment at runtime and allows the user to
interrogate the machine and fix anything or examine or capture anything
that's needed to track down the error. And if you're running it from
inside the CAlive debugger, you can change your code and data and keep
going.

I think the inquiry state will be my greatest contribution to computer
programming for rapidly developing applications. It allows the edit-
and-continue (I called it LiveCode) model to be front-and-center, allowing
applications with errors to still compile and run, and only trap to the
inquiry state when that code is encountered.

> But even if you did that, it is still a bad technique...
> [snip]

Yup. Have a nice day, David.

--
Rick C. Hodgin

Rick C. Hodgin

unread,
Jun 20, 2018, 5:23:17 PM6/20/18
to
On 6/20/2018 5:10 PM, David Brown wrote:
> On 20/06/18 22:39, Ben Bacarisse wrote:
> Here I would use:
>
>     for (int pass = 1; true; pass++) {
>
> "pass > 0" is a tautology - it is always true - but it looks like a test.

It is a test in this case. If pass were ever 4 (which, as Ben pointed
out, it could (should) be changed to default:), it would set the value
to -1 and loop, causing it to then exit.

>>            switch (pass) {
>>            case 1:  printf("specific code for pass %d\n", pass);  break;
>>            case 2:  printf("specific code for pass %d\n", pass);  break;
>>            case 3:  printf("specific code for pass %d\n", pass);  break;
>>            case 4:  pass = -1;  continue;
>>            }
>>            printf("common code for pass %d\n", pass);
>>       }
>>
>> It's not free from potential problems either (what code is?) but there's
>> no need to add error cases that don't otherwise naturally arise.
>>
>> (Depending on the actual code, you might prefer to replace the case 4
>> with a default case label, and in case it is not clear, I still prefer
>> to use functions.  You get all sort of benefits from adding functions,
>> not least of which is having more and simpler testable units.)

I don't see the advantage of using Ben's solution over mine. I think
his suggestion of default: is better, but I don't think issuing a
"continue;" is desirable. I think the condition should trap to some
function which causes a breakpoint where the developer is notified,
or the runtime logs information about itself and politely exits under
the error condition.

--
Rick C. Hodgin

Kenny McCormack

unread,
Jun 20, 2018, 6:22:29 PM6/20/18
to
In article <7f3a4596-ae0a-4f48...@googlegroups.com>,
Rick C. Hodgin <rick.c...@gmail.com> wrote:
>On Wednesday, June 20, 2018 at 3:59:31 PM UTC-4, Scott Lurndal wrote:
>> Yeah, and RCH is bearing false witness vis-a-vis Professor Dawkins.
>> If it so easy for RCH to lie about Professor Dawkins, well, that
>> says much about RCH.
>
>I have not lied. In an interview with Ben Stein for the movie "No

One imagines this alternative universe in which both RCH and DJT don't lie
all the time.

It takes some doing, though.

--
The book "1984" used to be a cautionary tale;
Now it is a "how-to" manual.

Ben Bacarisse

unread,
Jun 20, 2018, 8:11:55 PM6/20/18
to
What error condition you are talking about?

> In addition, your logic does not match my logic. In my case, pass
> will be 4 when it exits the loop (provided there is no error).

That was deliberate. In fact pass is not even in scope outside the
loop.

>> It's not free from potential problems either (what code is?) but there's
>> no need to add error cases that don't otherwise naturally arise.
>
> I disagree. There should never be a case where a non 1..3 value is
> encountered, but if there is it should be flagged.

Why? Do you write this:

for (int i = 0; i < 10; i++)
if (i < 0 || i >= 10) {
// Help! help! something's wrong!
}

in every loop just to be sure? What sort of peculiar behaviour are you
trying to guard against?

>> (Depending on the actual code, you might prefer to replace the case 4
>> with a default case label, and in case it is not clear, I still prefer
>> to use functions. You get all sort of benefits from adding functions,
>> not least of which is having more and simpler testable units.)
>
> I appreciate your model. I disagree with it.

You disagree with using functions here? Or you disagree with this code
and you prefer to duplicate the number of passes as you do in your
example? Maybe both?

--
Ben.

Rick C. Hodgin

unread,
Jun 20, 2018, 8:55:38 PM6/20/18
to
The error condition of pass not being 1..3. In the case it's some-
thing else that's unexpected. The program should capture that infor-
mation in some special way and report on it.

>> In addition, your logic does not match my logic. In my case, pass
>> will be 4 when it exits the loop (provided there is no error).
>
> That was deliberate. In fact pass is not even in scope outside the
> loop.

In mine it is / was.

>>> It's not free from potential problems either (what code is?) but there's
>>> no need to add error cases that don't otherwise naturally arise.
>>
>> I disagree. There should never be a case where a non 1..3 value is
>> encountered, but if there is it should be flagged.
>
> Why? Do you write this:
>
> for (int i = 0; i < 10; i++)
> if (i < 0 || i >= 10) {
> // Help! help! something's wrong!
> }
>
> in every loop just to be sure? What sort of peculiar behaviour are you
> trying to guard against?

The concern is over cases where an "else condition" is not handled.
In the case of the for loop above, it is set at 0, and it tests
itself every iteration. It will leave the loop if it's >= 10.
There's no reason to test in the middle, unless the code is acting
differently on different values of i, and not just something trivial
like "k=5*i;".

>>> (Depending on the actual code, you might prefer to replace the case 4
>>> with a default case label, and in case it is not clear, I still prefer
>>> to use functions. You get all sort of benefits from adding functions,
>>> not least of which is having more and simpler testable units.)
>>
>> I appreciate your model. I disagree with it.
>
> You disagree with using functions here? Or you disagree with this code
> and you prefer to duplicate the number of passes as you do in your
> example? Maybe both?

I disagree with using functions in some cases of the switch-in-loop,
because the documentation component is more important to me, as was
indicated previously. There are other cases where the pre-for-loop
prologue and post-for-loop epilogue code are needed as well, and
these contain things updated by the local code.

If I use a function to update those values I'm either passing a lot
of parameters or parameter pointers, or I'm creating a custom context
for the operation ... and both of those solutions are more clumsy to
me than using a switch-in-loop.

CAlive allows for special context objects, which are like an ad hoc
struct created on-the-fly with only local scope, inherited by the
functions that are called directly. The contexts allow local variable
use within the context directly, and then the entire context is passed
by a single pointer, slowing down remote access, but not significantly,
as the compiler can sometimes resolve the direct address relative to
the base/stack pointer.

I think you are a brilliant developer, Ben, and very knowledgeable in
C and general development. Please do not consider my replies to you
as disparaging. I simply place higher value on other things, so my
choices are sometimes (often??) different than yours.

--
Rick C. Hodgin

Chris M. Thomasson

unread,
Jun 21, 2018, 1:26:52 AM6/21/18
to
On 6/19/2018 10:15 PM, Christian Gollwitzer wrote:
> Am 20.06.18 um 03:48 schrieb Chris M. Thomasson:
>> On 6/19/2018 9:42 AM, Rick C. Hodgin wrote:
>>> On 6/19/2018 12:38 PM, Lew Pitcher wrote:
>>>  > Gaak! ... are you doing?
>>>
>>> If you have any desire to communicate with me, and I with you, then
>>> remove profanity from your posts.
>>>
>>> I'm fine with your decision either way, Lew.
>>>
>>
>> How exactly do the letters Gaak! = profanity?
>
> It's not the Gaak, it's the "WTF" that he has omitted from the quote
> (indicated by an ellipsis). Still doesn't make sense to me to plonk
> anyone because of this.
>
> Strangely, he has responded to Flibble's posts afterwards, so it seems
> he hasn't fulfilled has promise to plonk everybody who posts WTF.
>
> WTF WTF WTF! Holy smoke! ;)

Oh, sorry for missing that. Gosh darn it! Fwiw, I can see him getting
mad at some Q-Bert ciphers as well:

https://youtu.be/0yrhee8W7II

Just try to be very polite, and all should be well?

David Brown

unread,
Jun 21, 2018, 3:56:17 AM6/21/18
to
On 20/06/18 23:05, Rick C. Hodgin wrote:
> On Wednesday, June 20, 2018 at 3:59:31 PM UTC-4, Scott Lurndal
> wrote:
>> Yeah, and RCH is bearing false witness vis-a-vis Professor
>> Dawkins. If it so easy for RCH to lie about Professor Dawkins,
>> well, that says much about RCH.
>
> I have not lied.

(Note - this is a discussion, not an attack. I'd be happy to see a
considered response to the points I make. I would not be happy to be
palmed off with a generic "you are inspired by the devil" or "I teach
the truth" response. I would not be surprised by such a response, but
it would make a mockery of your beliefs.)

Lying implies that you have intentionally and knowingly distorted the
facts. You know very little about the facts of biology and evolution -
that much is apparent in your writings. You /think/ you do, but you get
your information from sources that are either mistaken, or lying.

You are a victim of confirmation bias on a massive scale. Having
decided on a particular viewpoint, you read or watch information that
matches that viewpoint and take it to be evidence in its favour - and
you take everything else as evidence of a conspiracy theory against it.
It is a vicious cycle, and hard to break - it is like an addiction.

Does that mean you are lying? I don't think so - that would imply
different motives. Is it "false witness vis-a-vis Professor Dawkins"?
Yes, it most certainly is - you are attributing opinions, attitudes and
doubts to him that are totally at odds to the man and what he writes and
says.


I have nothing against your believing that the universe and life was
made "as is" some 6000 years ago by a creator god. That's fine -
religious freedom is a human right. (Freedom from religion is also a
human right - one that many in this newsgroup would like respected. But
it's too late for that now in this thread!)

What I disagree with is distorting science and evidence. If you want to
say that biology and evolution show the greatness of your god, with
amazing forward planning skills, then that's fine. If you want to say
that they show the work of the devil, that's okay too. If you want to
say they exist so that we need to find god on faith, not evidence, then
that is another consistent viewpoint.

What is /not/ okay is to say the scientific evidence is against
evolution, or that there is scientific evidence for a biblical
viewpoint. That is not okay, because it is simply /wrong/ - it would be
like saying gravity sometimes makes bricks fall upwards. It is okay to
say we don't know everything about evolution, or how it works, and it is
certainly okay to say that we have only some ideas of how everything
started. But that does not mean you can fill in the gaps with ideas
from thin air and say the evidence supports them!

And what is even less okay is to make claims about what scientists in
general, and particular scientists, say or believe. The overwhelming
majority of scientists consider the theory of evolution to be of a
similar level to the theory of gravity, and the overwhelming majority of
them do not believe there is any /evidence/ for "intelligent design" any
more than there is evidence for "intelligent falling". That /includes/
those who believe in a creator god.

Be very clear here - Dawkins does not believe in intelligent design (by
divine beings) or any sort of god. He does not believe there is any
evidence for such things. Of course he believes that there could be
alien design in the process (after all, the earth is unlikely to be the
sole example of intelligence in the universe), but that we have found no
evidence to suggest it. Distorting his words and taking things out of
context does not change what he believes and says.


> In an interview with Ben Stein for the movie "No
> Intelligence Allowed" he states that nobody knows how life started,
> but includes discussion on how intelligent design might have come
> about:
>
> https://www.youtube.com/watch?v=BoncJBrrdQ8

Ben Stein is a lawyer and comedian, and is as qualified to talk about
biological science as you and I are to talk about law and comedy. And
he is a man with a very specific agenda of trying to force his point
about intelligent design - he, and the film, are massively biased. I
haven't seen the film myself (I have far better things to do with my
time), but here are a couple of newspaper review quotations:

"a conspiracy-theory rant masquerading as investigative inquiry"
"an unprincipled propaganda piece that insults believers and
nonbelievers alike."
"Full of patronizing, poorly structured arguments, Expelled is a
cynical political stunt in the guise of a documentary."


>
> In The Blind Watchmaker, he says that what we see has the appearance
> of intelligent design, but holds to the idea that it is of random
> Darwinian-like processes.

Yes, exactly. Re-read what you wrote. Evolution is a natural process
with random variations and feedback, resulting in things that are so
complex they /appear/ to have been designed. But they were /not/
designed - they merely /appear/ to be. It is an emergent system.

Have you ever seen one of these "sand picture" frames, where you have a
mixture of different types of sand, coloured water, and some air
bubbles? You turn it over and it slowly produces a picture that looks
like a lovely landscape. That is another fine example of an emergent
system. The pictures produced /look/ like they were designed, or drawn
by people, or inspired by real landscape, but they are the result of
random processes and feedback.


>
> http://transcripts.cnn.com/TRANSCRIPTS/0804/18/sitroom.02.html
>
> "Biology is the study of complicated things that give the appearance
> of having been designed for a purpose." -- Richard Dawkins, The Blind
> Watchmaker
>
> You put these two together and he has not flatly dismissed
> intelligent design, stating that life appears to be created by
> intelligent design, but what it does incorporate from Dawkins' is
> that it could not have come from God.

If you read what he said - what you quoted - you can see that he /has/
dismissed intelligent design. He says biology gives the /appearance/ of
design - i.e., it was /not/ designed, it just looks that way.

> He states that aliens could've
> seeded the planet, and that it's an intriguing possibility to him.
>

That is an idea with no evidence either for or against - but it is
certainly possible that evidence could be found. One day I hope mankind
will discover life on other planets (or moons), and it will be
fascinating to see how it compares to our own biology.

> Richard Dawkins' primary driving force, though, in his total denial
> of God. He doesn't want to be held accountable to anyone. But, he
> is now getting quite old (77 years) and his time is almost up. He
> will soon learn the truth about the nature of our existence.
>

His primary driving force is to find out the truth, and spread that
information. You might disagree with the answers he gets, but don't
misunderstand his motivations. Like most people, he believes people
should be free to /choose/ their religious beliefs - but not be forced
into them, or to force other people. And he believes that since
religion and science work in completely different ways to attempt to
answer very different kinds of question, they should not be mixed up.


> Something that did embarrass Richard Dawkins' in front of people was
> this panel discussion. Craig Venter, a renowned DNA sequencing ex-
> pert who has sequenced over 60 million genes from ocean sampling, as
> well as many other forms, tells the panel that there is no tree of
> life, but rather a "bush of life" (meaning sources which seem to have
> clearly each originated on their own, as per the intelligent design
> model where each one was crafted for itself, and they did not have a
> common ancestor):

I haven't seen the video, and won't be watching it - I know you like
youtube as a source of information, but I prefer text.

>
> https://www.youtube.com/watch?v=A0ZLJP9Zc9U
>
> Richard Dawkins goes into damage control mode and does a video with
> Craig Venter where he leads the discussion and continuously
> re-asserts Darwinian evolution, and to much disappointment, Craig
> Venter appears to go along with it as he does not refute it, but just
> let's Dawkins speak. This "uncut" version published by the "Richard
> Dawkins Foundation for Reason & Science" YouTube channel:

To my knowledge, Craig Venter is a geneticist and scientist. Of course
he goes along with Darwinian evolution. The "bush of life" idea is not
an alternative to Darwinian evolution, it is simply part of the more
accurate and refined models that we have learned over time. In Darwin's
work and the early days of DNA science, the "tree of life" was thought
to be exactly that - a tree, with neat branches. Over time, we have
collected more evidence, done more experiments, formed new theories, and
we see the details are a lot more complex. Some genetic material passes
across species, not just parent to child (bacteria are experts at this,
but it happens across diverse types of species). Species intermix and
interbreed. It is more like a "web of life" - or at least, the "tree"
gets a bit fuzzy when you look closely and has paths crossing between
branches.

What you say about the "bush of life" sounds like examples of parallel
evolution, which can be fascinating.

But /none/ of this is evidence against evolution - all of it is evidence
/for/ evolution. It is also evidence that we don't know all about
biology or life on earth as yet, but that is hardly news to scientists.

>
> "Craig Venter - The Genius of Charles Darwin: The Uncut Interviews -
> Richard Dawkins" https://www.youtube.com/watch?v=3E25jgPgmzk
>
> Even the title there makes it sound like Craig Venter is on board
> with evolution. From the earlier interview before the damage
> control mode, he was not. Venter said the tree of life is a holdover
> from an early viewpoint that isn't really holding up to modern
> scientific scrutiny.
>

Think of it like Newton's theory of gravity replacing Galileo's
theories, or Einstein's theory of relativity replaying Newton's
theories. It is a refinement of the theories, with better models. It
does not mean the "tree of life" is wrong, merely that it is an
approximate model and we now have better ones. And Venter's theories
are about evolution - they are not /against/ it.

You seem to imagine Dawkins and Venter are on opposite sides of some
battle - they are colleagues, working in different niches of the same
field, and with a little scientific rivalry going on. I am sure it was
fun for one of them to embarrass the other with newer information.

Like Dawkins, Venter is an atheist and has no belief in any god or
"intelligent design".


> Since then, Craig Venter has gone on to do additional research, but
> has (to my knowledge) remained largely quiet about the issue of the
> origin of life. I've wondered why that is because it seems to have
> been triggered from this panel interview, the subsequent damage
> control video, and thereafter.

He is currently working on synthetic genomics - tailoring bacteria to
specific tasks. His interest appears to be more in genetics and
lifeforms /now/ rather than in evolution as such. (And biogenesis - the
origin of life - is a different field.)


>
> ----- Modern genetics has revealed such complex patterns in our DNA
> that it is no longer possible to hold to evolutionary theories. The
> reason is because our DNA is sequenced in multiplexed ways, meaning a
> single strand of DNA, that's copied to RNA and processed, can go
> through more than a single processing machine. In one machine it may
> use a section from here to there, and in another, it may use a
> different section. And yet a third it may use another. And to date
> they've discovered up to twelve separate uses for a single strand of
> DNA through twelve sep- arate machines. To make a single change to
> that DNA would result in having to make a change that aligns with all
> twelve machines simultan- eously, and that's just not possible.
>

It is not at all clear if you are making a quotation here, and if so I
can't see the source or where the quotation ends.

Some bits of DNA are used in several different ways. Most is not.
There may be 12 different mechanisms that use DNA - that does not mean
that any particular piece of DNA is used in 12 ways. We know that some
parts of DNA are particularly critical to life, and even small changes
render the organism non-viable. We also know there are parts where
there can be many changes without having serious effects. And we know
there are parts that could have certain changes but the risk is high of
causing failure - perhaps other changes are needed at the same time.
All in all, it is a game of chance - and big changes to important parts
of the DNA happen only rarely. But they do happen.

> In addition, we now know the cause of many genetic diseases and some
> of our abnormalities. Single bit errors in our entire strand of DNA
> can result if fatal or severely debilitating diseases.
>

Yes. As I said, some bits are critical. Other bits are not.
Differences in hair colour involve a lot more than one bit change - but
are hardly debilitating.

> The "junk DNA" they used to believe was leftover as a type of evolu-
> tionary baggage, has now been found to be 80% expressed in our
> bodies, and that's only what they can rigorously prove. The
> remaining 20% is believed to also be used, but they cannot prove it
> yet.

Lots of DNA is left over from the past. Some of it is still used,
especially in embryo development (that's why humans go through stages of
having gills and a tail). Some of it is not, but can be re-activated
artificially (such as triggering old DNA in a chicken embryo so that it
grows a dinosaur mouth and teeth).

In the early days, it was thought that the only important part of DNA
was the bits that coded for proteins. The rest, around 80% in humans
(the value differs greatly for different species), was unhelpfully
called "junk". The preferred term now is "non-coding DNA". And at
least some of it has other known uses, such as controlling the
activation of different coding parts.

I would expect that most of our DNA is useful at some point or in some
circumstances, while a small proportion is leftovers from the past.
This is normal in biology. Small leftovers, mistakes, or inefficiencies
hang around because there is not enough evolutionary pressure to make a
change in the general population. Big wastage (as it would be if 80% of
the DNA was actually junk) get tidied up eventually, by evolution.

This is just normal science - it progresses as we learn more. There is
no crisis going on here, no revolution.

>
> There are scientists who look at the data in DNA and still believe
> in Darwinian evolution, but their arguments are very easily dismissed
> as non-science when they are scrutinized. When you begin to question
> how you get from A to B to C in the few million years that are
> stated, there is not one viable model. They have not found any
> transition fossils.

Transition fossils have been found for a great many cases. You do your
case no help by making up easily exposed nonsense.

<https://en.wikipedia.org/wiki/List_of_transitional_fossils>

The nature of evolution and development of species is to have long
periods of relative stability, punctuated by short periods of speedy
change due to environmental disruption. Transitional species are mostly
short-lived in geological and evolutionary terms - they leave behind
fewer fossils than long-lived species. The fact that transitional
fossils are found, but only rarely, is evidence for Darwinian evolution.

> Thy have found incredible explosions of life
> which seem to have just appeared out of nothing. And they do find
> evidence of Noah's Flood,

There is /no/ evidence of a flood anything remotely resembling the
description in the Bible - and /massive/ evidence that it could not
possibly have happened. There is plenty of evidence for big floods,
some of which could have been very dramatic and re-arranged cultures and
social balances in their areas - certainly enough to inspire legends
like the flood story in the Epic of Gilgamesh, and later copies in the
Torah.

> and the creation of different kinds of
> animals in the laboratory today. Those things can be proven with
> scientific methods which lend credence to the Biblical account.

We can mess around with genetics, cross-breeding, etc. Humans have done
so for 15,000 years at least, though we are far more efficient now.
That gives absolutely no credence to the bible.

> There simply is no such evidence for the evolutionary account. In
> fact, the belief in evolution is even more of a matter of faith than
> creation is because we see point after point after point which backs
> up the Biblical account of creation.

Evidence for evolution is so overwhelming and persuasive that there is
no doubt about it. It is not a belief, any more than gravity is a belief.

>
> Even the root Chinese alphabet contains aspects of the Biblical
> account:
>
> https://answersingenesis.org/genesis/chinese-characters-and-genesis/
>

Surely you are joking? I had a look at that page - it is absolutely
ludicrous, even by the standards for that website (which are /not/ high).

> The symbols used for some of the words are comprised of symbols
> which talk about Noah and his family on the ark, for example, and
>

It says that one possible etymological derivation of the Chinese symbol
for "boat" is "vessel eight people". And you take that as evidence for
Noah and his ark? Really?

David Brown

unread,
Jun 21, 2018, 4:21:44 AM6/21/18
to
On 20/06/18 23:23, Rick C. Hodgin wrote:
> On 6/20/2018 5:10 PM, David Brown wrote:
>> On 20/06/18 22:39, Ben Bacarisse wrote:
>> Here I would use:
>>
>> for (int pass = 1; true; pass++) {
>>
>> "pass > 0" is a tautology - it is always true - but it looks like a test.
>
> It is a test in this case. If pass were ever 4 (which, as Ben pointed
> out, it could (should) be changed to default:), it would set the value
> to -1 and loop, causing it to then exit.

You are right, I missed that bit. To be honest, it seems a really
strange way to write the code - not much better than your own
structuring. I just can't see any point in allowing pass to be an
invalid value, and therefore no point in checking for it.

Perhaps this would help:

for (int _pass = 1; _pass <= 3; _pass++) {
const int pass = _pass;

switch (pass) {
case 1: printf("specific code for pass %d\n", pass); break;
case 2: printf("specific code for pass %d\n", pass); break;
case 3: printf("specific code for pass %d\n", pass); break;
}
printf("common code for pass %d\n", pass);
}

Then the compiler will not let you change "pass" without complaint, and
you are not going to change "_pass" accidentally.

(If you want a feature for CAlive that I would like, make it illegal to
change the "_pass" variable inside the for loop here. In other words,
variables declared in a for clause should be considered "const" within
the scope of the loop.)


Alf P. Steinbach

unread,
Jun 21, 2018, 4:43:57 AM6/21/18
to
On 21.06.2018 09:56, David Brown wrote:
>
> [snip]
> What is /not/ okay is to say the scientific evidence is against
> evolution, or that there is scientific evidence for a biblical
> viewpoint. That is not okay, because it is simply /wrong/ - it would be
> like saying gravity sometimes makes bricks fall upwards. It is okay to
> say we don't know everything about evolution, or how it works, and it is
> certainly okay to say that we have only some ideas of how everything
> started. But that does not mean you can fill in the gaps with ideas
> from thin air and say the evidence supports them!
>
> And what is even less okay is to make claims about what scientists in
> general, and particular scientists, say or believe. The overwhelming
> majority of scientists consider the theory of evolution to be of a
> similar level to the theory of gravity, and the overwhelming majority of
> them do not believe there is any /evidence/ for "intelligent design" any
> more than there is evidence for "intelligent falling". That /includes/
> those who believe in a creator god.

Well, at the risk of maybe giving the Christian readers the wrong
impression, there is extremely convincing evidence of intelligent design
at a very high level, namely of the cosmos. The probability of the
various forces of nature being of the exact relative strengths to
support star creation (in particular the fusion process), is 1 over a
number with over a hundred zeroes. Just extremely unlikely. Ditto for
the energy density of vacuum. It's off by a similar super-extreme
factor, some hundred+ zeroes, compared to what theory says it should be.

Some Nobel prize winning physicists favor the Anthropic Principle as
explanation, the explains-nothing notion that if the strengths of the
forces were any different, or if the local energy density of vacuum was
much higher than it actually is, we just wouldn't be here to ponder the
question. At least one Nobel prize winner instead favors the US
Christian's silly intelligent design of humans and Earth idea, proving
that also Nobel prize winners can be utter idiots. But as I see it the
evidence really points to intelligent design of the cosmos, its physics.

So whose design is it then? I believe it's ours. It's that simple: when
theory is at odds with reality, where the factors involved have hundreds
of digits, then one can conclude with /certainty/ that theory is wrong.

So, given that cosmology and/or physics has been proved wrong, and
that's what the evidence says, complete 100% certain proof, where should
one look for the incorrect assumption or assumptions?

My very personal speculation is that creation never ended. That we live
in a universe with creation still going on, just about everywhere,
opposing destruction, that also is going on, just about everywhere. That
may sound far fetched, e.g. we don't see much possible creation except
in galaxy centers and quasars and such, not anything locally!, but at
least it removes the self-contradiction of the BB hypothesis.


Cheers!,

- Alf (very off-topic mode)

Ben Bacarisse

unread,
Jun 21, 2018, 6:36:58 AM6/21/18
to
David Brown <david...@hesbynett.no> writes:

> On 20/06/18 23:23, Rick C. Hodgin wrote:
>> On 6/20/2018 5:10 PM, David Brown wrote:
>>> On 20/06/18 22:39, Ben Bacarisse wrote:
>>> Here I would use:
>>>
>>> for (int pass = 1; true; pass++) {
>>>
>>> "pass > 0" is a tautology - it is always true - but it looks like a test.
>>
>> It is a test in this case. If pass were ever 4 (which, as Ben pointed
>> out, it could (should) be changed to default:), it would set the value
>> to -1 and loop, causing it to then exit.
>
> You are right, I missed that bit. To be honest, it seems a really
> strange way to write the code - not much better than your own
> structuring. I just can't see any point in allowing pass to be an
> invalid value, and therefore no point in checking for it.

My intention was simply to avoid the duplication in the number of passes
so that what I thought was the original issue -- that the loop bound and
the number of passes could get out of sync during development -- could
not arise.

A C for loop almost always finishes when the control variable becomes
invalid. Zero is no more invalid than 4 is in the original. Yes, the
loop is terminated by an explicit assignment, and I agree that that is
not very pretty.

And I agree that it's not much better. I was trying to remove only one
wrinkle. Hence the prefix "if you must do this"!

> Perhaps this would help:
>
> for (int _pass = 1; _pass <= 3; _pass++) {
> const int pass = _pass;

If assignments to pass are the real problem, only using functions can
really help. You get a very short loop, maybe only

for (int pass = 1; pass <= 3; pass++) {
code_for_pass[pass]();
common_conde();
}

so it's easy to check the pass is not assigned.

<snip>
--
Ben.

David Brown

unread,
Jun 21, 2018, 6:39:19 AM6/21/18
to
On 21/06/18 10:43, Alf P. Steinbach wrote:
> On 21.06.2018 09:56, David Brown wrote:
>>
>> [snip]
>> What is /not/ okay is to say the scientific evidence is against
>> evolution, or that there is scientific evidence for a biblical
>> viewpoint. That is not okay, because it is simply /wrong/ - it would be
>> like saying gravity sometimes makes bricks fall upwards. It is okay to
>> say we don't know everything about evolution, or how it works, and it is
>> certainly okay to say that we have only some ideas of how everything
>> started. But that does not mean you can fill in the gaps with ideas
>> from thin air and say the evidence supports them!
>>
>> And what is even less okay is to make claims about what scientists in
>> general, and particular scientists, say or believe. The overwhelming
>> majority of scientists consider the theory of evolution to be of a
>> similar level to the theory of gravity, and the overwhelming majority of
>> them do not believe there is any /evidence/ for "intelligent design" any
>> more than there is evidence for "intelligent falling". That /includes/
>> those who believe in a creator god.
>
> Well, at the risk of maybe giving the Christian readers the wrong
> impression, there is extremely convincing evidence of intelligent design
> at a very high level, namely of the cosmos. The probability of the
> various forces of nature being of the exact relative strengths to
> support star creation (in particular the fusion process), is 1 over a
> number with over a hundred zeroes. Just extremely unlikely.

No, that is not evidence for intelligent design - not remotely so. It
is evidence that our theories about how the cosmos is put together are
incomplete. Perhaps there are factors which force particular matches of
the various cosmological constants involved - that they are not
independent. This is a reasonable supposition, and would follow the
patterns we have already seen in modern (say, the last 100 years)
science where connections between different constants have been found.

> Ditto for
> the energy density of vacuum. It's off by a similar super-extreme
> factor, some hundred+ zeroes, compared to what theory says it should be.

No. There are two different theories as to what the vacuum energy
should be, looking at it from different viewpoints. The values
predicted by these two theories differ by over a 100 orders of
magnitude. Either one of these theories is correct (in the sense of
being a good approximation to reality), or neither of them is - they
can't both be. Again, this is evidence that science does not yet have
all the answers and a full picture (no news there) - it is not evidence
for any kind of designer or intelligence being involved.

>
> Some Nobel prize winning physicists favor the Anthropic Principle as
> explanation, the explains-nothing notion that if the strengths of the
> forces were any different, or if the local energy density of vacuum was
> much higher than it actually is, we just wouldn't be here to ponder the
> question.

Yes, that's the Anthropomorphic Principle - the universe is "human
friendly" because if it were not, we would not be here to observe it. A
variation is to suggest that there are vast numbers of alternate
universes with all sorts of different variations, and we are in one of
them. As you say, it is an "explains nothing" notion.

Perhaps we will never find any better explanation. But that does not
mean we should stop looking, and it certainly does not mean we should
make one up.

> At least one Nobel prize winner instead favors the US
> Christian's silly intelligent design of humans and Earth idea, proving
> that also Nobel prize winners can be utter idiots. But as I see it the
> evidence really points to intelligent design of the cosmos, its physics.
>

Certainly there is (currently) no evidence to point /against/ an
intelligent designer who concocted the big bang as a high-school science
project. But there is no evidence for it, either.

There is massive evidence against intelligent design for humans and life
on earth in general - both in terms of direct evidence of natural
development of life, and in terms of the mistakes in our "design". What
sort of so-called "intelligent" designer could come up with something as
impressive as the brain, yet get the eyeballs backwards? Or design male
humans with a brain capable of rational thinking and a fine set of
reproductive organs - but not enough blood to use them both at the same
time?

> So whose design is it then? I believe it's ours. It's that simple: when
> theory is at odds with reality, where the factors involved have hundreds
> of digits, then one can conclude with /certainty/ that theory is wrong.
>

Sorry, you have confused me a little. I agree that some parts of our
theories of the cosmos are badly wrong (we know this already), but the
universe is not /our/ design. Our model of the universe, or our
theories of it, are our design, if that's what you meant.

> So, given that cosmology and/or physics has been proved wrong, and
> that's what the evidence says, complete 100% certain proof, where should
> one look for the incorrect assumption or assumptions?

More research, experiments, thoughts and theories :-)

>
> My very personal speculation is that creation never ended. That we live
> in a universe with creation still going on, just about everywhere,
> opposing destruction, that also is going on, just about everywhere. That
> may sound far fetched, e.g. we don't see much possible creation except
> in galaxy centers and quasars and such, not anything locally!, but at
> least it removes the self-contradiction of the BB hypothesis.
>

That is pretty much as good as any other hypothesis at the moment.
There is a good deal about cosmology that is still very speculative.


David Brown

unread,
Jun 21, 2018, 6:43:05 AM6/21/18
to
Agreed - separate functions would probably be a nicer way to handle
this. Even copy-and-paste might be better, depending on the size of the
"code for pass" and "common code" sections:

// code for pass 1
// common code
// code for pass 2
// common code
// code for pass 3
// common code

No switches, loops or function calls needed. You wouldn't want to do
this for common code more than a few lines, of course.


Rick C. Hodgin

unread,
Jun 21, 2018, 8:03:23 AM6/21/18
to
On 6/21/2018 4:21 AM, David Brown wrote:
> Perhaps this would help:
>
> for (int _pass = 1; _pass <= 3; _pass++) {
> const int pass = _pass;
>
> switch (pass) {
> case 1: printf("specific code for pass %d\n", pass); break;
> case 2: printf("specific code for pass %d\n", pass); break;
> case 3: printf("specific code for pass %d\n", pass); break;
> }
> printf("common code for pass %d\n", pass);
> }
>
> Then the compiler will not let you change "pass" without complaint, and
> you are not going to change "_pass" accidentally.

I think the issue isn't our code affecting pass, as it will not. But
it would be an overwrite of data on the stack or something else going
haywire due to unexpected things.

As you know perfectly well and could teach a class on, a const value
can still be updated externally by something that doesn't honor its
const state (provided it's in read/write memory).

> (If you want a feature for CAlive that I would like, make it illegal to
> change the "_pass" variable inside the for loop here. In other words,
> variables declared in a for clause should be considered "const" within
> the scope of the loop.)

That's an excellent idea. I will implement it. This is the second
idea you've suggested that I've implemented. The first was namespaces.

--
Rick C. Hodgin

Rick C. Hodgin

unread,
Jun 21, 2018, 8:07:18 AM6/21/18
to
On 6/21/2018 6:17 AM, Ben Bacarisse wrote:
> If assignments to pass are the real problem, only using functions can
> really help. You get a very short loop, maybe only
>
> for (int pass = 1; pass <= 3; pass++) {
> code_for_pass[pass]();
> common_conde();
> }
>
> so it's easy to check the pass is not assigned.

CAlive has several features which allow something like this. One is
the flow {..} blocks, which let you organize code outside of a top-
down orientation. You can move code into a block and call it by name,
allowing for the type of code that people initially suggested.

The other is an ad hoc, allowing for essentially a local function to
be created which can be called which also assumes the full local state
of the environment visible to that which called it. In that way, the
code can be organized and documented as being related to the process
directly, and be called as the original responders indicated.

And there are a few other solutions. I actually spent time last
evening considering a way to do what you suggest here, to create
code accessibly by array and run it. I'm going to continue to give
that line of thinking some attention and see what I can come up with.

--
Rick C. Hodgin

Rick C. Hodgin

unread,
Jun 21, 2018, 8:16:04 AM6/21/18
to
On 6/21/2018 8:07 AM, Rick C. Hodgin wrote:
> On 6/21/2018 6:17 AM, Ben Bacarisse wrote:
>>    for (int pass = 1; pass <= 3; pass++) {
>>       code_for_pass[pass]();
>>       common_conde();
>>    }
>
> ... I actually spent time last
> evening considering a way to do what you suggest here, to create
> code accessibly by array and run it.  I'm going to continue to give
> that line of thinking some attention and see what I can come up with.

I think a code array would work:

array name
| // common parameters here
| // common return parameters here
{
// Code for element 0 here

} next {
// Code for element 1 here

} next {
// Code for element 2 here

} next {
// Code for element 3 here

} next {
// Code for element 4 here
}

// At this point countof(name) would indicate the max indices,
// and sizeof(name) would allow the code as compiled to be known,
// and even passed around as an array*.

The only issue is you won't know the number, which you may not need to
know. When you need to know the number, maybe:

array name
| // common parameters here
| // common return parameters here
code 0 {
// Code for element 0 here
} code 1 {
// Code for element 1 here
} code 2 {
// Code for element 2 here
} code 3 {
// Code for element 3 here
} code 5 {
// Code for element 5 here
}

// In this one we skip 4, which essentially creates an empty
// function. And each block is explicitly identified. In
// addition to using numbers, a named token could be given,
// allowing them to be called things like setup, pass1, pass2,
// pass3, finalize, etc.

I like it.

--
Rick C. Hodgin

Alf P. Steinbach

unread,
Jun 21, 2018, 8:30:19 AM6/21/18
to
A factor with over a hundred digits for improbability of coincidence, or
mismatch of theory with reality, as as strong evidence as you get.

You can't get it stronger.


> It
> is evidence that our theories about how the cosmos is put together are
> incomplete. Perhaps there are factors which force particular matches of
> the various cosmological constants involved - that they are not
> independent. This is a reasonable supposition, and would follow the
> patterns we have already seen in modern (say, the last 100 years)
> science where connections between different constants have been found.
>
>> Ditto for
>> the energy density of vacuum. It's off by a similar super-extreme
>> factor, some hundred+ zeroes, compared to what theory says it should be.
>
> No. There are two different theories as to what the vacuum energy
> should be, looking at it from different viewpoints.

Not as far as I know. There is reality, estimated from upper limit of
the cosmological constant. Not that I know the details of that estimate,
but according to Wikipedia's article it puts the energy at 10^-9 joules
per m^3. Theory, the standard model of physics (QED) plus the Planck
constant, according to the same article, predicts 10^113 joules per m^3.
That's 122 orders of magnitude difference between reality and theory.


> The values
> predicted by these two theories differ by over a 100 orders of
> magnitude. Either one of these theories is correct (in the sense of
> being a good approximation to reality), or neither of them is - they
> can't both be.

You can be certain that reality is correct, that our estimate of it is
nearly correct (we have measures of various effects to compare it to),
and that it's the theory that's wrong by some 120+ order of magnitude.


> Again, this is evidence that science does not yet have
> all the answers and a full picture (no news there) - it is not evidence
> for any kind of designer or intelligence being involved.

You need intelligence to make that large an error.


>> Some Nobel prize winning physicists favor the Anthropic Principle as
>> explanation, the explains-nothing notion that if the strengths of the
>> forces were any different, or if the local energy density of vacuum was
>> much higher than it actually is, we just wouldn't be here to ponder the
>> question.
>
> Yes, that's the Anthropomorphic Principle - the universe is "human
> friendly" because if it were not, we would not be here to observe it. A
> variation is to suggest that there are vast numbers of alternate
> universes with all sorts of different variations, and we are in one of
> them. As you say, it is an "explains nothing" notion.
>
> Perhaps we will never find any better explanation. But that does not
> mean we should stop looking, and it certainly does not mean we should
> make one up.

There I completely agree.


>> At least one Nobel prize winner instead favors the US
>> Christian's silly intelligent design of humans and Earth idea, proving
>> that also Nobel prize winners can be utter idiots. But as I see it the
>> evidence really points to intelligent design of the cosmos, its physics.
>
> Certainly there is (currently) no evidence to point /against/ an
> intelligent designer who concocted the big bang as a high-school science
> project. But there is no evidence for it, either.

I get tired of the arguments of "no evidence against" the FSM, say. For
any given such hypothesis one can construct an opposite hypothesis, with
the same zero weight of evidence. They cancel and there's nothing.

For example, under the hypothesis that if I don't go to Oslo tomorrow I
will die from an old badly maintained F-16 fighter plane crashing in my
head, I /could/ do a cost-benefit analysis. Case 1, hypothesis is true.
Cost of going to Oslo on short notice, 4-5000 NKr. Cost of dying,
infinite. Case 2, hypothesis is false. No cost by staying home, same
cost of going to Oslo. Since there's no evidence against the hypothesis
it has some small but definite probability. Multiply the costs in case 1
by that probability and there's still infinite cost by staying home.
Clearly I should go to Oslo, I should order those tickets Right Now™!

Except that the opposite hypothesis is just as likely. The cost of
staying home could by infinite under that opposite hypothesis.

This is not completely irrelevant to religion. The F-16 scenario
corresponds to Pascal's wager. Pascal, after whom the Pascal language is
named, as well as Pascal's triangle, a math prodigy, was so blinded by
religious ideas that he failed to consider the opposite hypothesis idea,
that if a Christian god can be assumed, so can a god that's incompatible
and offers the opposite costs and rewards for his chosen action.


> There is massive evidence against intelligent design for humans and life
> on earth in general - both in terms of direct evidence of natural
> development of life, and in terms of the mistakes in our "design". What
> sort of so-called "intelligent" designer could come up with something as
> impressive as the brain, yet get the eyeballs backwards? Or design male
> humans with a brain capable of rational thinking and a fine set of
> reproductive organs - but not enough blood to use them both at the same
> time?

Yes. The shark's nearly perfect eye design (blood vessels on back of
retina) versus the human botched eye design (vessels on front of retina)
is a case point. What retarded designer did the human eyes?


>> So whose design is it then? I believe it's ours. It's that simple: when
>> theory is at odds with reality, where the factors involved have hundreds
>> of digits, then one can conclude with /certainty/ that theory is wrong.
>>
>
> Sorry, you have confused me a little. I agree that some parts of our
> theories of the cosmos are badly wrong (we know this already), but the
> universe is not /our/ design. Our model of the universe, or our
> theories of it, are our design, if that's what you meant.

Yes.

Or models are what we believe the universe to be.

And that construct is clearly artificial. If we had done it right it
would have been natural. Some surprises here and there but no 10^122.


>> So, given that cosmology and/or physics has been proved wrong, and
>> that's what the evidence says, complete 100% certain proof, where should
>> one look for the incorrect assumption or assumptions?
>
> More research, experiments, thoughts and theories :-)
>
>>
>> My very personal speculation is that creation never ended. That we live
>> in a universe with creation still going on, just about everywhere,
>> opposing destruction, that also is going on, just about everywhere. That
>> may sound far fetched, e.g. we don't see much possible creation except
>> in galaxy centers and quasars and such, not anything locally!, but at
>> least it removes the self-contradiction of the BB hypothesis.
>>
>
> That is pretty much as good as any other hypothesis at the moment.
> There is a good deal about cosmology that is still very speculative.

:-)


Cheers!,

- Alf (super-off-topic mode)


David Brown

unread,
Jun 21, 2018, 8:39:24 AM6/21/18
to
On 21/06/18 14:03, Rick C. Hodgin wrote:
> On 6/21/2018 4:21 AM, David Brown wrote:
>> Perhaps this would help:
>>
>> for (int _pass = 1; _pass <= 3; _pass++) {
>> const int pass = _pass;
>>
>> switch (pass) {
>> case 1: printf("specific code for pass %d\n", pass); break;
>> case 2: printf("specific code for pass %d\n", pass); break;
>> case 3: printf("specific code for pass %d\n", pass); break;
>> }
>> printf("common code for pass %d\n", pass);
>> }
>>
>> Then the compiler will not let you change "pass" without complaint, and
>> you are not going to change "_pass" accidentally.
>
> I think the issue isn't our code affecting pass, as it will not. But
> it would be an overwrite of data on the stack or something else going
> haywire due to unexpected things.

If that is your risk, then checking "pass" for validity is a tiny issue.
All sorts of things can go wrong when your stack is unreliable - it is
a desperate hope to think that maybe it will change "pass" to something
other than 1..3 but otherwise leave your system running. Basically, you
can't trust /anything/ to be valid if your stack is overwritten.

Look at running with some of the sanitizers or debug facilities in clang
and gcc (MSVC may have something similar too), or with stack checking
features.

>
> As you know perfectly well and could teach a class on, a const value
> can still be updated externally by something that doesn't honor its
> const state (provided it's in read/write memory).

No, that is often not correct. Compilers will regularly assume that a
"const" value cannot change, and optimise accordingly. In code like
above, "pass" is not even going to be put in memory as such - it will be
in a register, and overflow to the stack if necessary. It won't be
separate from "_pass". And the compiler might unroll the loop and have
no register or memory variable "pass" or "_pass" at all.

It is true that with enough effort (like casts) you can make code that
looks like you are changing a const value - but you can never do so
reliably.

>
>> (If you want a feature for CAlive that I would like, make it illegal to
>> change the "_pass" variable inside the for loop here. In other words,
>> variables declared in a for clause should be considered "const" within
>> the scope of the loop.)
>
> That's an excellent idea. I will implement it. This is the second
> idea you've suggested that I've implemented. The first was namespaces.
>

Given how many things I have suggested you include in CAlive, and how
many things I have suggested you /don't/ include, I don't have a good
track record here!


Rick C. Hodgin

unread,
Jun 21, 2018, 9:03:20 AM6/21/18
to
On 6/21/2018 8:39 AM, David Brown wrote:
> On 21/06/18 14:03, Rick C. Hodgin wrote:
>> I think the issue isn't our code affecting pass, as it will not. But
>> it would be an overwrite of data on the stack or something else going
>> haywire due to unexpected things.
>
> If that is your risk, then checking "pass" for validity is a tiny issue.
> All sorts of things can go wrong when your stack is unreliable - it is
> a desperate hope to think that maybe it will change "pass" to something
> other than 1..3 but otherwise leave your system running. Basically, you
> can't trust /anything/ to be valid if your stack is overwritten.

I agree. The goal would be to catch the potential error when it's visible
to the program, and with as minimal an impact as possible.

> Look at running with some of the sanitizers or debug facilities in clang
> and gcc (MSVC may have something similar too), or with stack checking
> features.

MSVC comes with a code analyzer which does similar things. And there's
a third-party plug-in PVS-Studio Analyzer written by:

https://www.viva64.com/en/pvs-studio/
https://groups.google.com/d/msg/comp.lang.c++/q_C_rGEdKxc/KeFdBHwqBwAJ

It is excellent. It caught about 300 things in my app. Some of them
were invalid for various reasons (it doesn't know about my coding
philosophy of using i*() and ii*() functions where the i*() functions
have to test input parameters for being valid, and the ii*() functions
do not, and other similar protocols I enforce on my code which can make
something that seems like it could be invalid actually valid because the
invalid test was already performed with recovery handled elsewhere ...
but about 6 were actual bugs I had overlooked.

I have also used sanitizers on GCC before. Kostya Serebryany is one of
my favorite developers:

2013: https://www.youtube.com/watch?v=Q2C2lP8_tNE
2014: https://www.youtube.com/watch?v=V2_80g0eOMc
2015: https://www.youtube.com/watch?v=qTkYDA0En6U
2016: https://www.youtube.com/watch?v=FzaR3iH2iZs
https://www.youtube.com/watch?v=Zc8Jk7pX6n0
2017: https://www.youtube.com/watch?v=k-Cv8Q3zWNQ
https://www.youtube.com/watch?v=n6kP-CWO_0Q

Haven't seen any in 2018 yet.

>> As you know perfectly well and could teach a class on, a const value
>> can still be updated externally by something that doesn't honor its
>> const state (provided it's in read/write memory).
>
> No, that is often not correct. Compilers will regularly assume that a
> "const" value cannot change, and optimise accordingly. In code like
> above, "pass" is not even going to be put in memory as such - it will be
> in a register, and overflow to the stack if necessary.

That's no guarantee. It depends upon the other code there.

> It won't be
> separate from "_pass". And the compiler might unroll the loop and have
> no register or memory variable "pass" or "_pass" at all.

Again, no guarantee. Only a probability.

> It is true that with enough effort (like casts) you can make code that
> looks like you are changing a const value - but you can never do so
> reliably.

In my experience you can (in MSVC primarily).

>> That's an excellent idea. I will implement it. This is the second
>> idea you've suggested that I've implemented. The first was namespaces.
>
> Given how many things I have suggested you include in CAlive, and how
> many things I have suggested you /don't/ include, I don't have a good
> track record here!

The Bible teaches one to hear the things one hears, but only cling to
that which is good. :-)

--
Rick C. Hodgin

Chris Vine

unread,
Jun 21, 2018, 9:42:35 AM6/21/18
to
On Thu, 21 Jun 2018 12:39:08 +0200
David Brown <david...@hesbynett.no> wrote:
[snip]
> What sort of so-called "intelligent" designer could ... design male
> humans with a brain capable of rational thinking and a fine set of
> reproductive organs - but not enough blood to use them both at the same
> time?

Speak for yourself!

Scott Lurndal

unread,
Jun 21, 2018, 9:57:08 AM6/21/18
to
David Brown <david...@hesbynett.no> writes:
>On 21/06/18 10:43, Alf P. Steinbach wrote:

>>
>> Well, at the risk of maybe giving the Christian readers the wrong
>> impression, there is extremely convincing evidence of intelligent design
>> at a very high level, namely of the cosmos. The probability of the
>> various forces of nature being of the exact relative strengths to
>> support star creation (in particular the fusion process), is 1 over a
>> number with over a hundred zeroes. Just extremely unlikely.
>
>No, that is not evidence for intelligent design - not remotely so. It
>is evidence that our theories about how the cosmos is put together are
>incomplete.

Or evidence that our cosmos followed billions of failed cosmoses (zat a word?)
where the various cosmological constants didn't play well together - universal
evolution...

David Brown

unread,
Jun 21, 2018, 10:22:08 AM6/21/18
to
Agreed - but it is strong evidence for a mismatch of theory and reality
(or at least, a missing part of the theory). It is /not/ evidence for
intelligent design or that there is any kind of plan or design behind
the universe.

>
>
>> It
>> is evidence that our theories about how the cosmos is put together are
>> incomplete. Perhaps there are factors which force particular matches of
>> the various cosmological constants involved - that they are not
>> independent. This is a reasonable supposition, and would follow the
>> patterns we have already seen in modern (say, the last 100 years)
>> science where connections between different constants have been found.
>>
>>> Ditto for
>>> the energy density of vacuum. It's off by a similar super-extreme
>>> factor, some hundred+ zeroes, compared to what theory says it should be.
>>
>> No. There are two different theories as to what the vacuum energy
>> should be, looking at it from different viewpoints.
>
> Not as far as I know. There is reality, estimated from upper limit of
> the cosmological constant. Not that I know the details of that estimate,
> but according to Wikipedia's article it puts the energy at 10^-9 joules
> per m^3. Theory, the standard model of physics (QED) plus the Planck
> constant, according to the same article, predicts 10^113 joules per m^3.
> That's 122 orders of magnitude difference between reality and theory.
>

What we know about the cosmological constant, and its effects here, is
based on observations, some basic assumptions, and theories formed from
them. What we know about the standard model of QED is based on
observations, some basic assumptions, and theories formed from them.

Both sets of theories fit observations and predictions remarkably well
in their areas. But they fail to match up on certain overlapping
points. Situations with very high gravitational densities in very small
spaces - like black holes - are a serious sticking point. So is the
energy of a vacuum. But there is no basis for claiming that one of
these is "reality" and the other is "theory". They are our current best
approximations to model reality in a wide range of circumstances, and we
know they both fail to cover /all/ circumstances.


>
>> The values
>> predicted by these two theories differ by over a 100 orders of
>> magnitude. Either one of these theories is correct (in the sense of
>> being a good approximation to reality), or neither of them is - they
>> can't both be.
>
> You can be certain that reality is correct, that our estimate of it is
> nearly correct (we have measures of various effects to compare it to),
> and that it's the theory that's wrong by some 120+ order of magnitude.
>

Reality is correct, obviously. Our idea of what is "real" for something
like this is based on theory - and that theory could be wrong.

>
>> Again, this is evidence that science does not yet have
>> all the answers and a full picture (no news there) - it is not evidence
>> for any kind of designer or intelligence being involved.
>
> You need intelligence to make that large an error.
>

The universe doesn't have an error here - our theories do. You need
intelligence to make such theories, with or without such errors, so here
you have evidence that scientists are intelligent but the work of
science is not finished.

>
>>> Some Nobel prize winning physicists favor the Anthropic Principle as
>>> explanation, the explains-nothing notion that if the strengths of the
>>> forces were any different, or if the local energy density of vacuum was
>>> much higher than it actually is, we just wouldn't be here to ponder the
>>> question.
>>
>> Yes, that's the Anthropomorphic Principle - the universe is "human
>> friendly" because if it were not, we would not be here to observe it. A
>> variation is to suggest that there are vast numbers of alternate
>> universes with all sorts of different variations, and we are in one of
>> them. As you say, it is an "explains nothing" notion.
>>
>> Perhaps we will never find any better explanation. But that does not
>> mean we should stop looking, and it certainly does not mean we should
>> make one up.
>
> There I completely agree.
>
>
>>> At least one Nobel prize winner instead favors the US
>>> Christian's silly intelligent design of humans and Earth idea, proving
>>> that also Nobel prize winners can be utter idiots. But as I see it the
>>> evidence really points to intelligent design of the cosmos, its physics.
>>
>> Certainly there is (currently) no evidence to point /against/ an
>> intelligent designer who concocted the big bang as a high-school science
>> project. But there is no evidence for it, either.
>
> I get tired of the arguments of "no evidence against" the FSM, say. For
> any given such hypothesis one can construct an opposite hypothesis, with
> the same zero weight of evidence. They cancel and there's nothing.
>

Exactly. It is pointless to suggest that there is an intelligent
designer behind the universe - you might as well say you think it was
the flying spaghetti monster that made it. (This is the whole point of
the FSM.) There is no evidence or observation that gives the slightest
indication or justification for thinking the universe was designed -
merely some interesting facts that some people misinterpret.
It is also "designed" to focus under water, and has added hacks (the
lens) to compensate. And our distant ancestors lost most of the colour
resolution in order to improve night vision sensitivity - more recent
ancestors evolved massive brainpower to re-create the missing data when
they moved to a daytime lifestyle. Of course, the big brains have come
in handy for humans, but in terms of a vision system, we have this daft
system of a massively inferior input sensor (compared to, say, an eagle,
a shrimp, a squid, or even a fly) connected to a huge processing unit
designed to fill in all the information that is missing from the sensor.
It's a marvellous system in many ways, but a terrible design.

>
>>> So whose design is it then? I believe it's ours. It's that simple: when
>>> theory is at odds with reality, where the factors involved have hundreds
>>> of digits, then one can conclude with /certainty/ that theory is wrong.
>>>
>>
>> Sorry, you have confused me a little. I agree that some parts of our
>> theories of the cosmos are badly wrong (we know this already), but the
>> universe is not /our/ design. Our model of the universe, or our
>> theories of it, are our design, if that's what you meant.
>
> Yes.
>
> Or models are what we believe the universe to be.
>
> And that construct is clearly artificial. If we had done it right it
> would have been natural. Some surprises here and there but no 10^122.
>

I'm sure we can figure it out eventually - if we can afford to make the
machines big enough for the experiments needed.

David Brown

unread,
Jun 21, 2018, 10:25:03 AM6/21/18
to
On 21/06/18 15:03, Rick C. Hodgin wrote:
> On 6/21/2018 8:39 AM, David Brown wrote:

>> It is true that with enough effort (like casts) you can make code that
>> looks like you are changing a const value - but you can never do so
>> reliably.
>
> In my experience you can (in MSVC primarily).
>

No, you can't do so reliably. If you disable all optimisation (and
warnings, and static error checking) then you can often make code look
like you are successfully changing "const" values, even there it will
not always work.

But reliable or not, you shouldn't try!

Ben Bacarisse

unread,
Jun 21, 2018, 10:38:04 AM6/21/18
to
"Rick C. Hodgin" <rick.c...@gmail.com> writes:

> On 6/21/2018 6:17 AM, Ben Bacarisse wrote:
>> If assignments to pass are the real problem, only using functions can
>> really help. You get a very short loop, maybe only
>>
>> for (int pass = 1; pass <= 3; pass++) {
>> code_for_pass[pass]();
>> common_code(); // spelling correction
>> }
>>
>> so it's easy to check the pass is not assigned.
>
> CAlive has several features which allow something like this.

You mean it will have or maybe might have. And since your language is
bound to end up having loops and function calls, it will obviously allow
something like this. I think you mean it will allow the above to be
written in a more complex way.

> ... I actually spent time last
> evening considering a way to do what you suggest here, to create
> code accessibly by array and run it.

If it is intended to be a superset of C, it will support arrays of
function pointers so you would have had to be planning to ban the above
in some way.

In C, the functions whose pointers get put into the array have to be
named (non anonymous functions) and they can't be nested (no access to
names declared in an outer function) so the pattern above is much more
clumsy than it need be. If you are extending C, I would consider give
it proper function support before considering anything else. Maybe
that's what you meant -- you are considering ways to make function more
general than they are in C.

--
Ben.

Rick C. Hodgin

unread,
Jun 21, 2018, 10:50:50 AM6/21/18
to
On 6/21/2018 10:37 AM, Ben Bacarisse wrote:
> "Rick C. Hodgin" <rick.c...@gmail.com> writes:
>
>> On 6/21/2018 6:17 AM, Ben Bacarisse wrote:
>>> If assignments to pass are the real problem, only using functions can
>>> really help. You get a very short loop, maybe only
>>>
>>> for (int pass = 1; pass <= 3; pass++) {
>>> code_for_pass[pass]();
>>> common_code(); // spelling correction
>>> }
>>>
>>> so it's easy to check the pass is not assigned.
>>
>> ... I actually spent time last
>> evening considering a way to do what you suggest here, to create
>> code accessibly by array and run it.
>
> If it is intended to be a superset of C, it will support arrays of
> function pointers so you would have had to be planning to ban the above
> in some way.
>
> In C, the functions whose pointers get put into the array have to be
> named (non anonymous functions) and they can't be nested (no access to
> names declared in an outer function) so the pattern above is much more
> clumsy than it need be. If you are extending C, I would consider give
> it proper function support before considering anything else. Maybe
> that's what you meant -- you are considering ways to make function more
> general than they are in C.

My goals are to make coding easier for developers, and more rapid and
pleasant. I want to simplify things for development, and open up some
opportunities for coding methodologies that are not so easy today.

We'll see what I come up with. CAlive is still a work in progress.

--
Rick C. Hodgin

Manfred

unread,
Jun 21, 2018, 1:57:07 PM6/21/18
to
Since this has started, I will indulge too in some deep off-topicality here.

Swinging aside of the religious viewpoint, and taking instead a more
philosophical approach, this kind of discussion has been long debated -
although not been given any definite answer - as the juxtaposition
between materialism on one side and idealism on the other, both being
wide families of philosophies.

Personally I have always considered a pure materialistic approach as
quite superstitious:
The position is: there is no truth other than physical matter, because I
can't /see/ nor /touch/ anything but matter, and the fact that I can
/think/ of some truth beyond matter is just me being stupid.

On the other hand, when investigating for answers for fundamental
questions (substance of matter, origin of the world, what a human being
is), while the physical investigation provides more questions than
answers, the materialistic approach simply says: the answer is in the
matter and only in the matter, we just can't /see/ it yet!

I mean, really? The only truth is in what I can see and touch, and if I
can't find a definite answer in the physical matter, I have to /believe/
that the answer is there, I just can't /see/ it (yet)?

Not convincing enough for me, sorry. Instead, it sounds as superstitious
as some animistic cultures where the local shaman was believed to be
able to read the future in the ashes. In the end, if it has to come to a
/belief/, what's the point?

Obviously this does not diminish the value of physical sciences - all
I'm saying is that I don't think that they are all there is to say about
knowledge.
Mechanistic logic is /one/ side of human knowledge, but there can be
(and I think there is) more to that: most commonly the understanding of
what is right or wrong is not simply a matter of applying a formula to a
problem.
This seems slippery floor (leaving the safety of numbers is
frightening), but still this is what we humans do: thankfully, we make
choices that are very well more than the result of an algorithm.

Back to the (off-topic) point: I am convinced too that there is some
intelligent design in the organization of the world. What I find curious
is why this vision is so harshly opposed: besides the "this is the
truth" argument (objected above), even if in the past such "higher
level" design has been used to impose some "higher level" authority on
the masses, nowadays it is not any more so: my own freedom is in no way
diminished by such design.

Final note: I have kept intentionally away from religion (which is a
personal matter) because I think it is quite different from philosophy
(which is rather a kind of science), and also I am nearly as much
allergic to the materialistic superstition as I am to the "ipse dixit"
attitude of those who say "this is the truth because somewhere it is
written it is so"

Chris Vine

unread,
Jun 21, 2018, 5:00:27 PM6/21/18
to
On Thu, 21 Jun 2018 19:56:54 +0200
Manfred <non...@invalid.add> wrote:
[snip]
I do not thing it is "harshly opposed". And it is all very well
complaining about "materialistic superstition", but that is all we
have to go on outside the arena of religious faith.

For my own part I would just say that it is almost certainly going to
be unprovable one way or the other. I remember Richard Dawkins, for
whom I have great respect, saying some 30 years ago (I am that old)
that we will have a "theory or everything" within 10 years (ie by 20
years ago) which we will be able to write on our t-shirts. That struck
me as ridiculous at the time and it still does so now. As a biologist
he is also unqualified to make such predictions.

The building blocks of the universe are very, very strange. We live in
a universe comprised of a weird superposition of probabilities which can
slip into and out of deterministic resolution in a way which almost
requires pre-cognition. We haven't even got to the first stage of
understanding consciousness. Leaving aside Rick's ridiculous 6,000 year
old universe, which is provably false[1], there is no evidence for or
against intelligent design in its broadest sense. Complexity, and the
fact that the universe is finely balance (in the sense that small
changes in the fundamental physical constants would make the universe
unviable), which seems to be Alf's point, is no proof at all, so we
don't need to have an anthropomorpic principle to answer it[2]. And we
will probably never be able to probe scientifically into what lies
"behind" the Big Bang in order to determine whether there is a
"purpose" or a "God" behind it all.

To bring this more on topic, the theory that we are the manifestation
of the running of a complex computer simulation is as compelling as any
other explanation, and leaves as many questions unanswered, as does
pastafarianism.

Science can however disprove religious dogma. The doctrine of the
fall, which was a means of blaming us and not God for the deficiencies
of the things around us, by proposing that the universe was created as
perfect and it is Adam and Eve's fault (ie our fault) that it is not
so now, is only believed literally today by a small percentage of
Christians. Most Christians would now say that the fall is a
meaningful myth which engages issues of free will and so forth. So we
have to come up with other reasons why, for some people, life is a
struggle, and we are all the better for it.

[1] Except in his assertion that the universe was constructed in an
"as-if 11 billion years old" state some 6,000 years ago. That cannot be
either contradicted or proved.

[2] Except in the unlikely event that we can prove the existence of a
multiverse.

Rick C. Hodgin

unread,
Jun 21, 2018, 5:10:35 PM6/21/18
to
If any of you were truly wrong about your beliefs in how the universe
formed, or how we got here ... would you want to know?

--
Rick C. Hodgin

Mr Flibble

unread,
Jun 21, 2018, 5:15:09 PM6/21/18
to
On 21/06/2018 22:10, Rick C. Hodgin wrote:
> If any of you were truly wrong about your beliefs in how the universe
> formed, or how we got here ... would you want to know?

Speed of light mate.

/Flibble

--
"Suppose it’s all true, and you walk up to the pearly gates, and are
confronted by God," Bryne asked on his show The Meaning of Life. "What
will Stephen Fry say to him, her, or it?"
"I’d say, bone cancer in children? What’s that about?" Fry replied.
"How dare you? How dare you create a world to which there is such misery
that is not our fault. It’s not right, it’s utterly, utterly evil."
"Why should I respect a capricious, mean-minded, stupid God who creates a
world that is so full of injustice and pain. That’s what I would say."

Chris M. Thomasson

unread,
Jun 21, 2018, 6:25:30 PM6/21/18
to
On 6/21/2018 12:56 AM, David Brown wrote:
> On 20/06/18 23:05, Rick C. Hodgin wrote:
>> On Wednesday, June 20, 2018 at 3:59:31 PM UTC-4, Scott Lurndal
>> wrote:
[...]
> Be very clear here - Dawkins does not believe in intelligent design (by
> divine beings) or any sort of god. He does not believe there is any
> evidence for such things. Of course he believes that there could be
> alien design in the process (after all, the earth is unlikely to be the
> sole example of intelligence in the universe), but that we have found no
> evidence to suggest it. Distorting his words and taking things out of
> context does not change what he believes and says.
[...]

I think Dawkins does not totally outright reject the idea of Aliens
acting like a God... In a sense:

http://www.bbc.com/future/story/20141020-dawkins-what-are-aliens-like

http://www.jasoncolavito.com/blog/did-richard-dawkins-just-endorse-alien-gods

Rick C. Hodgin

unread,
Jun 22, 2018, 12:48:38 PM6/22/18
to
On Thursday, June 21, 2018 at 5:15:09 PM UTC-4, Mr Flibble wrote:
> On 21/06/2018 22:10, Rick C. Hodgin wrote:
> > If any of you were truly wrong about your beliefs in how the universe
> > formed, or how we got here ... would you want to know?
>
> Speed of light mate.

If you are going to continue to espouse this statement, at least
do it right. It should be, "Speed of light, mate."

I urge you to read this part:

There's more to the truth of who Jesus is than your
gainsaying reply.

If you ever want to seek the truth, Leigh, you will
find it. All who seek the truth do. The rest will
perish in their arrogance.

/IF/ you were wrong, Leigh, /IF/ you were wrong ... would you
want to know? That's a yes or no question only you can answer.
You will know the answer in your heart.

--
Rick C. Hodgin

Mr Flibble

unread,
Jun 23, 2018, 12:15:34 PM6/23/18
to

Christian Gollwitzer

unread,
Jun 23, 2018, 1:59:17 PM6/23/18
to
Am 21.06.18 um 10:43 schrieb Alf P. Steinbach:
> Well, at the risk of maybe giving the Christian readers the wrong
> impression, there is extremely convincing evidence of intelligent design
> at a very high level, namely of the cosmos. The probability of the
> various forces of nature being of the exact relative strengths to
> support star creation (in particular the fusion process), is 1 over a
> number with over a hundred zeroes. Just extremely unlikely. Ditto for
> the energy density of vacuum. It's off by a similar super-extreme
> factor, some hundred+ zeroes, compared to what theory says it should be.


There is a simple fallacy behind that argument, namely the "survivor
bias". "The oxygen level in the atmosphere is exactly right for humans.
Also the many edible plants. This is proof that the world was made for
humans!" - this is clearly wrong, it's the other way round, humans have
evolved and adapted to this kind of conditions, which were there before
us. If the conditions would be different, humans would a) either have
evolved to a different biology to cope with the different conditions, or
b) not have evolved at all, in which case you couldn't ask these questions.

The same is true for the law of physics. You can't say "look, how
sensible and intelligent the laws of physics are made, so that we can
exist!". It's the exact same fallacy, if it were different, we either
would have adapted or wouldn't exist. Also, you can't cherry-pick some
laws of physics which "could be different" and then keep others the same
and claim that the world wouldn't work. Nobody can answer what the world
would be if gravity would be ten times stronger, because what forces
electromagnetism to be the same in that case or even other forces or
particles to be the same? Survivor bias.

Christian

bitrex

unread,
Jun 23, 2018, 2:49:24 PM6/23/18
to
Applying "statistical arguments" at the level of the whole cosmos as
arguments for or against anything is IMO currently exercise in futility.
Look there's a lot of more basic shit we ain't even know before we can
start debating why the fundamental constants are precisely what they are.

We don't know if the particular Universe we find ourselves in is even
topologically finite or infinite or not, if conservation of energy holds
on the scale of the whole Universe (related question), or if the
fundamental constants are indeed even constant over large distances or
timescales.

"survivor bias" or what's called the anthropic principle is a fine
argument for "why things are" as far as it goes but it feels a bit
disappointing and unsatisfactory and like it's not really science, it's
a "theory" that doesn't really have any predictive power, it can only
predict the past.
0 new messages