Version 1.0

Lecture: Washing away code smells

Yelp burst positive rgb

Does your code smell? Have a weird fragrance? It turns out code smells are a real thing and an amazing conceptualization of suboptimal design. This talk helps you develop you code nose through identifying Python code smells. It also shows you how to wash them away by the technique of refactoring. You will learn the art of writing Pythonic, clean and maintainable code.

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:

Unnecessary long and complex code
Useless code
Coupled code
Inappropriate naming

Knowing what to refactor, I will share a few learnings that lead to good quality code:

The boy scout rule - always leave the code cleaner than you found it
Good practices in Python
Good use of data structures
The art of naming
DRY principle

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.


Day: 2018-05-05
Start time: 10:00
Duration: 00:30
Room: F0.01
Track: PyDays
Language: en




Click here to let us know how you liked this event.

Concurrent Events