3 ms·
I think that declarative style is actually above functional style in terms of getting flawless results; declarative is the "ultimate abstraction" everyone seeks
by chipsy 17y ago
I think that declarative style is actually above functional style in terms of getting flawless results; declarative is the "ultimate abstraction" everyone seeks, since it lets you jump from problem definition to problem solution immediately. But it is found within language features as varied as named variables, type systems, classes, constraint primitives, functional algorithms, macro systems, and domain-specific languages. You can't actually be "declarative" from just one of those things; it's using them in combination, in incremental layers, that gets you to a truly beautiful result.
I also think that the majority of programmer zealotry originates from programmers who stumble upon a paradigm that allows them to be more declarative than before; being so stricken by this new power, they become blinded to the limitations.
- dasil003 17y agoI'm not talking about functional style, I'm talking about pure functions. Declarative style is an orthogonal concept. I can buy the argument that a declarative style makes intent clearer, but it's not the "ultimate abstraction" because all abstractions are leaky and also even if one happens not to be, it's still open to misinterpretation due to human assumptions (ie. the whole reason laymen programming tools have never worked out). Clarity and intent are beside the point though. I'm not talking about making life easier for the programmer. I'm talking about getting guaranteed correct results. I'm talking about bugs, and bugs live deep inside code. The easy bugs are ones where there has been a wrong declaration in the DSL-veneer. The only way to guarantee there is no deep bug is through a mathematical proof, and you can't prove anything without enforced purity. I don't particularly enjoy math, but it delivers by far the strongest guarantees you can get in software.