C programming in 2011

K

Keith Thompson

Angel said:
Like I pointed out in another thread, it is the correct word in Dutch.
I'm not a native English speaker.

It does have that meaning in English too, but only in the context of
sheet music, it seems. I think "curly brace" is the correct term, no?

Anyway, I mean these things: {}

Understood.

I just checked on dictionary.com, and one of its sources shows "a rare
word for brace" as one of the lesser meanings. I had never heard of
that usage. (And I'm reasonably familiar with sheet music.)

Interesting stuff (though not quite topical). And your English is
certainly much better than my anything-other-than-English!
 
K

Keith Thompson

Geoff said:
[...]
Coding style is quite a personal thing, and I don't think there is a
real right or wrong in that. It was just something I came across while
browsing through the kernel documentation.

I like putting my accolades on separate lines so I can clearly see
where blocks begin and end, but others like to put their opening
accolade at the end of the if/while/for/function. Like I said earlier,
whatever works for you. :)

Are you sure that "accolade" is the word you're looking for?

Like I pointed out in another thread, it is the correct word in Dutch.
I'm not a native English speaker.

It does have that meaning in English too, but only in the context of
sheet music, it seems. I think "curly brace" is the correct term, no?

Anyway, I mean these things: {}

brackets: []
braces: {}

I thoroughly detest the words curly braces to describe braces.

The problem is that I've seen () referred to as brackets, and []
as braces. I think there are differences between US and UK usage.

The word "parentheses" is reasonably unambiguous as far as I know,
but I like to refer to "square brackets" and "curly braces" when
there's any chance of confusion. (Or, in writing, I just use the
characters themselves.)
 
P

Pierre Habouzit

Geoff said:
[...]
Coding style is quite a personal thing, and I don't think there is a
real right or wrong in that. It was just something I came across while
browsing through the kernel documentation.

I like putting my accolades on separate lines so I can clearly see
where blocks begin and end, but others like to put their opening
accolade at the end of the if/while/for/function. Like I said earlier,
whatever works for you. :)

Are you sure that "accolade" is the word you're looking for?

Like I pointed out in another thread, it is the correct word in Dutch.
I'm not a native English speaker.

It does have that meaning in English too, but only in the context of
sheet music, it seems. I think "curly brace" is the correct term, no?

Anyway, I mean these things: {}

brackets: []
braces: {}

I thoroughly detest the words curly braces to describe braces.

The problem is that I've seen () referred to as brackets, and []
as braces. I think there are differences between US and UK usage.

The word "parentheses" is reasonably unambiguous as far as I know,
but I like to refer to "square brackets" and "curly braces" when
there's any chance of confusion. (Or, in writing, I just use the
characters themselves.)

Let's use french!

() is parenthèses
[] is crochets
{} is accolades
<> is chevrons
 
N

Nizumzen

Geoff said:
[...]
Coding style is quite a personal thing, and I don't think there is a
real right or wrong in that. It was just something I came across while
browsing through the kernel documentation.

I like putting my accolades on separate lines so I can clearly see
where blocks begin and end, but others like to put their opening
accolade at the end of the if/while/for/function. Like I said earlier,
whatever works for you. :)

Are you sure that "accolade" is the word you're looking for?

Like I pointed out in another thread, it is the correct word in Dutch.
I'm not a native English speaker.

It does have that meaning in English too, but only in the context of
sheet music, it seems. I think "curly brace" is the correct term, no?

Anyway, I mean these things: {}

brackets: []
braces: {}

I thoroughly detest the words curly braces to describe braces.

The problem is that I've seen () referred to as brackets, and []
as braces. I think there are differences between US and UK usage.

Correct. In England we refer to () as brackets and [] as square brackets.
 
K

Keith Thompson

Nizumzen said:
On 2011-05-29 02:49:23 +0100, Keith Thompson said: [...]
The problem is that I've seen () referred to as brackets, and []
as braces. I think there are differences between US and UK usage.

Correct. In England we refer to () as brackets and [] as square brackets.

