Comments: One of my pet peeves

A minor point: his name is Linus not Linux.

Posted by Steve L. at July 27, 2007 07:48 AM

I wrote my first program in Fortran IV back when I were a lad, around 1967. There weren't none of these fancy control structures, you used a computed GOTO and liked it!

Be that as it may, I've only used GOTO or its equivalent in assembly language since I started using structured languages. There've been a few times I could have used one, but the languages I was using didn't allow them.

For the most part, though, the higher-level control structures are just syntactic sugar; they just hide the GOTOs from the programmer. If you were disciplined, you could write code just as well using GOTOs. It's just that it's too easy/tempting to write spaghetti code unless the language helps you apply that discipline.

W.D. Maurer had an article back in the early days of BYTE magazine, "24 Ways to Write a Loop," which showed that many ways to organize the comparisons, IF..THENs, and GOTOs to provide looping structures. We get by on a lot fewer variants these days, because it's easier to develop solutions in terms of a few higher-level constructs rather than having to choose from a larger number of lower-level constructs that you'd have to remember how to implement yourself.

Posted by wheels at July 27, 2007 08:18 AM

I was an assembly language programmer for a few years, so I'm well aware that BZ, BNZ and others are simply GOTO statements. I like the disguise of higher level languages because they help teach you to think the problem through, which most people won't do if they use the unconditional branch command.

Whoops on the name. I was reading Linus, thinking Linus, but somehow I typed Linux. I'll fix it.

Posted by physics geek at July 27, 2007 01:39 PM

I still have some unused punch cards in case they come back in style.

In college, my "friends" would slip cards punched with "Woody Woodpecker" into my deck, which ended up giving me a dump with that name all through it. I didn't mind picking out those cards as much as having to go back to the computer center at 2:00 AM the next night to run and pickup my printouts for correcting.

Posted by Woody at July 28, 2007 11:48 AM