Learning C online?

B

Bartc

Richard Heathfield said:
Bartc said:
Nevertheless, a computer is not, strictly speaking, required for a C
implementation....it would be perfectly possible,
albeit unwieldy, to implement C on a model railway, using nothing but
normal track (and, I think, three different kinds of points). It sounds
utterly bizarre, but it is nevertheless true.

I give up. How does it work?
 
R

Richard Heathfield

Bartc said:
I give up. How does it work?

Well, I base my statement on two facts:

1) any computable problem (including C compilation) can be computed on a
Turing machine;
2) a Turing machine can be implemented on a model railway (given the
existence of three particular kinds of points).

You set up the initial state by setting points (each can be in either of
two states, so they are effectively bits), and you read off the final
state after the engine has whizzed round the track.

To make everything work is distinctly non-trivial, but it /is/ possible.
Papers have been published on this, and there is even a detailed
exposition of the "Turing tape" reader and writer track layouts in a
mathematics book (which, right now, I can't find, obviously).
 
M

Micah Cowan

Richard Heathfield said:
2) a Turing machine can be implemented on a model railway (given the
existence of three particular kinds of points).

I did _not_ know that. That is really freaking cool, and I guess that
goes a long way towards explaining why the world's very first,
original hackers, were model railway clubbers, and why their
fascination with railroad switches translated so smoothly to computer
hacking.
 
L

lawrence.jones

Bartc said:
My C99 spec doesn't seem to mention the word 'Computer' anywhere either

No, but it does mention "data-processing system" a number of times, and
that's essentially the same thing.

-Larry Jones

Even though we're both talking english, we're not speaking the same language.
-- Calvin
 
L

lawrence.jones

Richard Heathfield said:
IIRC Peter Seebach once claimed that he is a conforming C
implementation (although it's a somewhat suspect claim since his
conformance documentation doesn't seem to be available).

Sure it is, just ask him for it. It is verbal, though, rather than
hardcopy. :)

-Larry Jones

Whatever it is, it's driving me crazy! -- Calvin
 
E

Eric IsWhoIAm

Richard said:
Yes you can. With a debugger. or in your head - SOMETIMES.


Garbage.
Thus you say, and thus it must be true? If you believe the above statement
to be true (that is, that his statement is garbage), please elucidate upon
your reasons for believing so. It would help in your attempt to convince
others to agree with you.
Ye gods, you're an arrogant arse. So if I give you a printout of say
300,000 lines of C, are you telling me you can "read it" and point out
all thebugs? No. You could not. Even the mighty you.


You appear to by lying or twisting the truth in order to slander Jacob
and his product. Why is this?

There is NO equivalence between reading code and debugging it.

None whatsoever. Equivalence that is. Reading does not mean
simultaneous debugging.

Clearly you need to be able to read code to debug it. But reading code
does not mean you are able debug it properly without other tools.

Enlightened Gentlemen:

After following this conversation for some time, it appears that one of the
primary causes for such belligerance as is being displayed here is simply a
different opinion of the meanings of certain words, particularly, of the
phrase "reading code". I believe that as reasoning adults, there ought to
be a way that we can come to terms with each other without engaging in the
newsgroup equivalent of open warfare.

First off, allow me to state that I have nothing but the greatest respect
for all parties involved. Although I will be getting my Bachelor of Science
degree in Software Development within six months, I am not even going to
attempt to compare my knowledge of C (nor of any other aspect of
programming) to those of you, my esteemed conversationalists.

Nevertheless, it should be possible for us to openly disagree with each
other without getting so worked up that it affects us emotionally. How many
of you would be proud of your current online behavior if your spouse,
significant other, boss, or mother were to witness it?

It appears to me that the biggest topic of dispute is Mr. Heathfield's
definition of "reading" up to approximately 2,000 lines of code. I would
like to present my views on this topic, and then hopefully the primary
parties will present their views thereafter.

First of all, I believe that Jacob Navia and Richard (I am not certain of
the last name) believe that merely reading code does not instill within them
the ability to debug it. To them, then, reading it may be like reading a
newspaper: They read some parts here and understand it, they read some parts
there and understand it, but debugging it without a special tool (a
debugger) would be like single-handedly trying to change the political slant
of a newspaper. (Yeah, I know, I'm kind of stretching it here... just bear
with me, please.)

On the other hand, it would appear that Richard Bos and Richard Heathfield
view the reading of code to be more akin to reading a really good book: They
get so in depth with it, that they are able to truly understand all of its
intricacies and dependencies, and are thus able to see when something
doesn't "make sense" (like, for example, when a character that was in one
area suddenly appears to be in another area -- the author goofed and forgot
who was where).

Is this accurate? I look forward to your responses.

-- Eric Johnson
 
J

jacob navia

Eric said:
It appears to me that the biggest topic of dispute is Mr. Heathfield's
definition of "reading" up to approximately 2,000 lines of code. I would
like to present my views on this topic, and then hopefully the primary
parties will present their views thereafter.

First of all, I believe that Jacob Navia and Richard (I am not certain of
the last name) believe that merely reading code does not instill within them
the ability to debug it. To them, then, reading it may be like reading a
newspaper: They read some parts here and understand it, they read some parts
there and understand it, but debugging it without a special tool (a
debugger) would be like single-handedly trying to change the political slant
of a newspaper. (Yeah, I know, I'm kind of stretching it here... just bear
with me, please.)

On the other hand, it would appear that Richard Bos and Richard Heathfield
view the reading of code to be more akin to reading a really good book: They
get so in depth with it, that they are able to truly understand all of its
intricacies and dependencies, and are thus able to see when something
doesn't "make sense" (like, for example, when a character that was in one
area suddenly appears to be in another area -- the author goofed and forgot
who was where).

