Code review comment for lp:~p12/kicad/remove-uses-namespace-std

Revision history for this message
Dick Hollenbeck (dickelbeck) wrote :

I wish we had added this text to the coding standards:

**************************

  The project should never use 'using namespace ...' in a header file, but using
  it in a *.cpp file is OK, according to the author of the *.cpp file's preference.
  If it occurs in a *.cpp file, it must occur after any #include statements.

**************************

The consequences of that make it impossible not to use std:: for all STL objects which
present themselves in a header file. This is the public API.

The above policy also gives the implementation author the freedom of brevity in a file which is not affecting usage of the API in (client callaing) *.cpp files.

I personally have followed this policy in everything I've contributed, never once put a "using namespace" into a header file. I was not aware that we had strayed from this common sense approach.

So I only like about 25% of this patch, because for my *.cpp files, I really don't care to see them be changed in a way other than I wrote them for something other than a bug. Of course, this is an understatement.

It is general, not limited to me. It is respectful of the original author's wishes, the person who we often call upon to *support* the code when something goes wrong.

« Back to merge proposal