13.11.2012, 08:24
After seeing this: https://sampforum.blast.hk/showthread.php?tid=392181
A trick I always use so I never forget brackets anywhere. Immediately write the corresponding bracket before you start coding the statements. Maybe a stupid trick but it saves me a lot of time trying to find missing brackets when code gets rather big.
Bad example:
See what I'm getting at? When you finish your code you may forget to put an ending bracket (stupid example here since it's only 2 of them--but you get the point).
Good example:
Obviously, proper IDE's do this for you. Also, tabulate!
A trick I always use so I never forget brackets anywhere. Immediately write the corresponding bracket before you start coding the statements. Maybe a stupid trick but it saves me a lot of time trying to find missing brackets when code gets rather big.
Bad example:
pawn Код:
stock something() {
// I'll write some code here first
// Then I'll do some more stuff
// Now I need an if statement possible
if(someVariable == true) {
// Now I write some code here
Good example:
pawn Код:
stock something() {
// I write NOTHING here yet, I first write the ending bracket
}
// Only NOW I can continue writing code in the function