, you'd put your commas where normal human beings put them
. Instead of in a silly place like that
. Prefering structure over normal communication is not
, typically
, seen as a good thing
.
, you'd put your commas where normal human beings put them
. Instead of in a silly place like that
. Prefering structure over normal communication is not
, typically
, seen as a good thing
.
Programming is not prose, so we can temper our expectations. *
Even in prose, some symbols belong on the left, and some belong on the right. *
The example given is no less readable than the alternative. *
It's more important to be consistent in style than correct to one person's opinion e.g. some people still batch edit source via macros and appreciate when curly braces are not in unexpected places.
it just removes a lot of hassle when you are used to it, I'd never go back to trailing commas
This might be fixed in various languages/parsers by allowing a trailing comma (e.g. python).
At the end of the day, clang-tidy, black, gofmt, rustfmt all the things and let's never talk about comma placement again.
std::conditional<
some_property<
T,
U,
>,
int,
float,
>;
is a compile error, I really prefer std::conditional<
some_property<
T
, U
>
, int
, float
>; $ cat test.cc
enum Foo {
FOO,
BAR,
};
int main(int argc, char** argv) { return 0; }
$ g++ -std=c++98 -Wpedantic test.cc
test.cc:3:5: warning: comma at end of enumerator list [-Wpedantic]
3 | BAR,
|
$ g++ -std=c++03 -Wpedantic test.cc
test.cc:3:5: warning: comma at end of enumerator list [-Wpedantic]
3 | BAR,
| ^
$ g++ -std=c++11 -Wpedantic test.cc