Please enable JavaScript.
Coggle requires JavaScript to display documents.
The Art of Readable Code - Coggle Diagram
The Art of Readable Code
-
The fundamental Theorem of Readability - Code should be written to minimize the time it would taken for someone else to understand it
-
Reorganizing your code
-
One task at a time
- List out all the "tasks" your code is doing
- Try to separate those tasks as much as possible you can into different functions or at least different sections of the code
:check: Breaking a large function into multiple smaller functions can be good, but even if you don't do this, you can still organize the code inside a large function so it feels like there are separated logical sections
-
-
Testing and readability
Make tests more readable
-
-
:point_right::skin-tone-4: Hide less important details from the user, so that more important details are most prominent
-
-
-
:red_flag: "Test" is any code whose sole purpose is to check the behavior of another ("real") piece of code