Results 1 to 6 of 6

Thread: A 'cussin bout for a four letter word

  1. #1
    Join Date
    Sep 2011
    Location
    Earth
    Posts
    63
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default A 'cussin bout for a four letter word

    The infamous "goto" rears its head again.

    I have come across varying levels of opinion of its usage, and code bases that have it buried in it, not to mention the fact it is equivalent to assembly language jump command.

    After reading up on Concurrent Pascal I came across a programming reason not to use it:
    "A programming language that permits unrestricted use of assembly language features, such as jumps, typeless machine words, and addresses is insecure."
    </b>Monitors and Concurrent Pascal: A Personal History, Brinch Hansen<b>

    http://cs305.com/book/programming_la...121-hansen.pdf

    When reading this short paper it sounds like foundations of popular Oses today, as well as the forecasting of bugs and viruses.

    I got to this paper through references etc, a dual stack in memory on a 4k ram machine... wow(that is in a nerd way...lol).

    His programming philosophy was to be abstract and secure, goto don't fit it.

    Now I am beginning to really understand why G8tes has been accused of spreading the biggest virus on the internet.
    Last edited by Lima Bean; 10-12-2011 at 11:13 AM. Reason: typos

  2. #2
    Join Date
    Jan 2011
    Location
    Denver, CO
    Posts
    1,351
    Mentioned
    2 Post(s)
    Quoted
    72 Post(s)

    Default

    I enjoy Edsger Dijkstra's opinion on the goto statement

    http://www.u.arizona.edu/~rubinson/c...d_Harmful.html

  3. #3
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    I don't think it's fair to say that because Windows uses goto (I have no idea if it does, you just seemed to hint at it) it's bad. Microsoft programmers and Edsger Dijkstra are two entirely different things. If you've ever worked for a company programming, I'm sure you can understand.

    What programmers are paid to do for companies (usually, I suppose) is to make things work. Nobody really cares how well the programs are written, as long as performance and aesthetics are good.

    Anyway, I don't use goto. I don't like how it looks, mainly. Also there are more clear ways for the same functionality, arguably.

  4. #4
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    Working on: Tithe Farmer

  5. #5
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    I still don't understand why people dislike the statement so much (no, I'm probably not going to read the articles posted in this thread). It's used in MSI and does exactly what we want, and there's really no good, clean alternative (if someone wants to see the code I'll post it).

  6. #6
    Join Date
    Aug 2009
    Location
    Nova Scotia, Canada
    Posts
    604
    Mentioned
    0 Post(s)
    Quoted
    56 Post(s)

    Default

    Ironically most (all?) of us use it in our scripts indirectly without even knowing it (assuming the interpreter implements "proper" pascal).

    Pascal allows for one entry point to a routine (the top) and one exit point for a routine (the bottom). When you sprinkle your code with exit statements you are saying goto the end of the routine, at which point it actually exits.

    Bad code is bad code, regardless of whether it uses goto or not. I've seen some really lousy code that didn't use goto. I've also seen some really elegant well written code that does use goto.

    Edit: Just read some of the references. What rubbish. Blah Blah Blah because some people abuse goto the use of goto is bad. We should banish it! blah blah blah whine whine. Sounds suspiciously like a lot of the political reasoning you hear.
    Last edited by Bixby Sayz; 10-21-2011 at 01:07 AM.
    Never ever approach a computer saying or even thinking "I will just do this quickly".

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •