Do you pre-bracket?
#1

No idea what else to call it.

Does anyone else write the brackets first then fill them in? Like so:

pawn Code:
public SomeFunc()
{
    for()
    {
        if()
        {
        }
    }
}
Then write the code between them? I ALWAYS do this, and I don't think I've EVER missed a bracket.
Reply
#2

Quote:
Originally Posted by MP2
View Post
No idea what else to call it.

Does anyone else write the brackets first then fill them in? Like so:

pawn Code:
public SomeFunc()
{
    for()
    {
        if()
        {
        }
    }
}
Then write the code between them? I ALWAYS do this, and I don't think I've EVER missed a bracket.
Using Sublime, so I can follow my brackets if I'd miss one. But yeah I usually do that too.(I only can suggest Sublime, it's "free")
Reply
#3

Sometimes. When it gets messy or when it's a long boring repeating code.
Reply
#4

I usually just do this;
pawn Code:
public Moo() {
    if(CowMoos == true) {
        Cow = 1;
    }
    return 1;
}
Reply
#5

Quote:
Originally Posted by Luis-
View Post
I usually just do this;
pawn Code:
public Moo() {
    if(CowMoos == true) {
        Cow = 1;
    }
    return 1;
}
I fucking hate that indentation style. It makes your code really messy and unreadable.. I much prefer having my brackets aligned.
Reply
#6

Quote:
Originally Posted by MP2
View Post
I fucking hate that indentation style. It makes your code really messy and unreadable.. I much prefer having my brackets aligned.
That's K&R style, and yes I also like to use Allman Style.
EDIT:
This is somewhat useful.
http://forum.sa-mp.com/showthread.ph...beautiful+read
Reply
#7

Most of the time, yes

I use K&R style most of the time.. I put spaces between the previous statement so it is readable

pawn Code:
if(condition) {

    //do this shizzel
    DoShizzel();
}
Reply
#8

Quote:
Originally Posted by MP2
View Post
I fucking hate that indentation style. It makes your code really messy and unreadable.. I much prefer having my brackets aligned.
I believe there's actually proper etiquette for these languages. Entirely unsure though.

When I'm using Visual Studio to code in winJS (Java Script for Windows, Windows 8 apps) it automatically corrects my brackets to Luis' method.

pawn Code:
public Moo() {
    if(CowMoos == true) {
        Cow = 1;
    }
    return 1;
}
When I'm coding in C#, it automatically corrects my brackets to your method.

pawn Code:
public Moo()
{
    if(CowMoos == true)
    {
        Cow = 1;
    }
    return 1;
}
Reply
#9

Quote:
Originally Posted by MP2
View Post
I fucking hate that indentation style. It makes your code really messy and unreadable.. I much prefer having my brackets aligned.
People are different, I feel it makes my codes a lot smaller.
Reply
#10

Quote:
Originally Posted by Luis-
View Post
People are different, I feel it makes my codes a lot smaller.
I used to do it in Java but then I got used to the new method and it worked out a lot better for me. The brackets are aligned now and Sublime Text draws a vertical line down to the matching bracket which really helps even though I never miss a bracket since I pre-bracket.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)