Back to front pageView on Hacker News (opens in a new tab)Show HN: I wrote my own RTS game engine in C (opens in a new tab)github.com1102 pointsby epermyakov (on Hacker News)5 years agogithub.com (opens in a new tab)GitHub - eduard-permyakov/permafrost-engine: An OpenGL RTS game engine written in CAn OpenGL RTS game engine written in C. Contribute to eduard-permyakov/permafrost-engine development by creating an account on GitHub.Comments (262) 55 threadsShow all commentsShowing thread 38 of 55[-]djoldman5 years ago3 replies#Quick question: all the goto fail's where fail: return false; This is just to perhaps change return false to something else in the future, correct? Else why not just return false everywhere instead of goto failnamdnay5 years ago#I think it’s to cleanly show when he is using his pseudo-exception handling system. So goto fail would be “throw”alksjdalkj5 years ago#Not sure if this is the author's reason but I find it helpful to have a single return point from functions. Much easier to follow code paths.You'll see this in some places in Linux's source too.slim5 years ago#Not op, but that's obviously in case you need to do something more complicated than returning false later. It's good practice
Show HN: I wrote my own RTS game engine in C (opens in a new tab)github.com1102 pointsby epermyakov (on Hacker News)5 years ago
djoldman5 years ago3 replies#Quick question: all the goto fail's where fail: return false; This is just to perhaps change return false to something else in the future, correct? Else why not just return false everywhere instead of goto fail
namdnay5 years ago#I think it’s to cleanly show when he is using his pseudo-exception handling system. So goto fail would be “throw”
alksjdalkj5 years ago#Not sure if this is the author's reason but I find it helpful to have a single return point from functions. Much easier to follow code paths.You'll see this in some places in Linux's source too.
slim5 years ago#Not op, but that's obviously in case you need to do something more complicated than returning false later. It's good practice
Comments (262) 55 threads
Show all comments
Showing thread 38 of 55
You'll see this in some places in Linux's source too.