Do you not use the word parentheses? If someone else refers to
parentheses, do they unambiguously refer to ()?

And what do you call {}?
 
S

Shao Miller

Nizumzen said:
On 2011-05-29 02:49:23 +0100, Keith Thompson said: [...]
The problem is that I've seen () referred to as brackets, and []
as braces. I think there are differences between US and UK usage.

Correct. In England we refer to () as brackets and [] as square brackets.

Do you not use the word parentheses? If someone else refers to
parentheses, do they unambiguously refer to ()?

When I was a young student of various public education institutes, we
learned "BEDMAS" or sometimes "BEMDAS". See here[1].

As a native speaker of English, I understand both terms can be used to
mean '(' and ')'. Almost everyone I know uses "brackets" for these, but
these same people would understand "parentheses" just as well. I use
"brackets" more in speech and "parentheses" more in online discussion.

FWIW. :)

[1] http://en.wikipedia.org/wiki/Order_of_operations
 
N

Nizumzen

Nizumzen said:
On 2011-05-29 02:49:23 +0100, Keith Thompson said: [...]
The problem is that I've seen () referred to as brackets, and []
as braces. I think there are differences between US and UK usage.

Correct. In England we refer to () as brackets and [] as square brackets.

Do you not use the word parentheses? If someone else refers to
parentheses, do they unambiguously refer to ()?

And what do you call {}?

I very rarely hear anyone outside of the programming community refer to
them as parentheses. Some do I am sure but round where I am everyone
calls them brackets in general day to day conversation.

Yes, parentheses means () to me. But maybe that is just because I am
used to the programming lingo? I have no idea what someone with no
programming experience would think.

As for {} we call them curly brackets unsurprisingly :).
 
J

J. J. Farrell

Keith said:
Nizumzen said:
On 2011-05-29 02:49:23 +0100, Keith Thompson said: [...]
The problem is that I've seen () referred to as brackets, and []
as braces. I think there are differences between US and UK usage.
Correct. In England we refer to () as brackets and [] as square brackets.

Do you not use the word parentheses?

Not commonly; it's widely understood and thought of as "a fancy word for
brackets".
If someone else refers to
parentheses, do they unambiguously refer to ()?

Yes. Except perhaps in a literary context where "in parentheses" could
be used to refer to "a parenthetical phrase" or "parenthesis" which
could actually be delimited by commas.
And what do you call {}?

Personally, "curly brackets" or "braces". I've been programming too long
in multinational contexts to remember for sure what they're normally
called in Britain; if indeed they're "normally" called anything, since
they're rarely seen outside programming.
 
P

Phil Carmody

Angel said:
Coding style is quite a personal thing, and I don't think there is a
real right or wrong in that. It was just something I came across while
browsing through the kernel documentation.

Then you should have encountered Documentation/CodingStyle and realised
that it's not a personal thing, it's a Linus thing, and anyone who does
different is wrong. And quite probably stupid too, knowing Linus.
I like putting my accolades on separate lines so I can clearly see
where blocks begin and end, but others like to put their opening
accolade at the end of the if/while/for/function. Like I said earlier,
whatever works for you. :)

Were I to code using my prefered coding style, as one of the gatekeepers
of our company kernel, I'd then have to reject all my patches and ask
myself to do them again. So no, when it comes to linux kernel programming,
it's whatever works for upstream that matters.

Phil
 
P

Phil Carmody

Keith Thompson said:
Nizumzen said:
On 2011-05-29 02:49:23 +0100, Keith Thompson said: [...]
The problem is that I've seen () referred to as brackets, and []
as braces. I think there are differences between US and UK usage.

Correct. In England we refer to () as brackets and [] as square brackets.

Do you not use the word parentheses? If someone else refers to

They all brace, and therefore they're all brackets.
parentheses, do they unambiguously refer to ()?

Parentheses shouldn't be unambiguous. Parenthesis is a description of
the *meaning* of the pair of symbols, namely marking something as
parenthetical. In C, the parenthetical markup is traditionally /* this
one */. Editorial parenthetical markup is usually [this one]. It's
generally only prose that uses (this form).
And what do you call {}?

