4 ms·
I don’t know what you think declarative means, but the example you’re showing is as non-declarative as it could be for such a simple thing.
by epgui 3y ago
I don’t know what you think declarative means, but the example you’re showing is as non-declarative as it could be for such a simple thing.
- hk__2 3y ago> I don’t know what you think declarative means, but the example you’re showing is as non-declarative as it could be for such a simple thing. According to Wikipedia this is a style of programming where you describe _what_ you want rather than _how_ it should be done. What I see in my example is declarative per this definition: "I want a chart with <source>, with this X label and that Y label".
- epgui 3y agoYes but this is a contrived example so it’s not going to be the best illustration of the difference. You’re literally executing methods on an object as a way to instruct the computer to perform specific steps. The fact that you can read it as if it were a description of the outcome is a happy accident (a purely aesthetic one at that) that would not necessarily happen with another example.