Frederick Gotham said:
Keith Thompson posted:
I like my style though.
Ok. What about anyone else who reads your code?
You can, of course, write anything you like, either in your C code or
on this newsgroup. But if you expect anyone else to read it, or
particularly to maintain it, you would benefit greatly from following
certain conventions that will make what you write easier to read.
Unless you manage to mount a *successful* campaign to change the
generally accepted style, you're just "creating beautiful new
impediments to understanding".
There's plenty of things I do which most C++ programmers don't do. For
instance, I use "++i" instead of "i++" when I discard the value of the
expression.
Most of us here do something most C++ programmer's don't do: we write C.
++i and i++ are equivalent when the value is discarded, and I find
them equally clear. (comp.lang.c++ is down the hall, past the water
cooler, third door on the left.)
There are flaws in the way most programmers do things; my style tries to
improve on this.
char unsigned const static inline (*const Func(void))[3]
Anyone seeing that almost certainly going to spend far more time
wondering why the keywords are in that order and mentally translating
it to a more traditional order than appreciating the esthetics.
If they're only used to reading their own code, then they could do with the
practise of seeing other people's code. Do they brain-freeze when they see:
int const *p
rather than:
const int *p
No, that's straightforward enough that my brain doesn't even get
chilly.
How do you feel about this?
char const inline static unsigned (*const Func(void))[3]
Don't you think there's some advantage in having all the keywords in
alphabetical order?
![Cool :cool: :cool:](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
}
I make up the rules as I go along.
[snip]
And that's the problem. If programming is a solitary activity for
you, that's fine. If not, I think you're making a mistake.