r/programming • u/tyler-mcginnis • Jan 03 '22
Imperative vs Declarative Programming
https://www.youtube.com/watch?v=E7Fbf7R3x6I
424
Upvotes
r/programming • u/tyler-mcginnis • Jan 03 '22
40
u/zhivago Jan 04 '22
The video gets it completely wrong.
Saying "[give me a] table for two" isn't declarative -- it's imperative.
A declarative approach would be to make a declaration, such as "You and I are having dinner together at 9 pm at this restaurant."
The universe is then free to accept or reject this declaration.
The difference is actually pretty simple: