"If Statements are a Code Smell" - Aly Sivji (Pyohio 2019)
Автор: PyOhio
Загружено: 2019-08-10
Просмотров: 730
Aly Sivji
https://www.pyohio.org/2019/presentat...
Writing software is about making trade-offs between getting things done and doing them right. Time constraints often force us to take shortcuts to handle slight variations resulting in patches of conditional logic sprinkled throughout our codebase. Workarounds that once allowed us to move quickly now hinder our progress in getting new features out to customers. It doesn't have to be this way!
This talk will demonstrate how to use Object-Oriented programming patterns, specifically polymorphism, to handle conditional logic resulting in code that is easy to modify. The material will be presented in the context of a real-world code refactor for an open-source project. We will examine the initial solution, discuss its limitations, and walk through the process of refactoring nested `if` blocks into polymorphic classes.
The session is geared towards developers who do not have a lot of experience implementing Object-Oriented solutions. After this talk, you will be able to identify situations where Object-Oriented design can be used to simplify complex conditional logic. Using the steps outlined, you will be able to refactor code to improve software architecture without changing existing functionality.
`if` statements allow us to selectively execute code based on conditional logic. Overusing conditionals results in code that is hard to understand and difficult to modify. This talk will demonstrate how to refactor `if` statements into polymorphic classes, resulting in cleaner program design. After this session, you will be able to implement complex conditional logic using simple Python classes.
===
https://pyohio.org
A FREE annual conference for anyone interested in Python in and around Ohio, the entire Midwest, maybe even the whole world.
Produced by NDV: / @nextdayvideo
Sat Jul 27 15:00:00 2019 at Cartoon 1
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: