|
|
|
|
|
by tony
2491 days ago
|
|
Nice post! Agreed on keeping the initial stuff simple as possible. In python, I typically follow a pattern of keeping stuff in __name__ == '__main__' block and running it directly, then splitting to functions with basics args/kwargs, and finally classes. I divide into functions based on testability btw. Which is another win, since functional tests are great to assert against and cover/fuzz with pytest.mark.parameterize [1] If the content of this post interested you: Code Complete: A Practical Handbook of Software Construction by Steve McConnell would make good further reading. Aside: If the domain .gov.sg caught your eye: https://en.wikipedia.org/wiki/Civil_Service_College_Singapor... [1] https://docs.pytest.org/en/latest/parametrize.html |
|