Curly braces
-
I'm in the correct camp:
void AFunc()
{
}"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
Indented braces ?
Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
-
Indented braces ?
Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
Yep. It's called "Whitesmiths": Indentation style - Wikipedia[^] It's more consistent than Allman.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
-
Are you in this camp
void AFunc(){
}or this one
void AFunc()
{
}I'm in the second
Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
-
Are you in this camp
void AFunc(){
}or this one
void AFunc()
{
}I'm in the second
Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
I distinctly remember a similar post on this site about 12 years ago. The replies were all the same then as they are today. :laugh:
-
Are you in this camp
void AFunc(){
}or this one
void AFunc()
{
}I'm in the second
Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
The later, is easier for me to follow.
PartsBin an Electronics Part Organizer - An updated version available! JaxCoder.com
-
Are you in this camp
void AFunc(){
}or this one
void AFunc()
{
}I'm in the second
Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
-
Richard MacCutchan wrote:
Who needs braces: Python
FTFY! :laugh:
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
-
Are you in this camp
void AFunc(){
}or this one
void AFunc()
{
}I'm in the second
Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
Second.
-
Are you in this camp
void AFunc(){
}or this one
void AFunc()
{
}I'm in the second
Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
Come on!! What's next? Tabs vs spaces?
Mircea
-
Are you in this camp
void AFunc(){
}or this one
void AFunc()
{
}I'm in the second
Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
I reject the premise of the question.
-
same. in C++ i do the latter. In C# I do the former.
To err is human. Fortune favors the monsters.
-
Are you in this camp
void AFunc(){
}or this one
void AFunc()
{
}I'm in the second
Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
I prefer the first one in javascript/typescript and the second one in C#.
___ ___ ___
|__ |_| |\ | | |_| \ /
__| | | | \| |__| | | / -
Are you in this camp
void AFunc(){
}or this one
void AFunc()
{
}I'm in the second
Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
The first one wasn't invented for clarity or ease of reading, but for squeezing more text onto paper.
Wrong is evil and must be defeated. - Jeff Ello
-
Yep. It's called "Whitesmiths": Indentation style - Wikipedia[^] It's more consistent than Allman.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
That would depend on whether you consider the braces to be a part of the content or the header. If your answer is neither you should consider GNU style. ;P
Wrong is evil and must be defeated. - Jeff Ello
-
Are you in this camp
void AFunc(){
}or this one
void AFunc()
{
}I'm in the second
Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
I used to be in the first camp, I had to adapt to MISRA rules and now I prefer the second. It's way easier to find missing braces, move braced code and reindent it, even with powerful syntax highlighting - which is not a given in most IDEs for embedded development.
GCS/GE d--(d) s-/+ a C+++ U+++ P-- L+@ E-- W+++ N+ o+ K- w+++ O? M-- V? PS+ PE Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++* Weapons extension: ma- k++ F+2 X
-
I have no opinion about braces one way or the other but I have to ask - Why use different styles in different languages? Given it's a choice it seems your personal sense of style would prefer one style all the time. No?
-
Come on!! What's next? Tabs vs spaces?
Mircea
A POX upon Tabs.
I’ve given up trying to be calm. However, I am open to feeling slightly less agitated.
-
Are you in this camp
void AFunc(){
}or this one
void AFunc()
{
}I'm in the second
Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
I'm in this camp
void AFunc()
{
}And for short/inline statements in this one:
void AFunc() {}
I never mix them.
There is only one Vera Farmiga and Salma Hayek is her prophet! Advertise here – minimum three posts per day are guaranteed.
-
I used to be in the first camp, I had to adapt to MISRA rules and now I prefer the second. It's way easier to find missing braces, move braced code and reindent it, even with powerful syntax highlighting - which is not a given in most IDEs for embedded development.
GCS/GE d--(d) s-/+ a C+++ U+++ P-- L+@ E-- W+++ N+ o+ K- w+++ O? M-- V? PS+ PE Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++* Weapons extension: ma- k++ F+2 X
exactly.
M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.