@hatcat01
Abstraction by the rule of 10
Guy Davidson Meeting C++ 15/11/2019
1
Abstraction by the rule of 10 Guy Davidson Meeting C++ 15/11/2019 - - PowerPoint PPT Presentation
Abstraction by the rule of 10 Guy Davidson Meeting C++ 15/11/2019 @hatcat01 1 Good evening Guy @hatcat01 2 How many dots on this slide? @hatcat01 3 How many dots on this slide? @hatcat01 4 How many dots on this slide? @hatcat01 5
@hatcat01
Guy Davidson Meeting C++ 15/11/2019
1
@hatcat01
2
@hatcat01
3
@hatcat01
4
@hatcat01
5
@hatcat01
Limit of about 10
6
@hatcat01
Limit of about 10 More is too big to swallow in one gulp
7
@hatcat01
Limit of about 10 More is too big to swallow in one gulp Smaller load => less friction
8
@hatcat01
9
@hatcat01
Memory => identifiers
10
@hatcat01
Memory => identifiers Memory => identifiers
11
@hatcat01
12
@hatcat01
void bezier_animation::render(unmanaged_output_surface& uos) { }
13
@hatcat01
void bezier_animation::render_a_curve (unmanaged_output_surface& uos, curve& c) {...} void bezier_animation::render_all_the_curves (unmanaged_output_surface& uos) {...}
14
@hatcat01
class curves { public: void render(unmanaged_output_surface&) const; void add_curve(p_2d begin, p_2d control, p_2d end); private: std::vector<curve> the_curves; unmanaged_output_surface surface; };
15
@hatcat01
16
@hatcat01
17
@hatcat01
18
@hatcat01
19
@hatcat01
20
@hatcat01
21
@hatcat01
22
The lines!!!
@hatcat01
23
The lines!!! The many-angled ones!!!
@hatcat01
24
The lines!!! The many-angled ones!!! They are rising!!!
@hatcat01
25
The lines!!! The many-angled ones!!! They are rising!!!
Obey Cthulhu!!!
@hatcat01
26
@hatcat01
Identifying is easy
27
@hatcat01
Identifying is easy Naming is hard
28
@hatcat01
Identifying is easy Naming is hard Name it or suffer
29
@hatcat01
Object
30
@hatcat01
Object Function
31
@hatcat01
Object Function Class
32
@hatcat01
Object Function Class Namespace
33
@hatcat01
34
@hatcat01
35
@hatcat01
// speech.cppm export module speech; export const char* get_phrase() { return "Hello, world!"; } // main.cpp import speech; import <iostream>; int main() { std::cout << get_phrase() << '\n'; }
36
@hatcat01
37
@hatcat01
38
@hatcat01
Abstraction resolution
39
@hatcat01
Abstraction resolution Start thinking at ten
40
@hatcat01
Abstraction resolution Start thinking at ten Divide
41
@hatcat01
Abstraction resolution Start thinking at ten Divide Gather
42
@hatcat01
Abstraction resolution Start thinking at ten Divide Gather Abstraction by the rule of ten
43