What is declarative thinking? In an imperative approach to programming, we give commands to the computer. Why should we think more descriptively, and what does that mean in practice?
We interviewed Kevlin Henney at Devoxx Belgium 2016.
For the full talk at Devoxx Belgium 2016, see below:
Declarative Thinking, Declarative Practice
“Do this, do that. Coding from assembler to shell scripting, from the mainstream languages of the last century to the mainstream languages now, is dominated by an imperative style. From how we teach variables — they vary, right? — to how we talk about databases, we are constantly looking at state as a thing to be changed and programming languages are structured in terms of the mechanics of change — assignment, loops and how code can be threaded (cautiously) with concurrency.
“Functional programming, mark-up languages, schemas, persistent data structures and more are all based around a more declarative approach to code, where instead of reasoning in terms of who does what to whom and what the consequences are, relationships and uses are described, and the flow of execution follows from how functions, data and other structures are composed. This talk will look at the differences between imperative and declarative approaches, offering lessons, habits and techniques that are applicable from requirements through to code and tests in Java and other languages.”