We will analyse such code
class Apple {
int weight_;
public:
Apple(int weight); // possible conversion from int to Apple
};
void takeApple(Apple a);
int main() {
takeApple(150); // int converted implicitly into Apple
}
class SuperWarrior {
public:
SuperWarrior(int level, int strength, int dexterity)
: level_(level)
, strength_(strength)
, dexterity(dexterity) {
if (level_ >= 10) {
mana_ = 50;
}
}
private:
int level_ = 1;
int strength_ = 50;
int dexterity_ = 10;
int mana_ = 0;
};
Your abilities after Good programming practices – Coding Dojo training
- can recognize code smells
- know good and bad programming practices
- can propose improvements to existing code
- can refactor legacy code to more maintainable form
- understand a trade-off between the amount of work in refactoring (maintenance of existing code) and development of new features
Agenda
- Code Review in pairs
- Discussion on bad and good practices:
- clean code
- code naming conventions and code formatting
- KISS, DRY, YAGNI rules
- testable code
- unit-testing
- TDD technique (Test Driven Development)
- STUPID code rules
- SOLID rules for object-oriented code
- high cohesion, low coupling (GRASP rules)
- Coding Dojo
- recap
Activities
- pre-work to be done before our training
- pre-test pre-test at the beginning
- exercises followed by trainers implementation
- coding dojo
- participants solutions code review
- post-work with code review
- post-test one week after the training
- certificate of completion
Duration
- 1 day (8 hours with breaks)
Form
- online
- classroom