# # # patch "HACKING" # from [c7f70f0b3353a12bcf84a27f491e9caca5499c5f] # to [3b3670fe4fe7277502d9eb8e5e8c06719b4495a7] # ============================================================ --- HACKING c7f70f0b3353a12bcf84a27f491e9caca5499c5f +++ HACKING 3b3670fe4fe7277502d9eb8e5e8c06719b4495a7 @@ -95,11 +95,30 @@ continued to adhere to the dialect we wr - generally avoid anything which can generate a SEGV, as it's an uninformative error. prefer errors which say what went wrong. - - for importing symbols in other namespaces add a "using std::foo" - for each foo used in the file and then strip "std::" from the uses. - do not use "using namespace std" anywhere. + - do not use "using namespace " anywhere. especially do not + use "using namespace std". + - in .cc files, it is preferred to put "using std::foo" at the top + for each foo used in the file rather than put "std::" in front of + all the uses. this is also the preferred style for symbols from + other namespaces when they are used frequently. + - do not put any "using" declarations in .hh files; use the fully + qualified name everywhere necessary. + + - .hh files should include everything that is necessary to parse all + of their declarations, but strenuous efforts should be made to + keep the number of nested includes to a minimum. wherever + possible, use forward declarations (struct foo;) and similar + techniques. + + - deserves special mention. including this file causes + the compiler to emit static constructors to ensure that the + standard streams are initialized before their first use. + therefore, do not include unless you actually refer to + one of the standard streams (cin, cout, cerr, clog). use , + , , , etc instead, as appropriate. + Test suites, and writing test cases ----------------------------------