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.
Post Reply
blackrg
Member
Posts: 75
Joined: Mon Feb 12, 2007 1:31 pm
Location: Utah

Coding standards

#1

Post by blackrg »

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: 293
Joined: Sun Jan 21, 2007 1:59 am
Location: Orem, Utah, Utah, United States
Contact:

#2

Post by greenwoodkl »

Define "non-standard" placement ;)
blackrg
Member
Posts: 75
Joined: Mon Feb 12, 2007 1:31 pm
Location: Utah

#3

Post by blackrg »

I've always taken standard placement to be:

loop {
}

So "non-standard" would be anything else.
User avatar
mkmurray
Senior Member
Posts: 3266
Joined: Tue Jan 23, 2007 9:56 pm
Location: Utah
Contact:

#4

Post by mkmurray »

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: Utah

#5

Post by blackrg »

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

#6

Post by rickety »

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: 3266
Joined: Tue Jan 23, 2007 9:56 pm
Location: Utah
Contact:

Someday...

#7

Post by mkmurray »

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:Over ... ucture.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

#8

Post by JasonG-p40 »

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
Post Reply

Return to “General Discussions”