Curly {brackets,braces}, but mostly the former (see my first paragraph
above). The latter only by those who discuss code with Americans a lot.

Phil
 
A

Angel

Then you should have encountered Documentation/CodingStyle and realised
that it's not a personal thing, it's a Linus thing, and anyone who does
different is wrong. And quite probably stupid too, knowing Linus.

I've never personally dealt with Linus, but I've read the stories, and
seen the flamewars on LKML. The only "famous" Linux people I've had
personal encounters with (Andrew Morton and David Miller, while analyzing
and solving a bug I had reported) were much more relaxed, IMHO anyway.
Were I to code using my prefered coding style, as one of the gatekeepers
of our company kernel, I'd then have to reject all my patches and ask
myself to do them again. So no, when it comes to linux kernel programming,
it's whatever works for upstream that matters.

As long as it's readable, not too confusing and does what it should do,
it doesn't really matter where exactly that curly brace is, right?
 
P

Phil Carmody

Keith Thompson said:
Angel said:
[...]
Coding style is quite a personal thing, and I don't think there is a
real right or wrong in that. It was just something I came across while
browsing through the kernel documentation.

I like putting my accolades on separate lines so I can clearly see
where blocks begin and end, but others like to put their opening
accolade at the end of the if/while/for/function. Like I said earlier,
whatever works for you. :)

Are you sure that "accolade" is the word you're looking for?

Like I pointed out in another thread, it is the correct word in Dutch.
I'm not a native English speaker.

It does have that meaning in English too, but only in the context of
sheet music, it seems. I think "curly brace" is the correct term, no?

Anyway, I mean these things: {}

Understood.

I just checked on dictionary.com, and one of its sources shows "a rare
word for brace" as one of the lesser meanings.

http://dictionary.reference.com/browse/accolade is enlightening (if you like
etymologies and historical meanings):

1. any award, honor, or laudatory notice: The play received accolades from the press.
2. a light touch on the shoulder with the flat side of the sword or formerly by an embrace, done in the ceremony of conferring knighthood.
3. the ceremony itself.
4. Music. a brace joining several staves.
5. Architecture.
a. an archivolt or hood molding having more or less the form of an ogee arch.
b. a decoration having more or less the form of an ogee arch, cut into a lintel or flat arch.

Origin:
1615-25; < French, derivative of a(c)col\'ee embrace (with -ade [-ade#1]), noun use of feminine past participle of a(c)coler, Old French verbal derivative of col neck (see collar) with a- [a-#5]

