Cohesion and Coupling: Write BETTER PYTHON CODE Part 1

Published: 22 January 2021
on channel: ArjanCodes
228,321
8.8k

💡 Learn how to design great software in 7 steps: https://arjan.codes/designguide.

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

🎓 ArjanCodes Courses: https://www.arjancodes.com/courses.

GitHub repository: https://github.com/arjancodes/betterp....

💬 Join my Discord server: https://discord.arjan.codes.

⌨️ Keyboard I’m using: https://amzn.to/49YM97v.

All parts in this series:
Part 1: Cohesion and coupling -    • Cohesion and Coupling: Write BETTER PYTHON...  
Part 2: Dependency inversion -    • Dependency Inversion: Write BETTER PYTHON ...  
Part 3: The strategy pattern -    • The Strategy Pattern: Write BETTER PYTHON ...  
Part 4: The observer pattern -    • Observer Pattern Tutorial: I NEVER Knew Ev...  
Part 5: Unit testing and code coverage -    • 100% CODE COVERAGE - Think You're Done? Th...  
Part 6: Template method and bridge -    • Two UNDERRATED Design Patterns 💡 Write BET...  
Part 7: Exception handling -    • Exception Handling Tips in Python ⚠ Write ...  
Part 7b: Monadic error handling -    • Monadic Error Handling in Python ⚠ Write B...  
Part 8: Software architecture -    • Why You Should Think About SOFTWARE ARCHIT...  
Part 9: SOLID principles -    • Uncle Bob’s SOLID Principles Made Easy 🍀 -...  
Part 10: Object creation patterns -    • QUESTIONABLE Object Creation Patterns in P...  

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!


On this page of the site you can watch the video online Cohesion and Coupling: Write BETTER PYTHON CODE Part 1 with a duration of hours minute second in good quality, which was uploaded by the user ArjanCodes 22 January 2021, share the link with friends and acquaintances, this video has already been watched 228,321 times on youtube and it was liked by 8.8 thousand viewers. Enjoy your viewing!