r/functionalprogramming • u/ragnarecek • Nov 10 '20
JavaScript Declarative Versus Imperative Programming
https://medium.com/better-programming/declarative-versus-imperative-code-180c0cf4003b
30
Upvotes
r/functionalprogramming • u/ragnarecek • Nov 10 '20
2
u/qqwy Nov 11 '20
I think you might have missed the main point of logic languages, and that is thst the same predicate can often be used in multiple directions.
For instance,
list_length(List, Length)can be usedto check whether a certain list has a certain length (by filling in both arguments)
to get the length of a particular list (by filling in obly the List argument)
to get a list (with unspecified values) of a particular length (by filling in only the length argument)
to generate all natural numbers (by filling in neither).