Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between an Algorithm and a Design Pattern

I was searching for "Undo/Redo algorithms" and found something marked as a duplicate, but the duplicate was a request for a "Undo Design Pattern". I'd really like an algorithm for this. I don't think I necessarily need a design pattern.

Is there a fundamental difference between "Design Pattern" and "Algorithm" or is it OK that someone uses the two interchangeably?

I'll hang up and take my answer off the air.

Ok, forgive me for thinking design patterns were just abstractions of algorithms. Here's a little table of my findings from the answers which were all very good.

   Design Pattern |    Algorithm
------------------|----------------
Abstract          | Concrete
Control Structure | Set of Actions    
Template          | Implementation
Flexible          | Deterministic
Blueprint         | Recipe

1 Answers

An algorithm is like a recipe: a step-by-step process for performing some activity.

A design pattern is like a blueprint: an structured collection of objects and associations and actions to accomplish some goal.

like image 149
2 revs, 2 users 67%Steven A. Lowe Avatar answered Sep 05 '25 14:09

2 revs, 2 users 67%Steven A. Lowe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!