Рет қаралды 4,107
Read the full article: tobeva.com/beyond
In some circles online, “clean code” has become a euphemism for “bad code.” People say that clean code contains piles of useless abstractions, is overengineered, obscures the flow of control with tiny methods and classes that each do very little, and leads to horrible performance.
Robert Martin, aka Uncle Bob, wrote his book "Clean Code" in 2008. It contains OOP advice because the book describes how his consulting company wrote OOP at the time, generally in Java. His book was never meant to be the last word on developing software. It's just him documenting the approach they used at the time, in the 1990s and 2000s.
OOP can indeed have too much overhead to be used in tight inner loops; however, in the broader world of software, only a fraction of code needs to be heavily optimized. Most real systems contain a blend of styles and degrees of optimization, and this is a good thing.
0:00 - Introduction
0:25 - The Clean Code Book
1:20 - Definition of Clean Code
2:16 - Thought-terminating Cliché
2:37 - Casey Muratori
3:17 - The Code
5:54 - Memory Layout
7:45 - Virtual Functions
8:25 - OOP Advantages
9:48 - Casey's Conclusion
10:02 - Casey is Right
11:10 - Casey is Wrong
12:27 - The Chainsaw Analogy
14:49 - Beyond Clean Code
16:23 - Game Engines and Game Code
18:06 - Python
20:16 - Function Programming
21:15 - Fred Brooks and Physical Bits