Reading a key inside a loop

M

Mark McIntyre

jaysome said:



I consider "infinite loops" to be an aberration, not an idiom.

How bizarre. I'm sure you have _some_ experience with real world
code...

Your turn.

Sorry I was late, on my hols.
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 
R

Richard Heathfield

Mark McIntyre said:
How bizarre. I'm sure you have _some_ experience with real world
code...

Kid, I've flown from one side of this industry to the other. I've
seen a lot of strange stuff, but I've never seen a truly infinite loop.
They all end eventually. Even microwave ovens get power-cycled
occasionally.

I've got an infinite loop under test right now - it's been running since
March 2006, and I can report, over a year later, that it has still not
run forever.
 
R

Richard Tobin

Richard Heathfield said:
Kid, I've flown from one side of this industry to the other. I've
seen a lot of strange stuff, but I've never seen a truly infinite loop.

Well of course you haven't seen any *yet*.

-- Richard
 
R

Richard Heathfield

Richard Tobin said:
Well of course you haven't seen any *yet*.

When I see one that actually works (i.e. runs to infinity), I'll believe
they can exist and that it makes sense to write one. Until then:
testing, testing...
 
D

Default User

Richard said:
Mark McIntyre said:


Kid, I've flown from one side of this industry to the other. I've
seen a lot of strange stuff, but I've never seen a truly infinite
loop. They all end eventually. Even microwave ovens get power-cycled
occasionally.

So call it an "indefinite loop" or something if you prefer. The
nomenclature isn't all that important I'd say. Your objection seems to
be the implementation anyway.

I had a guy I worked with who didn't like breaks to exit loops. He was
foreverly reading and arguing from the coding standard in an attempt to
force others to go along.




Brian
 
R

Richard Heathfield

Default User said:
Richard Heathfield wrote:

So call it an "indefinite loop" or something if you prefer.

Why not call it a loop, and define under which conditions it is supposed
to end?

Actually, the microwave oven example is about the best justification I
can think of for using an "infinite" loop, since the loop really does
have to last "forever", in the sense that there are no conditions in
which the program has to take action to terminate the loop. That is
entirely in the hands of the deus ex machina (for a suitably loose
interpretation of 'ex'!).
 
R

Richard Tobin

Richard Heathfield said:
Actually, the microwave oven example is about the best justification I
can think of for using an "infinite" loop, since the loop really does
have to last "forever", in the sense that there are no conditions in
which the program has to take action to terminate the loop.

This is true for lots of programs - they run until interrupted. It's
only the modern taste for programs with graphical interfaces that has
made them less popular than they were.

-- Richard
 
M

Mark McIntyre

Kid, I've flown from one side of this industry to the other. I've
seen a lot of strange stuff, but I've never seen a truly infinite loop.
They all end eventually. Even microwave ovens get power-cycled
occasionally.

Of course - I should have realised you were being anally stupid rather
than serious.

For reference, would you mind specially marking up your silly posts in
some way, so that we can differentiate them from your sensible ones in
future?

--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 
M

Mark McIntyre

Richard Tobin said:


When I see one that actually works (i.e. runs to infinity), I'll believe
they can exist and that it makes sense to write one.

Oh, please. Talking of things you have not observed in person - one
assumes you don't believe in microbes or the moons or Saturn? And
presumably you also have to assume that as soon as you look away, your
code disappears?
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 
R

Richard Heathfield

Mark McIntyre said:
Of course - I should have realised you were being anally stupid rather
than serious.

I was being very serious, and this is not the first time, by any means,
that you've used invective as a substitute for rational discussion, so
I think it's time to drop you into the bozo bin for a while until
you've calmed down a bit.
 
M

Mark McIntyre

Mark McIntyre said:

Patronising, and inaccurate. I passed over it first time.
I've flown from one side of this industry to the other. I've

I was being very serious,

Then as I said, you're being anally stupid.
and this is not the first time, by any means,
that you've used invective as a substitute for rational discussion,

This is false. I use invective sparingly and only when no other
sensible response is possible, typically when someone has said
something stupid, false or disingenuous.

By the way, I've noticed an increasing tendency in your posts to react
badly to criticism, often by veiled insult, patronising phrases or
unsubstantiated implications. I personally find that disappointing as
in general your posts have been useful and informed, and I worry that
your long-running feud with a couple of people here is causing you to
adopt their methods.
so
I think it's time to drop you into the bozo bin for a while until
you've calmed down a bit.

Feel free. Please understand that I was being completely serious: I
really do consider your remarks above stupid and anal. If you feel it
was invective, you have an insufficiently thick skin for usenet, and
and overly inflated view of your own importance.


--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 

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,779
Messages
2,569,606
Members
45,239
Latest member
Alex Young

Latest Threads

Top