{"id":"6b09a4c1ff996234422a2774","slug":"design-principles","title":"Design principles","description":"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.","level":"beginner","cover":null,"order":5,"itemCount":5,"articleCount":5,"topicCount":0,"minutes":102,"groups":["principles"],"covers":[],"preview":[{"kind":"article","title":"KISS: the simplest working solution usually wins","slug":"kiss","topicSlug":null},{"kind":"article","title":"DRY: one piece of knowledge, one place – and when duplication is cheaper","slug":"dry","topicSlug":null},{"kind":"article","title":"YAGNI: don't build ahead – what a feature nobody ordered really costs","slug":"yagni","topicSlug":null},{"kind":"article","title":"The Law of Demeter: talk only to your friends","slug":"law-of-demeter","topicSlug":null}],"articleIds":["6b09a4b6ff996234422a26ba","6b09a4b5ff996234422a26ae","6b09a4c1ff996234422a276a","6b09a4b7ff996234422a26c4","6b09a4bfff996234422a2756"],"items":[{"kind":"article","articleId":"6b09a4b6ff996234422a26ba","slug":"kiss","topicSlug":null,"title":"KISS: the simplest working solution usually wins","summary":"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 complexity metrics.","readingMinutes":20,"note":"","cover":null,"group":"principles","icon":"minimize-2","techs":["dotnet","typescript","java","go","python"],"level":"beginner","status":"available"},{"kind":"article","articleId":"6b09a4b5ff996234422a26ae","slug":"dry","topicSlug":null,"title":"DRY: one piece of knowledge, one place – and when duplication is cheaper","summary":"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#, TypeScript, Java, Go and Python, plus WET and AHA.","readingMinutes":15,"note":"","cover":null,"group":"principles","icon":"copy-x","techs":["dotnet","typescript","java","go","python"],"level":"beginner","status":"available"},{"kind":"article","articleId":"6b09a4c1ff996234422a276a","slug":"yagni","topicSlug":null,"title":"YAGNI: don't build ahead – what a feature nobody ordered really costs","summary":"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 C#, TypeScript, Java, Go and Python.","readingMinutes":18,"note":"","cover":null,"group":"principles","icon":"scissors","techs":["dotnet","typescript","java","go","python"],"level":"beginner","status":"available"},{"kind":"article","articleId":"6b09a4b7ff996234422a26c4","slug":"law-of-demeter","topicSlug":null,"title":"The Law of Demeter: talk only to your friends","summary":"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 it relates to encapsulation and coupling metrics.","readingMinutes":16,"note":"","cover":null,"group":"principles","icon":"message-circle","techs":["dotnet","typescript","java","go","python"],"level":"intermediate","status":"available"},{"kind":"article","articleId":"6b09a4bfff996234422a2756","slug":"solid","topicSlug":null,"title":"SOLID: five object-oriented design principles without the myths","summary":"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.","readingMinutes":33,"note":"","cover":null,"group":"principles","icon":"brick-wall","techs":["dotnet","typescript","java","go","python"],"level":"intermediate","status":"available"}],"others":[{"id":"6b08bd4080884893657cca50","slug":"gof-creational","title":"GoF creational patterns","description":"Five ways to stop object creation from being scattered all over your code: from Factory Method through Abstract Factory, Builder and Prototype to Singleton – with examples in C#, TypeScript, Java, Go and Python.","level":"intermediate","cover":null,"order":1,"itemCount":5},{"id":"6b08bd4080884893657cca57","slug":"gof-structural","title":"GoF structural patterns","description":"Seven patterns about composing classes and objects into larger structures: Adapter, Bridge, Composite, Decorator, Facade, Flyweight and Proxy. Each with a real-life problem, a diagram and code in five languages.","level":"intermediate","cover":null,"order":2,"itemCount":7},{"id":"6b08bd3f80884893657cca49","slug":"gof-behavioral","title":"GoF behavioral patterns","description":"Ten behavioral patterns from the Gang of Four catalog, told through Halina's pierogi place moving online: from Strategy and Observer to Memento and Visitor. Every article has a diagram, code in C#, TypeScript, Java, Go and Python, a quiz and advice on when not to use the pattern.","level":"intermediate","cover":null,"order":3,"itemCount":10}]}