After hitting a certain level of experience & spending quite enough time in the industry, I have realised the importance of designing/architecting system & software. So I have started looking into system/software design & got to know nothing can better start than a Design Pattern. And the first thing I have done is googling "What is Design Pattern?" Hence got the idea of this article.
/!\: Originally published @ www.vishalchovatiya.com.
But as someone without a computer science background(I am from electronics background), learning them was a struggle. Every material, article, explanation or book was riddle with jargon to sift through. Some of them I still don't quite understand. I barely know how the Flyweight & Classical Visitor pattern work and anyone who says they do is a liar.
So, after taking the online course, YouTube videos, lots of googling, tons compiling & spaced repetition with learning & unlearning. Here is what I have gained so far.

What Is Design Patterns?

From Wikipedia:
- In software engineering, a software design pattern is a general, reusable
solution to a commonly occurring problem within a given context in software design.
- It is not a finished design that can be transformed directly into source or machine code. It is a description or template for how to solve a problem that can be used in many different situations.
- Design patterns are formalized best practices that the programmer can use to solve common problems when designing an application or system.

What Is Not Design Pattern?

Why Do We Need Design Patterns?

They Are Proven Solutions
They Are Easily Reusable
They Are Expressive
They Ease Communication
They Prevent the Need for Refactoring Code
They Lower the Size of the Codebase

Why You Should Learn Design Patterns?

Before Dive-Into the Design Patterns

  1. SRP -- Single Responsibility Principle
  2. OCP -- Open/Closed Principle
  3. LSP -- Liskov Substitution Principle
  4. ISP -- Interface Segregation Principle
  5. DIP -- Dependency Inversion Principle
SOLID are "not principles to adopt" but "frameworks to use"

Types of Design Patterns

Creational Design Patterns
  1. Factory
  2. Builder
  3. Prototype
  4. Singleton
Structural Design Patterns
  1. Adapter
  2. Bridge
  3. Composite
  4. Decorator
  5. Facade
  6. Flyweight
  7. Proxy
Behavioural Design Patterns
  1. Chain of responsibility
  2. Command
  3. Interpreter
  4. Iterator
  5. Mediator
  6. Memento
  7. Observer
  8. State
  9. Strategy
  10. Template Method
  11. Visitor

Benefits of Design Patterns

  1. Foresee & rectify future problems easily.
  2. Helps in maintaining binary compatibility with subsequent releases.
  3. Just by following SOLID Principles helps greatly in agile or adaptive software development.
  4. The solution facilitates the development of highly cohesive modules with minimal coupling. Thus, increasing extensibility & reusability.
  5. There are some patterns like Facade, Proxy, etc which encapsulates
    the complexity in itself to provide easy & intuitive interface to
    the client. Thus, making the overall system easier to understand &
    reduce learning curve.
  6. Design Patterns make communication between designers &
    developers more crystal & precise. A developer can immediately
    picture the high-level design in their heads when they refer to the name
    of the pattern used to solve a particular issue when discussing
    software design.

What Next?

I'm not advocating to learn everything by heart, but you should try to understand as much as you can about these concepts as you will encounter them often in your work. By practising to implement them, you
will understand better their use cases and the reasons behind them.
I hope to cover most of the classic Gang of Four Design Patterns throughout this series. I struggled to find beginner-friendly material while learning them, and hope these help others avoid the same fate. By the way, I will be using Modern C++ for all of the patterns. So you can also smell C++ from thought process & some of the definitions(this line is hard for me to put it into the words). This is by no means that you can not apply these patterns to other languages.

FAQs

Do you need design pattern all the time?
Initially, you should not think about Design Pattern. An expressive & less code is always the first line of defence. You should not complicate the solution because complication is given by the problem.
Why you should learn the Design Patterns?
If you are a self-taught developer & does not expose to industry projects then you may not have thought process for using Object-Oriented Design. You can not think every aspect of design in terms of objects. In this case, Design Pattern will give you a new thought process of thinking everything in terms of objects. And if you follow it strictly, you will see your classes & software represent the Domain Specific Language.
Previously published at http://www.vishalchovatiya.com/what-is-design-pattern/