The death of GOTO (user search)
       |           

Welcome, Guest. Please login or register.
Did you miss your activation email?
May 01, 2024, 08:12:53 AM
News: Election Simulator 2.0 Released. Senate/Gubernatorial maps, proportional electoral votes, and more - Read more

  Talk Elections
  General Discussion
  History (Moderator: Southern Senator North Carolina Yankee)
  The death of GOTO (search mode)
Pages: [1]
Author Topic: The death of GOTO  (Read 1948 times)
True Federalist (진정한 연방 주의자)
Ernest
Moderators
Atlas Legend
*****
Posts: 42,144
United States


« on: February 01, 2005, 12:24:46 PM »

That's because the use of GOTO is largely gone.
It's use in early computer languages was because they didn't have nice built-in structures such as for loops and else clauses.  Even when they were retrofitted onto those languages, there was a large base of existing code (and of existing programmers) that continued to use GOTO's instead of the structures.
Logged
True Federalist (진정한 연방 주의자)
Ernest
Moderators
Atlas Legend
*****
Posts: 42,144
United States


« Reply #1 on: February 01, 2005, 01:53:27 PM »

Even now, most acceptable uses of GOTOs could be transformed into structured programming, if the appropriate structure were available.  However, these structures are numerous and individually of little use, it doesn't make sense to code them just to get rid of the humble GOTO.
Logged
True Federalist (진정한 연방 주의자)
Ernest
Moderators
Atlas Legend
*****
Posts: 42,144
United States


« Reply #2 on: March 12, 2005, 01:54:24 PM »

What muon2 was talking about is that it's impossible to remove the "goto" type of statement entirely, because anything that disrupts the linear execution of commands must use some sort of "goto" statement.  There are no "while", "for", etc. loops, nor are there "if/else" statements, in machine language, which is what all programs eventually become.

Actually that depends on the machine.  While it's not true of early computers or of modern RISC architecures, CISC machines such as the VAX had machine language equivalents for loops and if/elses.  Partly that was because machine designers were looking for ever more features to add their architechtures without considering the speed implications of adding more instructions to the instruction set, but it was also due to the fact that there a period during the 60's and 70's where the ratio of processor speed to memory speed was higher than it was before or since, making the use of specialized instructions so as to reduce the number of memory accesses a way to increase overall speed.
Logged
Pages: [1]  
Jump to:  


Login with username, password and session length

Terms of Service - DMCA Agent and Policy - Privacy Policy and Cookies

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Page created in 0.03 seconds with 13 queries.