Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

And here's its fully structured counterpart:

  do_stuff1();
  while (!condition()) {
    do_stuff2(); 
    do_stuff1(); 
  }


do_stuff1() is a shorthand. It can be a block of code tens of lines long.


It is a part of the structured programming idea to make modules callable by a "shorthand". It is not in the spirit of structured programming to make use of flow control flag variables.


But if you extract each piece of code that doesn't fit the structured syntax into a separate function you'll end up with zillions of small functions witch have no clear semantics by themselves (only when considered within the context of the calling function). That's probably the most unreadable coding style I've seen in my career.


I did not say it was recommendable. I just said that that was the structured counterpart. Your counterpart is not. Also I believe most structured programming advocates have no problem considering leaving a loop in the middle as a valid programming structure.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: