4 ms·
Your examples are a little misleading. // Imperative: (essence of it) x = 0; x = x + 1; return x; // Procedural x = 0; inc(x); return x; // Functional return
by aminit 12y ago
Your examples are a little misleading.
// Imperative: (essence of it)
x = 0;
x = x + 1;
return x;
// Procedural
x = 0;
inc(x);
return x;
// Functional
return inc(x);
// declarative
select x + 1;
---
My argument is that all of these above are imperative. Down below sits imperative CPU which will give exactly the same result. Every time.
Wiki definition of imperative programming is wrong: "Imperative programming is focused on describing how a program operates"
This applies to every program in every language. Because you as a programmer are always focused on describing how program operates. Prolog is only another higher abstraction layer.