Sefism is free for learners. We are here to help you grow, one step at a time.Join for free
Sefism.

Cheat sheet · Foundations

Software design and clean code cheat sheet (Python)

Opens with credits

For students and early-career engineers who can write working Python and now want it to stay easy to change: OOP used properly, SOLID, clean code, all 23 classic design patterns, UML, refactoring and small designs end to end. Every sketch is typed Python, and notes where the language makes a pattern unnecessary.

Curated by Tauseef Fayyaz10 chapters73 concepts124 glossary terms

Chapters

10 chapters · 73 concepts

  1. 1Object-oriented programming properlyClasses, objects and the four ideas behind them, used to protect rules and hide change rather than to build deep family trees. Composition over inheritance starts here.8 concepts
  2. 2SOLID principlesFive principles for classes that are easy to extend and test, each with the smell it prevents. Learn them as questions to ask of a design, not as rules to recite.7 concepts
  3. Clean code: names, functions and errorsThe small decisions made hundreds of times a day: what to call things, how big a function should be, when to comment, and how to fail loudly and clearly.7 conceptsOpens with credits
  4. Creational patternsThe five Gang of Four patterns about how objects get made: one shared instance, a subclass choosing the type, families of related objects, step-by-step construction and cloning.5 conceptsOpens with credits
  5. Structural patternsThe seven Gang of Four patterns about how objects fit together: translating interfaces, splitting two dimensions, trees, wrappers, simple front doors, shared state and stand-ins.7 conceptsOpens with credits
  6. Behavioural patternsThe eleven Gang of Four patterns about how objects share work and talk to each other: passing requests along, packaging actions, swapping algorithms, reacting to events and walking structures.11 conceptsOpens with credits
  7. UML and class diagrams you actually needThe small part of UML that working engineers sketch: class boxes, visibility, the five relationship arrows, multiplicity and a sequence diagram. Enough to explain a design on a whiteboard or in a pull request.7 conceptsOpens with credits
  8. Refactoring and code smellsChanging the structure of code without changing what it does, in small safe steps behind tests. Smells tell you where to look; named refactorings tell you what to do.9 conceptsOpens with credits
  9. Designing small systems end to endLow level design: turning a short problem statement into classes, relationships and working code. A repeatable method, then the classic practice problems and what each one teaches.7 conceptsOpens with credits
  10. Code review: giving and taking itReviews are where design skill is taught and tested day to day. What reviewers look for, how to write comments people act on, and how to receive them without taking them personally.5 conceptsOpens with credits
  11. 11Glossary, A to ZEvery concept in the sheet and the smaller terms it uses, in one list.124 terms

About this sheet

OOP, SOLID, design patterns, refactoring.

Picked from the other libraries by shared topics.

Work with me

Stuck on something specific?

Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.

  • 1:1 Mentorship
  • Fresh Graduate Mentorship
  • Career Guidance

Brand deals, promos and partnerships: tauseeffayyaz@gmail.com