So it all makes perfect sense if you can join a few dots.
I had never heard of
that usage. (And I'm reasonably familiar with sheet music.)

Interesting stuff (though not quite topical). And your English is
certainly much better than my anything-other-than-English!

Ditto.

Phil
 
C

Chris H

Nizumzen said:
Nizumzen said:
On 2011-05-29 02:49:23 +0100, Keith Thompson said: [...]
The problem is that I've seen () referred to as brackets, and []
as braces. I think there are differences between US and UK usage.
Correct. In England we refer to () as brackets and [] as square
brackets.
Do you not use the word parentheses? If someone else refers to
parentheses, do they unambiguously refer to ()?
And what do you call {}?

I very rarely hear anyone outside of the programming community refer to
them as parentheses. Some do I am sure but round where I am everyone
calls them brackets in general day to day conversation.

A lot of people (but few now than in the past) call () Parenthesis in
normal speech.
Yes, parentheses means () to me. But maybe that is just because I am
used to the programming lingo? I have no idea what someone with no
programming experience would think.

The same.
 
M

Morris Keesan

Nizumzen said:
On 2011-05-29 02:49:23 +0100, Keith Thompson said: [...]
The problem is that I've seen () referred to as brackets, and []
as braces. I think there are differences between US and UK usage.

Correct. In England we refer to () as brackets and [] as square
brackets.

Do you not use the word parentheses? If someone else refers to
parentheses, do they unambiguously refer to ()?

When I was a young student of various public education institutes, we
learned "BEDMAS" or sometimes "BEMDAS". See here[1].

As a native speaker of English, I understand both terms can be used to
mean '(' and ')'. Almost everyone I know uses "brackets" for these, but
these same people would understand "parentheses" just as well. I use
"brackets" more in speech and "parentheses" more in online discussion.

A few years ago, I was using an Artificial Intelligence textbook which
was written, and originally published, in England, and had been
republished in the US. In the course of preparing the book for US
publication, someone saw, in the chapter on LISP, the word "brackets",
and changed all of the related instances of () into [].
 
N

Nizumzen

Nizumzen said:
On 2011-05-29 02:49:23 +0100, Keith Thompson said:
[...]
The problem is that I've seen () referred to as brackets, and []
as braces. I think there are differences between US and UK usage.
Correct. In England we refer to () as brackets and [] as square
brackets.
Do you not use the word parentheses? If someone else refers to
parentheses, do they unambiguously refer to ()?
And what do you call {}?

I very rarely hear anyone outside of the programming community refer to
them as parentheses. Some do I am sure but round where I am everyone
calls them brackets in general day to day conversation.

A lot of people (but few now than in the past) call () Parenthesis in
normal speech.
Yes, parentheses means () to me. But maybe that is just because I am
used to the programming lingo? I have no idea what someone with no
programming experience would think.

The same.

Well, your experience may vary, but round here its brackets for everything.
 
S

Shao Miller

On 2011-05-29 02:49:23 +0100, Keith Thompson said:
[...]
The problem is that I've seen () referred to as brackets, and []
as braces. I think there are differences between US and UK usage.

Correct. In England we refer to () as brackets and [] as square
brackets.

Do you not use the word parentheses? If someone else refers to
parentheses, do they unambiguously refer to ()?

When I was a young student of various public education institutes, we
learned "BEDMAS" or sometimes "BEMDAS". See here[1].

As a native speaker of English, I understand both terms can be used to
mean '(' and ')'. Almost everyone I know uses "brackets" for these,
but these same people would understand "parentheses" just as well. I
use "brackets" more in speech and "parentheses" more in online
discussion.

A few years ago, I was using an Artificial Intelligence textbook which
was written, and originally published, in England, and had been
republished in the US. In the course of preparing the book for US
publication, someone saw, in the chapter on LISP, the word "brackets",
and changed all of the related instances of () into [].
D'oh; yikes. Perhaps it was an AI that noted this and performed the
change? :)
 
S

Sjouke Burry

Chris said:
Nizumzen said:
On 2011-05-29 02:49:23 +0100, Keith Thompson said:
[...]
The problem is that I've seen () referred to as brackets, and []
as braces. I think there are differences between US and UK usage.
Correct. In England we refer to () as brackets and [] as square
brackets.
Do you not use the word parentheses? If someone else refers to
parentheses, do they unambiguously refer to ()?
And what do you call {}?
I very rarely hear anyone outside of the programming community refer to
them as parentheses. Some do I am sure but round where I am everyone
calls them brackets in general day to day conversation.

A lot of people (but few now than in the past) call () Parenthesis in
normal speech.
Yes, parentheses means () to me. But maybe that is just because I am
used to the programming lingo? I have no idea what someone with no
programming experience would think.

The same.
() haakjes
{} accoladen
[] blokhaken
 
N

Nobody

As long as it's readable, not too confusing and does what it should do,
it doesn't really matter where exactly that curly brace is, right?

Wrong.

On any large project, it's important that there's a single formatting
style used throughout the project. Otherwise, the next time that
someone edits the code using the correct style, you end up with noise in
the diffs which can make it hard to discern the substantive changes from
the formatting corrections.

Also, rigid adherence to a coding convention helps weed out people who
aren't team players at an early stage.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,099
Messages
2,570,626
Members
47,237
Latest member
David123

Latest Threads

Top