5 ms·
Will you explain what you mean by "Design everything you can to be declarative"?
by cmetzger4 4y ago
Will you explain what you mean by "Design everything you can to be declarative"?
- haihaibye 4y agoI think they mean if you can, don't define the execution yourself. Rather, specify what needs to be done, then have the machine work out what to execute. Eg declare dependencies and have Make build things, specify SQL query and have the optimiser fetch the data
- brianhorakh 4y agoAlso build tools in compositional scripts with good names
- AlexCoventry 4y agoAutomate figuring out how to do things from a machine-readable specification of the desired result.
- s3micolon0 4y agoI believe, by "Design everything you can to be declarative" runjake is talking about is above creating good abstractions that satisfy a particular use case, abstracting the user from the implementation details. Wikipedia defines Declaration programming as "In computer science, declarative programming is a programming paradigm—a style of building the structure and elements of computer programs—that expresses the logic of a computation without describing its control flow." [1] By decoupling a user from the low level imperative understanding of the system and focusing on the high level abstractions, if the interface is well designed, it enables the user to think at a higher level of abstraction and expands their boundaries in expressing what they want to achieve using the higher level constructs. One of the most famous declarative interface is "React.JS" which allows to think at the level of the "components" [2], while in acuity, it's abstracting the DOM from the user as a virtual DOM [3] level and performing reconciliation[4] internally for rendering to the actual DOM. But, as an end use, they don't really have to think about these implementation details and can just work with the "components" abstraction. Most user interfaces I have seen are abstracted in a declarative / markup language. The most famous declarative interface is SQL. In relation, I would also recommend reading this wonderful article about leaky abstractions by Joel Spolsky to understand the flipside of abstractions, in general: https://www.joelonsoftware.com/2002/11/11/the-law-of-leaky-abstractions/ https://www.joelonsoftware.com/2002/11/11/the-law-of-leaky-a... -- 1: https://en.wikipedia.org/wiki/Declarative_programming https://en.wikipedia.org/wiki/Declarative_programming 2: https://reactjs.org/docs/components-and-props.html https://reactjs.org/docs/components-and-props.html 3: https://reactjs.org/docs/faq-internals.html https://reactjs.org/docs/faq-internals.html 4: https://reactjs.org/docs/reconciliation.html https://reactjs.org/docs/reconciliation.html