Technical Lessons Learned from Pythonic Refactoring
This talk targets beginner software engineers yet also aims to provide interesting content for more advanced developers. You will leave knowing more about code smells and understanding the whys and hows of refactoring. Code smells refer to the symptoms of problematic code design. Identifying different types of code smells is the first step to successful refactoring. I will talk through some classic examples: Unnecessarily complex code Inappropriate naming Duplicated code Non-modularized code Knowing what to refactor, I will share a few learnings that lead to good quality code: Good python practices ( [LINK:https://www.python.org/dev/peps/pep-0020/] The Zen of Python & [LINK:https://www.python.org/dev/peps/pep-0008/] PEP8 ) Good use of data structures (named tuples & sets) The art of pythonic naming DRY principle Separation of concerns principle (modularity & encapsulation) Refactoring also makes testing easier. I will discuss how to write unit tests that cover all use cases. Finally I will talk about integration testing strategies that ensure that you and people who want to modify your API in the future are not breaking upstream code.