Is this accurate? I look forward to your responses.

I doubt that anyone with a normal brain can read and understand
more than 1500-2000 lines of code (foreign code, i.e. code that
you read for the first time), and be able to find complex problems
with it.

You can find obvious one, and maybe (if you are very good) subtle ones.


For the difficult bugs however, a toold like a debugger is essential.

The limitations of the brain are obvious here. In software, only
brains introduce bugs when building software, never the machines,
and almost never the compilers/linkers, etc.

Why?

Because the only circuit that can write software is the human circuit.
All errors go to that circuit then.

The problem with it, as I have stated several times in this discussion,
is that it can't do what machines routinely do: executing thousands
of times the same calculation without any problems, quickly and
without errors.

Why do bugs exist?

Because the human mind is like that: error prone. And it has
a lot of difficulties in following and executing symbollically
all possibilities of a program.

That is why bugs appear.

Obviously, I doubt greatly that people can just read more than
2000 lines of C and find a significant error inside.
 
E

Eric IsWhoIAm

jacob navia said:
I doubt that anyone with a normal brain can read and understand
more than 1500-2000 lines of code (foreign code, i.e. code that
you read for the first time), and be able to find complex problems
with it.

You can find obvious one, and maybe (if you are very good) subtle ones.


For the difficult bugs however, a toold like a debugger is essential.

The limitations of the brain are obvious here. In software, only
brains introduce bugs when building software, never the machines,
and almost never the compilers/linkers, etc.

Why?

Because the only circuit that can write software is the human circuit.
All errors go to that circuit then.

The problem with it, as I have stated several times in this discussion,
is that it can't do what machines routinely do: executing thousands
of times the same calculation without any problems, quickly and
without errors.

Why do bugs exist?

Because the human mind is like that: error prone. And it has
a lot of difficulties in following and executing symbollically
all possibilities of a program.

That is why bugs appear.

Obviously, I doubt greatly that people can just read more than
2000 lines of C and find a significant error inside.
Thank you, Jacob, for your rapid reply. You present your side of the
discussion logically. I concur that there is a limit to how much the human
mind can follow, although I am certain that there are many others who can do
more, and more accurately, with their minds than I currently can with my own
mind. And I agree, the human mind can indeed be error prone.

I eagerly await a response from the opposing side in this discussion.

-- Eric Johnson
 
B

Bartc

First of all, I believe that Jacob Navia and Richard (I am not certain of
the last name) believe that merely reading code does not instill within
them the ability to debug it. To them, then, reading it may be like
reading a newspaper: They read some parts here and understand it, they
read some parts there and understand it, but debugging it without a
special tool (a debugger) would be like single-handedly trying to change
the political slant of a newspaper.
On the other hand, it would appear that Richard Bos and Richard Heathfield
view the reading of code to be more akin to reading a really good book:
They get so in depth with it, that they are able to truly understand all
of its intricacies and dependencies, and are thus able to see when
something doesn't "make sense" (like, for example, when a character that
was in one area suddenly appears to be in another area -- the author
goofed and forgot who was where).

That sounds pretty good.

My own experience, coming back to some old code (of my own), it takes ages
to get back into it and 'get the picture', maybe several days. At first I
might tentatively make minor changes, but once familiar with it I can chop
and change huge sections, restructure, and so forth.

Partly this is because a lot of the reasoning or rationale for the code is
in the programmer's (ie my) head, not in the code, and it takes time to
re-acquire. I'm talking about typically 5K to 100K lines of code here.

Perhaps the better analogy is between proof-reading a book and writing the
novel.

This is all with my own code. I've never had much luck with anyone else's
code: starting with a 2-3 inch thick assembler listing of code that had
never worked, it was easier to just start again, and I've find the same
thing ever since. My style is just different.

I've never used debuggers either, for either hardware or software. Tracking
down an elusive bug is more like a sport; a proper debugger would spoil the
fun.
 
E

Ed Prochak

Thank you, Jacob, for your rapid reply. You present your side of the
discussion logically. I concur that there is a limit to how much the human
mind can follow, although I am certain that there are many others who can do
more, and more accurately, with their minds than I currently can with my own
mind. And I agree, the human mind can indeed be error prone.

I eagerly await a response from the opposing side in this discussion.

-- Eric Johnson

I wasn't going to respond since I thought his post was very weak.
you force me to point out that The Argument presented is circular.

To paraphrase the key phrases from his text:
why to mistakes exist?
because the human brain is mistake prone.
the solution: use a debugger.


Note I am on a third path. Jacob argues a debugger is a must.
others say only the code is needed.
I say that both are incomplete without the requirements.

Ed
 
D

David Thompson

#if waste_of_bits
Sure it is, just ask him for it. It is verbal, though, rather than
hardcopy. :)
'document' isn't defined in 9899, so I hope it is in 2382, and I sure
hope that includes at least printed or printable.

However, the requirement is '_accompanied by_ a document'. So he could
keep it on his person, and only allow you to see it in his presence
and not copy it. (Like for 'top secret' documents, at least according
to sources like Tom Clancy and Hollywood.) And it could be written in,
say, cuneiform, as intertwined spirals, in dark gray on black.

In fact, it's not clear he must let you read it at all, as long as he
can prove it exists and contains the required information. But I don't
see any definitive way to do that. There are cryptographic protocols
for 'zero knowledge' proof, but only if both (or all) parties
cooperate, and that isn't required here.

I'll go out and come in again. <G>

- formerly david.thompson1 || achar(64) || worldnet.att.net
 

Ask a Question

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

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

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top