> On Dec 30, 2017, at 7:46 AM, Peter J. Holzer <hjp-pyt...@hjp.at> wrote: > > On 2017-12-29 19:09:35 -0500, Dennis Lee Bieber wrote: >> On Fri, 29 Dec 2017 23:12:22 +0000, bartc <b...@freeuk.com> declaimed the >> following: >>> Looking at 14 million lines of Linux kernel sources, which are in C, >>> over 100,000 of them use 'goto'. About one every 120 lines. >>> >> >> C is a language that predates the "structured programming" concepts of >> the late 70/early 80. > > I don't think this is correct. Structured programming is much older: > ALGOL 60 was already a block structured language and Dijkstra wrote > "goto considered harmful" in the late 1960s. Pascal appeared in 1970, C > in 1974. To me (who learned to program in BASIC on a CP/M machine), C > is very much a structured programming language. If structured > programming gained traction around 1980, it might even have been because > structured languages like C with good performance became widely > available. > > That said, C lacks exception handling (well, there is setjmp/longjmp, > but ...) and multi-level break/continue, so goto is often the cleanest > way to abort what you are doing and start to clean up. Python has > exception handling, and that removes most of the cases where you would > use goto in C (the rest is probably mostly in micro-optimizations: If > you care about the run-time difference between a goto and a subroutine > call, you probably shouldn't use Python in the first place). > > hp >
I’ve been watching this discussion ebb and flow - and finally can’t resist pointing folks here at the famous essay: “Real Programmers Don’t Use Pascal”. It has its own Wikipedia article at this point: https://en.wikipedia.org/wiki/Real_Programmers_Don't_Use_Pascal A copy of the original essay appears here: https://www.ee.ryerson.ca/~elf/hack/realmen.html Hopefully fun reading over a beer. Bill -- https://mail.python.org/mailman/listinfo/python-list