Coding standards

Some discussions just don't fit into a well defined box. Use this forum to discuss general topics and issues revolving around the Church and the technology offerings we use and share.
BlackRG
Member
Posts: 75
Joined: Mon Feb 12, 2007 1:31 pm
Location: Orem, UT, USA
Contact:

Coding standards

Postby BlackRG » Mon Mar 05, 2007 10:24 am

Reading Joel Dehlin's recent blog entry on Interviewing, one of his comments in passing caught my attention:

"So they use a different editor than you do, or they put their curly braces in the wrong place–so what?"

Out of curiosity, how many of you out there use "non standard" placement for your curly braces? I'm curious how common this might be or if it's a rare thing.

User avatar
greenwoodkl
Member
Posts: 242
Joined: Sun Jan 21, 2007 1:59 am
Location: Orem, Utah, United States
Contact:

Postby greenwoodkl » Mon Mar 05, 2007 10:25 am

Define "non-standard" placement ;)

BlackRG
Member
Posts: 75
Joined: Mon Feb 12, 2007 1:31 pm
Location: Orem, UT, USA
Contact:

Postby BlackRG » Mon Mar 05, 2007 10:40 am

I've always taken standard placement to be:

loop {
}

So "non-standard" would be anything else.

User avatar
mkmurray
Senior Member
Posts: 3241
Joined: Tue Jan 23, 2007 9:56 pm
Location: Utah
Contact:

Postby mkmurray » Mon Mar 05, 2007 12:56 pm

I've always preferred the curly braces to line up...

method()
{
...
}

...but I don't know how common it is. I'm guessing not.

BlackRG
Member
Posts: 75
Joined: Mon Feb 12, 2007 1:31 pm
Location: Orem, UT, USA
Contact:

Postby BlackRG » Mon Mar 05, 2007 1:11 pm

Actually, I prefer they line up too, and had thought it was both uncommon and also often taboo in any sort of a "professional" setting, hence why I'm asking :P

When I'm coding for myself, I line them up, when I'm coding as part of a team where someone else may actually need to look at my code, I've gone with the "standard" placement. I prefer lining them up because I find the code easier to read and to debug.

Only a few times in my life have I found myself working in what I would consider a professional coding environment, and haven't had a lot of exposure as a result. Anyone else lining their braces up? Anyone doing it in a "professional" environment? Anyone care to comment on how much variation in coding "style" has been allowed in professional group projects they've worked on (free open source working being included here)?

rickety
New Member
Posts: 14
Joined: Fri Jan 19, 2007 11:01 am
Location: Kaysville, Utah

Postby rickety » Mon Mar 05, 2007 1:27 pm

For the last 15 years I have lined them up. Other members of the team do not. It has not been an issue.

User avatar
mkmurray
Senior Member
Posts: 3241
Joined: Tue Jan 23, 2007 9:56 pm
Location: Utah
Contact:

Someday...

Postby mkmurray » Mon Mar 05, 2007 3:23 pm

Our Systems Architect on our team here has this idea that he'll never get around to implementing. :rolleyes:

We code in Visual Studio, which does have some decent automatic code formatting abilites. However, developers having different coding styles can sometimes be a problem with source control. His idea is to develop a system where only the IL code (Intermediate Language, see http://en.wikipedia.org/wiki/Image:Overview_of_the_Common_Language_Infrastructure.png) is checked into source code. Then when you retrieve the latest code, the code is formatted according to your preference profile.

Great idea, he's too busy doing the real work at our company to ever implement it...

JasonG-p40
Member
Posts: 68
Joined: Thu Jan 25, 2007 5:21 pm
Location: Pampa, Tx

Postby JasonG-p40 » Mon Mar 05, 2007 4:59 pm

mkmurray wrote:
method()
{
...
}


That's how I've always done it.

I've seen a number of ways used as the "standard", but this is the one that I prefer myself.
Jason D. Griffith
Pampa Ward, Amarillo Stake (Texas)
Community Guidelines


Return to “General Discussions”

Who is online

Users browsing this forum: rpokoina and 1 guest