2 ms·
everything is partly declarative. you can draw a rectangle line by line, or you can put this code into a function or a procedure, and call it declarative, becau
by spamtarget 4y ago
everything is partly declarative. you can draw a rectangle line by line, or you can put this code into a function or a procedure, and call it declarative, because it is something like that.
i did not speak about testing, however what a declarative language can do is defined by the framework under it. so you test that I guess?
- ttfkam 4y agoSVG: Draw rectangles and triangles. If you don't have a script tag in it, totally declarative. You don't draw line by line. You describe what you want and have the engine work it out. Just because that description can be complex such as a <path> definition doesn't detract from this point. Kinda like SQL. Describe the set of data you want from other sets of data and have the engine work it out. It's set theory. In math, sets can have conditions, can be combined, can be filtered, and all without a single function or loop in sight. Ergo declarative, not functional or imperative. SQL is a DSL for set theory with some extensions tacked on. You can use functions with SQL, but its core is perfectly adequate without them.
- spamtarget 4y ago>SVG: Draw rectangles and triangles. If you don't have a script tag in it, totally declarative I totally agree. It is declarative the same way how HTML is. I don't see how SQL and SVG is similar from the viewpoint of approaching the problem. In SVG you concretely define what you want, and that is happening. In SQL you don't define the data you get, like ok, this cell will be 5, another will 8. I understand what you want to say, I just see those completely different ways. >can be combined, can be filtered, and all without a single function or loop in sight This is the key here, because this is exactly true to functional programming. Compare SQL->LINQ->lambda expression If they work the how you say, then SQL - declarative LINQ - declarative and functional the same time Lambda exp - functional This idea is completely nonsensical for me