Skip to main content
Correcting miss placed word
Source Link
codingCat
  • 499
  • 2
  • 8

This is discussion is adjacent to one of the longest running religious wars in Computer Science - is the "goto" command evil.

Return, break, continue and even the much reviled goto all do the same thing. They disrupt the flow of the code. If you have a math background and think in algorithms then nothing could be more crazy making than a mid-function return because it makes it all but impossible to create proofs of the validity of the code. If you have an engineering background, are familiar with the code a compiler produces and the clock cycles needed to complete a task then there is nothing more beautiful then a simple jump command.

Two of the venerable grey beards of our discipline Niklaus Wirth and Linus Torvalds have drastically different takes on the topic. There is a famous exchange with Torvalds where he spells out his point of view (and his opinion of Wirth) in unambiguous detail: Using Goto in Linux Kernel Code

What it comes down to:

  • If you like pretty code, sometimes at the expense of readability, then you hate jumps of any kind.
  • If speed and efficiency is your thing, then its jumping all the way.

This is discussion is adjacent to one of the longest running religious wars in Computer Science - is the "goto" command evil.

Return, break, continue and even the much reviled goto all do the same thing. They disrupt the flow of the code. If you have a math background and think in algorithms then nothing could be more crazy making than a mid-function return because it makes it all but impossible to create proofs of the validity of the code. If you have an engineering background, are familiar with the code a compiler produces and the clock cycles needed to complete a task then there is nothing more beautiful then a simple jump command.

Two of the venerable grey beards of our discipline Niklaus Wirth and Linus Torvalds have drastically different takes on the topic. There is a famous exchange with Torvalds where he spells out his point of view (and his opinion of Wirth) in unambiguous detail: Using Goto in Linux Kernel Code

What it comes down to:

  • If you like pretty code, sometimes at the expense of readability, then you hate jumps of any kind.
  • If speed and efficiency is your thing, then its jumping all the way.

This discussion is adjacent to one of the longest running religious wars in Computer Science - is the "goto" command evil.

Return, break, continue and even the much reviled goto all do the same thing. They disrupt the flow of the code. If you have a math background and think in algorithms then nothing could be more crazy making than a mid-function return because it makes it all but impossible to create proofs of the validity of the code. If you have an engineering background, are familiar with the code a compiler produces and the clock cycles needed to complete a task then there is nothing more beautiful then a simple jump command.

Two of the venerable grey beards of our discipline Niklaus Wirth and Linus Torvalds have drastically different takes on the topic. There is a famous exchange with Torvalds where he spells out his point of view (and his opinion of Wirth) in unambiguous detail: Using Goto in Linux Kernel Code

What it comes down to:

  • If you like pretty code, sometimes at the expense of readability, then you hate jumps of any kind.
  • If speed and efficiency is your thing, then its jumping all the way.
Source Link
codingCat
  • 499
  • 2
  • 8

This is discussion is adjacent to one of the longest running religious wars in Computer Science - is the "goto" command evil.

Return, break, continue and even the much reviled goto all do the same thing. They disrupt the flow of the code. If you have a math background and think in algorithms then nothing could be more crazy making than a mid-function return because it makes it all but impossible to create proofs of the validity of the code. If you have an engineering background, are familiar with the code a compiler produces and the clock cycles needed to complete a task then there is nothing more beautiful then a simple jump command.

Two of the venerable grey beards of our discipline Niklaus Wirth and Linus Torvalds have drastically different takes on the topic. There is a famous exchange with Torvalds where he spells out his point of view (and his opinion of Wirth) in unambiguous detail: Using Goto in Linux Kernel Code

What it comes down to:

  • If you like pretty code, sometimes at the expense of readability, then you hate jumps of any kind.
  • If speed and efficiency is your thing, then its jumping all the way.