If statement best practice

no really it was there in the original K&R "The C Programming_Language" in 1978

image

(text can be found on line)

1 Like

I thought I remembered that from my first 'C' class in college, circa 1983.

wow thanks

You didn't highlight but it goes on to say

Most C programs rely on these properties.

which given what ppl were up to with C at that time was probably not hyperbole.

I know they are exploited in many programs and sketches I take responsibility for. Maybe not quite most, but a few personal idioms use it around finite state machinery, so.

a7

yes it was "heavily" used then and still is :slight_smile:

What I came across googling on this matter and had not considered is the idea that if a language specification does not pick a side, that is to say make clear that there will, or will not, be short circuiting, you end up with "the worst of both worlds".

Like an unrelated observation I heard for the first time a few days ago about how during the partial phases of a solar eclipse shadows get sharper because the sunlight is coming from a smaller and smaller area of the photosphere.

8 April 2024, get there, be there. Nothing compares to standing in the shadow of the Moon and looking straight into where the Sun should be.

a7

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.