CS 3323 Topics in Programming Languages
C++ Programming Rules
C++ Programming Rules (slightly artificial, to promote using
the new facilities:)
- No C-style comments: Use // instead.
- No C I/O functions. Use C++ I/O,
including << and >> instead.
- Use the C preprocessor only for \#includes.
Use inline functions instead of macros, const variables
instead of \#define.
- No passing addresses just to get something out of a function.
Use reference parameters instead.
- Avoid structs. No use of extra struct
keyword in declarations.
- Always declare for loop variable inside the () of the
for statement.
- Always use prototypes with fully declared parameters.
- Never use malloc and associated functions. Use
new and delete instead.
Revision date: 1/19/99