A
Amarendra GODBOLE
Hi,
I am working on a legacy user space app, which has been developed
entirely in C, some 15 years ago. Needless to say, it does not even
partially conform to any standard.
My team is in the process of adding new features to this app. As a
start off, I asked them to write clean code, which conforms to certain
aspects of the ANSI standard. I am no authority on the standard, and
my knowledge is based on C Unleashed.
For that I asked them to --
1. Avoid identifier names starting with _.
I asked them to change the following structure --
typedef struct _foo {
...
} Foo;
to
typedef struct foo_ {
...
} Foo;
2. Avoid clashes with the system namespace. To avoid id names
beginning with str, is, etc.
I thought by making them aware of such issues, we can probably write
code which is more clean, easy to maintain, and partly conforming to
ANSI.
But they fail to see my point of conformance and I am faced with
issues like --
1. How will we trample the system namespace with names like
_DBGetFooRecord etc.
2. Standards etc are junk and in no way we are to conform to that. We
are going to write code the way _we_ feel it.
My defense was all that I have learned from C Unleashed, but it is
proving to ve weak. I'd like you all from clc to help me make my
defense stronger, so that I can make them see some light !
I am not sure if this mail is OT or OT (On or Off), but nevertheless I
am posting it.
Cheers,
Amarendra
I am working on a legacy user space app, which has been developed
entirely in C, some 15 years ago. Needless to say, it does not even
partially conform to any standard.
My team is in the process of adding new features to this app. As a
start off, I asked them to write clean code, which conforms to certain
aspects of the ANSI standard. I am no authority on the standard, and
my knowledge is based on C Unleashed.
For that I asked them to --
1. Avoid identifier names starting with _.
I asked them to change the following structure --
typedef struct _foo {
...
} Foo;
to
typedef struct foo_ {
...
} Foo;
2. Avoid clashes with the system namespace. To avoid id names
beginning with str, is, etc.
I thought by making them aware of such issues, we can probably write
code which is more clean, easy to maintain, and partly conforming to
ANSI.
But they fail to see my point of conformance and I am faced with
issues like --
1. How will we trample the system namespace with names like
_DBGetFooRecord etc.
2. Standards etc are junk and in no way we are to conform to that. We
are going to write code the way _we_ feel it.
My defense was all that I have learned from C Unleashed, but it is
proving to ve weak. I'd like you all from clc to help me make my
defense stronger, so that I can make them see some light !
I am not sure if this mail is OT or OT (On or Off), but nevertheless I
am posting it.
Cheers,
Amarendra