Best of Design Patterns2025

  1. 1
    Article
    Avatar of devtoDEV·26w

    You're Not Building Netflix: Stop Coding Like You Are

    Over-engineering is a common trap for intermediate developers who apply enterprise patterns and abstractions to simple problems. The article argues against premature abstraction, showing real examples of unnecessarily complex code that could be replaced with straightforward solutions. Key principles include: abstract only what changes frequently, wait for three use cases before creating abstractions, avoid interfaces with single implementations, and prioritize readability over architectural sophistication. Simple, boring code that solves actual problems scales better than over-architected solutions designed for hypothetical future requirements.

  2. 2
    Article
    Avatar of telerikTelerik·51w

    React Design Patterns and Best Practices for 2025

    Comprehensive guide covering modern React development patterns for 2025, including function components, custom hooks, Context API, TypeScript integration, and React 19 features like useOptimistic and Server Components. Explores ecosystem tools like Next.js, Remix, Vite, and Tailwind CSS, plus enterprise UI solutions like KendoReact for building scalable, maintainable applications.

  3. 3
    Article
    Avatar of codigeeCodigee·1y

    How do you write code?

  4. 4
    Article
    Avatar of laravelkidsLaravel Kids·1y

    Best Design Pattern source for Learning

    Refactoring Guru provides comprehensive resources for learning design patterns in PHP. The site includes detailed explanations, examples, and practical advice for implementing various patterns in real-world projects. Ideal for anyone looking to enhance their software design skills.

  5. 5
    Article
    Avatar of itnextITNEXT·1y

    The heart of architecture: deconstructing patterns

    Explore the fundamental concepts of software architecture focusing on cohesion and decoupling. Learn about SOLID principles and how they influence design patterns, understand various Gang of Four patterns, and delve into architectural metapatterns for effective software design.

  6. 6
    Article
    Avatar of lobstersLobsters·37w

    If I hear "design pattern" one more time, I'll go mad

    A critical examination of design patterns in software development, arguing that many patterns are overcomplicated names for simple programming concepts. The author contends that patterns like Command (which is just a function) and Strategy (which is just an interface) create unnecessary cognitive overhead and that developers naturally arrive at these solutions through iterative design without needing formal pattern terminology. The piece advocates for focusing on underlying principles rather than memorizing pattern names, suggesting that good architecture emerges from composing language features to solve problems rather than following prescribed patterns.

  7. 7
    Article
    Avatar of lightbendLightbend·1y

    Design patterns for agentic AI

    The era of agentic AI has begun, with intelligent agents increasingly handling tasks and making decisions autonomously, boosting productivity. This webinar explores how these AI systems, differing from traditional SaaS tools, are built using agentic design patterns. It covers why legacy architectures are inadequate and demonstrates how platforms like Akka enable building scalable, event-driven AI agents.

  8. 8
    Article
    Avatar of yegor256Yegor's Blog·48w

    remove(42) vs. find(42).remove()

    Compares two approaches for removing objects from collections: direct removal methods versus retrieving the object first then calling remove. The retrieve-then-remove approach offers better object-oriented design through improved extensibility via decorators, more flexible error handling with null objects, and stronger encapsulation by keeping data wrapped within objects rather than exposing it as parameters.

  9. 9
    Article
    Avatar of codemotionCodemotion·49w

    AI-Ready Frontend Architecture

    Frontend architecture is evolving to accommodate AI tools that generate, parse, and interpret code. The approach involves creating AI guidelines files to establish conventions, using component-driven development with tools like V0.dev and shadcn/ui, implementing the Use Case pattern to decouple business logic from UI, and employing middleware chains for cross-cutting concerns like logging and error handling. This architecture enables both humans and AI agents to collaborate effectively while maintaining code quality, testability, and scalability.

  10. 10
    Article
    Avatar of hnHacker News·37w

    How did MVC get so F’ed up?

    The Model-View-Controller (MVC) pattern has been misunderstood and misimplemented over the years. The original Smalltalk MVC design keeps models completely unaware of views and controllers, using observer patterns for communication. Modern implementations, particularly Apple's Cocoa version, have corrupted this by making controllers act as intermediaries and creating tightly coupled view-controllers. True MVC requires observable models that can notify multiple views of changes, with the key insight being that models should never depend on their UI components. The pattern works as a composite where views can have their own models, and even function arguments should be treated as observable models to properly enable/disable UI elements.

  11. 11
    Article
    Avatar of wendelladrielW endell Adriel·38w

    Welcome to the State Machine Pattern

    State machines provide a structured approach to managing complex workflows by defining explicit states, events, and transition rules. This pattern replaces tangled if/else logic with predictable, testable behavior using PHP enums, guards for validation, and actions for side effects. The implementation includes domain events with an outbox pattern to keep decision logic pure while handling side effects reliably. Key benefits include improved clarity, safety from forbidden transitions, better testability, and enhanced observability through logging and documentation generation.

  12. 12
    Article
    Avatar of freecodecampfreeCodeCamp·41w

    How to Choose the Best Programming Languages, Libraries, and Patterns

    Programming decisions should be based on context and suitability rather than absolute rankings. The "Law of Suitability" suggests that the best programming language, framework, or architecture depends on specific project requirements, team constraints, and problem context. Popular choices aren't always optimal, and expert opinions should be evaluated critically. When choosing tools, consider whether they solve more problems than they create, their maintenance status, documentation quality, and footprint. Programming principles like DRY and design patterns are guidelines, not universal laws, and should be applied judiciously based on the situation.

  13. 13
    Article
    Avatar of minersThe Miners·47w

    What you need to know about frontend design patterns

    Design patterns provide reusable solutions to common programming problems. Custom hooks in React exemplify this concept by allowing developers to extract and reuse stateful logic across components. The guide demonstrates how to create custom hooks for data fetching with loading states and currency formatting, showing how they improve code organization, reusability, and maintainability by separating concerns and following DRY principles.

  14. 14
    Article
    Avatar of netguruNetguru·42w

    Hidden React Architecture Patterns That Senior Developers Actually Use

    Advanced React architecture patterns used by senior developers include Compound Component Architecture for managing shared state without prop drilling, Prop Getters pattern for creating reusable interactions with composed event handlers, and strategic choices between Controlled vs Uncontrolled components. These patterns enable building scalable, maintainable applications with cleaner APIs, better accessibility, and more intuitive component relationships through techniques like Context API, cloneElement, and state composition.

  15. 15
    Article
    Avatar of itnextITNEXT·1y

    Choose your own architecture

    Choosing the right software architecture depends on several factors, such as project size, domain features, team structure, and non-functional requirements like performance and fault tolerance. Different projects may require different architectural styles, including monolithic, layered, services, SOA, and more. It's essential to understand the domain characteristics and tailor the architecture to meet specific needs efficiently.

  16. 16
    Article
    Avatar of rubylaRUBYLAND·51w

    Railway Pattern

    The Railway Pattern enables fault-tolerant function composition by chaining operations that can either succeed or fail gracefully. Using Ruby gems like Dry Monads and Pipeable, developers can build robust pipelines where each step produces either a Success or Failure result, allowing errors to bubble up without breaking the entire flow. The pattern is demonstrated through building an API client that handles HTTP requests, JSON parsing, validation, and data modeling as a single composable pipeline, making code more resilient to network issues and data problems.

  17. 17
    Article
    Avatar of logrocketLogRocket·38w

    Why Go design patterns still matter

    Explores how three specific design patterns can solve scaling challenges in Go microservices while maintaining code simplicity. The discussion focuses on practical implementation strategies that balance architectural complexity with Go's design philosophy.

  18. 18
    Article
    Avatar of freecodecampfreeCodeCamp·43w

    Object-Oriented Design Patterns with Java

    A comprehensive guide to essential object-oriented design patterns implemented in Java, covering Strategy, Singleton, Composite, Decorator, State, Observer, Proxy, Factory, and Visitor patterns. Each pattern is explained with practical examples and interactive code playbacks that demonstrate how to solve common programming problems through reusable solutions. The tutorial focuses on leveraging inheritance and polymorphism to create flexible, maintainable code architectures.

  19. 19
    Article
    Avatar of rubylaRUBYLAND·41w

    Undervalued: The Most Useful Design Pattern

    Explores using value objects, data objects, and factory methods to decouple software components and improve testability. Demonstrates refactoring a tightly coupled XML feed generator by separating concerns through domain boundaries, transforming ActiveRecord models into simple data structures that isolate business logic from external APIs and database dependencies.

  20. 20
    Article
    Avatar of hnHacker News·27w

    When did people favor composition over inheritance?

    Explores the historical origins and context of the "favor composition over inheritance" principle from the Gang of Four's Design Patterns book. Examines the three-page discussion that led to this aphorism, including the white-box versus black-box reuse distinction, language-specific considerations in Smalltalk and Java, and the compile-time versus runtime trade-offs. References Barbara Liskov's earlier work on subtypes and polymorphism, highlighting that composition and inheritance aren't the only options—first-class procedures offer a third alternative that the simplified aphorism overlooks.

  21. 21
    Article
    Avatar of lnLaravel News·21w

    Laravel Extended Commands

    A Laravel package adds Artisan commands for generating common design pattern stubs like Builders, Actions, Collections, Concerns, and Contracts. After installing via Composer, developers can use commands like 'php artisan make:builder' to quickly scaffold these patterns with proper namespacing in the app directory.

  22. 22
    Article
    Avatar of xubairZubair Ahmed Rafi·37w

    How to keep your users focus on the screen

    Explores how natural human visual patterns influence digital interface design. Discusses the thumb-width focal range used by major platforms like LinkedIn and Facebook to maintain user focus, and explains F-shaped reading behavior in search interfaces where users read the first line fully, skim the second, then lose attention downward. Emphasizes that effective design guides attention rather than filling space.

  23. 23
    Article
    Avatar of simonwillisonSimon Willison·49w

    Design Patterns for Securing LLM Agents against Prompt Injections

    A comprehensive research paper by 11 authors from IBM, Google, Microsoft and other organizations presents six design patterns to mitigate prompt injection attacks in LLM agents. The patterns include Action-Selector, Plan-Then-Execute, LLM Map-Reduce, Dual LLM, Code-Then-Execute, and Context-Minimization approaches. Each pattern trades some agent flexibility for security by constraining actions and preventing untrusted input from triggering arbitrary tasks. The paper includes ten detailed case studies covering practical applications like SQL agents, email assistants, and customer service chatbots, providing threat models and mitigation strategies for each scenario.

  24. 24
    Article
    Avatar of mlmMachine Learning Mastery·31w

    7 Must-Know Agentic AI Design Patterns

    Seven proven design patterns for building production-ready AI agents: ReAct (reasoning loops), Reflection (self-critique), Planning (task decomposition), Tool Use (external integrations), Multi-Agent Collaboration (specialized agents), Sequential Workflow (fixed pipelines), and Human-in-the-Loop (safety checkpoints). Each pattern addresses specific trade-offs between cost, latency, reliability, and complexity. The guide emphasizes starting simple with single agents and tool use, then evolving to more complex patterns only when clear limitations emerge. Includes practical decision framework based on workflow predictability, quality requirements, and task complexity.

  25. 25
    Article
    Avatar of habrhabr·32w

    Predicate Pattern in Go

    Explores implementing the predicate pattern in Go to create elegant, filterable search methods. Demonstrates building a process finder that accepts predicate functions (functions returning bool) through builder methods like ByTitle() and ByPID(). Shows how to enhance developer experience by converting filter functions into methods on an empty struct, enabling IDE autocomplete for filter options while maintaining clean, idiomatic code.