Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Hello Ms. Stringfellow,
- I have noticed an unusual number of questions on StackOverflow.com embedding homework assignments that may encourage poor C++ style. Please consider adopting style such as
- http://www-bcf.usc.edu/~dkempe/CS104/coding-guide.pdf
- http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml
- http://stackoverflow.com/questions/2434213/links-to-official-style-guides
- In particular,
- #pragma once is nonstandard and may not scale well for build systems spread over a network.
- using namespace std; within a header exposes clients of the header to name collisions with the standard library, which is quite large and ever-expanding.
- Inclusion of an implementation file from an interface file obscures the structure of a program.
- If separate interface and implementation files are desired for a template, it is better to supply the user with both a foo_fwd.h forward-declaration and foo.hpp implementation file. The implementation would include its own forward declaration. (For example, <iostream> works like this.)
- A .cpp file should never be the subject of a #include.
- Thanks for your preference of C++ and taking the time to teach templates.
- Sorry if this message is in error, but you appear to be the one teaching the class in question.
- You might talk to your students about StackOverflow. The site does not discourage homework help, but it could run afoul of plagiarism policy or personal standards. You could request a tag for issues regarding your class at meta.stackoverflow.com; students could apply this to their questions to simplify the process of monitoring the discussion.
- - Best wishes,
- David
Advertisement
Add Comment
Please, Sign In to add comment