Cohesion and coupling: write BETTER PYTHON CODE Part 1
Writing code, especially in larger software projects can be very challenging. In this video, I'm going to cover cohesion and coupling to help you write better code. I'll go through a Python program in detail and I'll show you how to write code that has low coupling and strong cohesion. Coupling and Cohesion are part of the GRASP principles of object-oriented design, as proposed by Craig Larman in his book (see below for a link).
Here are a few books about software design that might interest you:
- Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and Iterative Development, by Craig Larman: https://amzn.to/364wgLb
- Design Patterns: Elements of Reusable Object-Oriented Software, by the Gang of Four: https://amzn.to/39451Cv
🎓 Sign up to Brilliant now and get 20% off the annual subscription: https://brilliant.sjv.io/arjancodes.
🛒 GEAR & RECOMMENDED BOOKS: https://kit.co/arjancodes.
You can find the code I worked on in this episode in my GitHub repository: https://github.com/arjancodes/betterpython
All parts in this series:
Part 1: Cohesion and coupling - https://youtu.be/eiDyK_ofPPM
Part 2: Dependency inversion - https://youtu.be/Kv5jhbSkqLE
Part 3: The strategy pattern - https://youtu.be/WQ8bNdxREHU
Part 4: The observer pattern - https://youtu.be/oNalXg67XEE
Part 5: Unit testing and code coverage - https://youtu.be/jmP3fp_BhmE
Part 6: Template method and bridge - https://youtu.be/t0mCrXHsLbI
Part 7: Exception handling - https://youtu.be/ZsvftkbbrR0
Part 7b: Monadic error handling - https://youtu.be/J-HWmoTKhC8
Part 8: Software architecture - https://youtu.be/ihtIcGkTFBU
Part 9: SOLID principles - https://youtu.be/pTB30aXS77U
Part 10: Object creation patterns - https://youtu.be/Rm4JP7JfsKY
Chapters:
0:00 Introduction
0:47 What is cohesion?
1:37 What is coupling?
3:59 Code example intro
6:39 Analyzing the code
7:56 Information expert
11:19 Reducing coupling
16:32 Improving cohesion
22:40 Recap
25:37 Outro
If you enjoyed this content, give this video a like. If you want to watch more of my upcoming videos, consider subscribing to my channel!
DISCLAIMER - The links in this description might be affiliate links. If you purchase a product or service through one of those links, I may receive a small commission. There is no additional charge to you. Thanks for supporting my channel so I can continue to provide you with free content each week!
Видео Cohesion and coupling: write BETTER PYTHON CODE Part 1 канала ArjanCodes
Here are a few books about software design that might interest you:
- Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and Iterative Development, by Craig Larman: https://amzn.to/364wgLb
- Design Patterns: Elements of Reusable Object-Oriented Software, by the Gang of Four: https://amzn.to/39451Cv
🎓 Sign up to Brilliant now and get 20% off the annual subscription: https://brilliant.sjv.io/arjancodes.
🛒 GEAR & RECOMMENDED BOOKS: https://kit.co/arjancodes.
You can find the code I worked on in this episode in my GitHub repository: https://github.com/arjancodes/betterpython
All parts in this series:
Part 1: Cohesion and coupling - https://youtu.be/eiDyK_ofPPM
Part 2: Dependency inversion - https://youtu.be/Kv5jhbSkqLE
Part 3: The strategy pattern - https://youtu.be/WQ8bNdxREHU
Part 4: The observer pattern - https://youtu.be/oNalXg67XEE
Part 5: Unit testing and code coverage - https://youtu.be/jmP3fp_BhmE
Part 6: Template method and bridge - https://youtu.be/t0mCrXHsLbI
Part 7: Exception handling - https://youtu.be/ZsvftkbbrR0
Part 7b: Monadic error handling - https://youtu.be/J-HWmoTKhC8
Part 8: Software architecture - https://youtu.be/ihtIcGkTFBU
Part 9: SOLID principles - https://youtu.be/pTB30aXS77U
Part 10: Object creation patterns - https://youtu.be/Rm4JP7JfsKY
Chapters:
0:00 Introduction
0:47 What is cohesion?
1:37 What is coupling?
3:59 Code example intro
6:39 Analyzing the code
7:56 Information expert
11:19 Reducing coupling
16:32 Improving cohesion
22:40 Recap
25:37 Outro
If you enjoyed this content, give this video a like. If you want to watch more of my upcoming videos, consider subscribing to my channel!
DISCLAIMER - The links in this description might be affiliate links. If you purchase a product or service through one of those links, I may receive a small commission. There is no additional charge to you. Thanks for supporting my channel so I can continue to provide you with free content each week!
Видео Cohesion and coupling: write BETTER PYTHON CODE Part 1 канала ArjanCodes
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
![Dependency inversion: write BETTER PYTHON CODE Part 2](https://i.ytimg.com/vi/Kv5jhbSkqLE/default.jpg)
![If you're not using Python DATA CLASSES yet, you should 🚀](https://i.ytimg.com/vi/vRVVyl9uaZc/default.jpg)
![Highly COHESIVE Software Design to tame Complexity](https://i.ytimg.com/vi/r0-GC3Y_OME/default.jpg)
![](https://i.ytimg.com/vi/jyjAQA_fmBA/default.jpg)
![](https://i.ytimg.com/vi/FiE4s5YDRKY/default.jpg)
![25 nooby Python habits you need to ditch](https://i.ytimg.com/vi/qUeud6DvOWI/default.jpg)
![Why COMPOSITION is better than INHERITANCE - detailed Python example](https://i.ytimg.com/vi/0mcP8ZpUR38/default.jpg)
![How To Use Docker To Make Local Development A Breeze](https://i.ytimg.com/vi/zkMRWDQV4Tg/default.jpg)
![11 Tips And Tricks To Write Better Python Code](https://i.ytimg.com/vi/8OKTAedgFYg/default.jpg)
![The Factory Pattern in Python // Separate creation from use](https://i.ytimg.com/vi/s_4ZrtQs8Do/default.jpg)
![Powerful VSCode Tips And Tricks For Python Development And Design](https://i.ytimg.com/vi/fj2tuTIcUys/default.jpg)
![You Can Do More With F-strings Than You Think](https://i.ytimg.com/vi/dvqFNOhNIjM/default.jpg)
![10 Design Patterns Explained in 10 Minutes](https://i.ytimg.com/vi/tv-_1er1mWI/default.jpg)
![7 Python Code Smells: Olfactory Offenses To Avoid At All Costs](https://i.ytimg.com/vi/LrtnLEkOwFE/default.jpg)
![Mermaid vs PlantUML vs HackerDraw: Which One Is Best For You?](https://i.ytimg.com/vi/tPh9_Cx4yZY/default.jpg)
![5 Reasons Why You Should Use Type Hints In Python](https://i.ytimg.com/vi/dgBCEB2jVU0/default.jpg)
![The strategy pattern: write BETTER PYTHON CODE Part 3](https://i.ytimg.com/vi/WQ8bNdxREHU/default.jpg)
![SOLID Principles? Nope, just Coupling and Cohesion](https://i.ytimg.com/vi/YDNR_gfBk0Q/default.jpg)
![This Is Why Python Data Classes Are Awesome](https://i.ytimg.com/vi/CvQ7e6yUtnw/default.jpg)
![Write Python Code Properly!](https://i.ytimg.com/vi/D4_s3q038I0/default.jpg)