Code Style
Style == Success
What is code style?
Reasons for code styles:
// Good Style Example
class Robot {
public:
Robot() : speed(0), direction("North") {}
void setSpeed(int newSpeed) {
speed = newSpeed;
}
void setDirection(std::string newDirection) {
direction = newDirection;
}
int getSpeed() const {
return speed;
}
std::string getDirection() const {
return direction;
}
private:
int speed;
std::string direction;
};Rules of code standards:
Appendix: Professional Code Style-Guides
Teams Contributed to this Article:
Last updated
Was this helpful?
