Polski

Learning path · 5 · beginner

Design principles

Five principles behind good patterns and readable code: KISS, DRY, YAGNI, the Law of Demeter and SOLID. Told through Halina's pierogi place moving online: before-and-after refactorings in C#, TypeScript, Java, Go and Python, diagrams, common mistakes and interview questions – and an honest look at when each principle does harm.

  1. KISS: the simplest working solution usually wins

    The KISS principle through the delivery fee in Halina's pierogi place: essential vs accidental complexity, signs of over-engineering, refactoring a “clever” rule engine into a single function in C#, TypeScript, Java, Go and Python, and…

  2. DRY: one piece of knowledge, one place – and when duplication is cheaper

    The DRY principle through the order rules of Halina's pierogi place: knowledge duplication vs code duplication, the Rule of Three, Sandi Metz's wrong abstraction, a single source of truth for validation, schemas and configuration in C#,…

  3. YAGNI: don't build ahead – what a feature nobody ordered really costs

    The YAGNI principle through the online shop of Halina's pierogi place: its Extreme Programming origins, the four costs of building ahead, YAGNI vs extension points and feature flags, and removing premature abstraction from payment code in…

  4. The Law of Demeter: talk only to your friends

    The Law of Demeter (principle of least knowledge) through loyalty-point redemption in Halina's pierogi place: call chains vs Tell, Don't Ask, exceptions for fluent interfaces and DTOs, code in C#, TypeScript, Java, Go and Python, and how…

  5. SOLID: five object-oriented design principles without the myths

    The SOLID principles through Halina's pierogi place: SRP, OCP, LSP, ISP and DIP – each with a violation and a fix in C#, TypeScript, Java, Go and Python, plus diagrams, the patterns that implement them and the most common misreadings.

Learning paths