Results 1 to 4 of 4

Thread: Coding Question

  1. Registered TeamPlayer Imisnew2's Avatar
    Join Date
    01-19-08
    Posts
    4,588
    Post Thanks / Like
    Blog Entries
    9
    #1

    Coding Question

    I'm curious...

    Why does "everyone" tell you not to use multiple returns in a method :P.
    I don't... for my own reasons, but is there any real consequence to it?

  2. Registered TeamPlayer
    Join Date
    10-29-07
    Posts
    4,953
    Post Thanks / Like
    Stat Links

    Coding Question
    #2

    Re: Coding Question

    The general argument is that it makes it harder to understand and maintain the code if there are multiple exit paths.

    However that's a general argument, and I have plenty of examples where the code was more readable and easier to maintain with multiple returns.

    Really, what it comes down to is making the code more readable and maintainable, so I personally don't make a rule about it, but simply choose whatever achieves that goal per situation (so I guess that is my rule).

  3. Registered TeamPlayer Warprosper's Avatar
    Join Date
    09-01-08
    Posts
    5,775
    Post Thanks / Like
    Blog Entries
    1
    Stat Links

    Coding Question Coding Question Coding Question Coding Question Coding Question Coding Question
    Gamer IDs

    PSN ID: Warprosper Steam ID: Nukewarprosper Warprosper's Originid: Warprosper
    #3

    Re: Coding Question

    Shenanigans!!!

    I use multiples all the time


    See

    Im using them right now......


    [Yea]
    !
    !


  4. Registered TeamPlayer Imisnew2's Avatar
    Join Date
    01-19-08
    Posts
    4,588
    Post Thanks / Like
    Blog Entries
    9
    #4

    Re: Coding Question

    Ok, thanks. I thought there was a security risk or something :P

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Bookmarks

Posting Permissions

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