Photo by TOMMY VAN KESSEL on Unsplash
There are 2 main programming paradigms:
- Declarative. What to do. Think SQL.
- Imperative. How to do it. Think C++.
๐ Vader Buys A Cake
As a memory trick, let's imagine buying a chocolate cake with each approach.
- Declarative: You go to the bakery and declare you want one. You don't care how it gets done, you just want the final product.
- Imperative: You stand over the baker and tell him exactly what to do. The imperial march plays in the background.
Other Paradigms
Here's how a few other common approaches can be categorized:
๐ข Declarative | ๐ Cake |
---|---|
Procedural Programming | Logical Programming |
Object Oriented | Functional Programming |
Parallel Processing | Database Queries |
Top comments (0)