Top-down structure of code
Simple reminder on how to structure code
Top-down structure of code
Write code in such a way that the part you want to quickly reference is at the top of the file.
For example, the main()
function may depend on func1()
and func2()
, but that doesn’t mean that the main()
function has to be at the bottom of the code.
1 | def main(): |
Structuring this way is better because now the functionality of the code is more easily apparent without having to scroll down to the bottom of the file.
Recommended Posts
Comments
Hint: To type code with Disqus, use
<code><pre>insert.code.here()<pre/><code/>