User Tag List

Page 2 of 2 FirstFirst 1 2
Results 8 to 10 of 10

Thread: [Lua] 'goto' statement.

  1. #8
    Super Moderator <span style='color: #FFFF00'><span class='glow_000000'>Kaev</span></span>'s Avatar

    Join Date
    Jan 2014
    Location
    Germany
    Posts
    535
    XP
    2,925,321
    Level
    335
    Thanks
    76
    Thanked 102 Times in 70 Posts
    It can't improve the quality of your code. It will make it hard to debug and hard to read, also called bad code.
    And if you want to loop something, use a loop, not goto.
    Achievements:
    Shopper Member 1 year registered Level XL Level C
    Awards:
    Raffle Winner Member of Staff Support LOL Drunk Donator


    Read the rules before posting.

    Do you have an unsolved issue? Give us more informations about your problem.

    Do you have problems with compiling or installing TrinityCore? Unknown96's Tutorial will help you.

    Visit our other helpful sites:
    EmuDevs SQL Generator

  2. #9
    Original Poster
    Esteemed Member <span style='color: #4169E1'>Grandelf</span>'s Avatar
    Join Date
    Oct 2014
    Posts
    104
    XP
    64,547
    Level
    78
    Thanks
    18
    Thanked 110 Times in 45 Posts
    This is all a matter of opinion and I think people should decide for themselves if they want to use this or not.

    Quote Originally Posted by Kaev View Post
    And if you want to loop something, use a loop, not goto.
    I am not trying to loop through anything, what I am doing is simulating a continue statement,
    which without goto is not possible in Lua. Which is exactly why I think goto is a useful
    addition to Lua.

  3. #10
    Moderator / Eluna Dev <span style='color: #FF0000'><span class='glow_8B0000'>Rochet2</span></span>'s Avatar
    Join Date
    Apr 2013
    Location
    Finland
    Posts
    1,856
    XP
    13,466
    Level
    35
    Thanks
    95
    Thanked 591 Times in 418 Posts
    Quote Originally Posted by Kaev View Post
    It can't improve the quality of your code. It will make it hard to debug and hard to read, also called bad code.
    And if you want to loop something, use a loop, not goto.
    You can misuse a lot of things, but that doesnt mean you should completely ignore them. There are cases where they are more benefit than bad.
    I wanted to give some quote, so here is one:
    http://stackoverflow.com/questions/1...084808_1257760
    Don't be afraid to use a goto if that is the best option
    Most of the uses I read I like continue and nested break which tend to be an issue all the time for me personally.

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 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
  •