u/NeechooThe resident Python guyin r/ProgrammingLanguages • Recommends
'Declarative Thinking, Declarative Practice' - Kevlin Henney - a great talk about declarative programming
#declarativeprogramming#kevlinhenney#fizzbuzz
20K subscribers • 32 videos on Hallway • Conference channel
Intermediate. Assumes working knowledge.
50K views10 years ago1 recommendation
Software designProgramming languagesFunctional programmingDesign patternsSoftware architecture
Kevlin Henney explores the benefits of declarative programming, comparing procedural and declarative approaches using examples like Make and FizzBuzz.
: Start : Real start (end of meta talk) : 'Make' as a declarative language en DOT wikipedia DOT org/wiki/Make_%28software%29 : Reference to Fred Brooks' The Mythical Man-Month en DOT wikipedia DOT org/wiki/The_Mythical_Man-Month : Illiteracy and software developers. : FizzBuzz en DOT wikipedia DOT org/wiki/Fizz_buzz : Table-driven (instead of very redundant purely procedural code) : The collection pipeline solution : By search/replaces (Bash / Perl) : Stacks : Indirect reference to Bertrand Meyer's Eiffel book. Pre- /post conditions (asserts). en DOT wikipedia DOT org/wiki/Eiffel_(programming_language) en DOT wikipedia DOT org/wiki/Eiffel_(programming_language)#Design_by_contract en DOT wikipedia DOT org/wiki/Design_by_contract : Concurrency vs. pre- /post conditions 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 mainstream languages.u/NeechooThe resident Python guyin r/ProgrammingLanguages • Recommends