I recently came across these free video recordings
of MIT programming lectures. They are a very succinct and engaging introduction to declarative programming. Declarative programming languages like Lisp, Prolog, Haskell and Curry treat all data, 'normal' primitive values, and code (functions) in your program the same, as metaphysical objects with a name. The implication of this is that you can program on a much higher level, do more with less code, and with more abstraction and separation.
In the second hour or so, they already explain something that is pretty hard to do in your average C++/C#/Java/Pascal/whatever (imperative) programming language.
These might be from the eighties, and they use Lisp as their language, but please believe me when I say that if you watch and understand that whole course, you just learned enough to call yourself a Real Programmerâ„¢. If anything, it is a wonderful introduction to the power of declarative languages, where functions are first class citizens and can be used, changed and passed like variables to other functions as if they were just a piece of data. And the wonderful concise syntax Lisp has (bracket overload notwithstanding), really gives you insight into what a program is and how it gets its meaning.
If anything, you can watch it for the historical value. How some guy with a goatee and a brooch (tie ornament?) at the top of his business shirt (?! right there in lecture 2b at 0:37:48) is surprised you would want to defer designing the specifics of your program until you really need to (instead of designing it all at once and then implementing it
), how the teacher has a different flower arrangement on his desk each day, how they had a digital presentation system even back then that does about everything powerpoint can, how memory 'complexity' was just as big a deal as time complexity and typical eighties hair and dress (seriously, the attendants look like they just walked off the set of Revenge of the Nerds).
Anyone who paid good attention to math in high school can follow this course. This is unfortunately so because they mostly use examples from the mathematical world. The programming itself is detached from actual math, since declarative languages do not have the need to use primitive mathematical operations as much as your average language.
I wish someone would make a course like this with more engaging examples, like common combinatorial or statistics questions for researchers, things that matter to business people or binary logic and set problems. You can breathe life into every theoretical model ever thought of by transcribing it into a declarative language, so why stick to math, where people often do not see the direct use of it.
You then have powerful general
metaphysical tools at your disposal to transform, test and simulate your model. There are ways of looking at data that see patterns in gene sequences as good as they do in radio signals, weather readings or population statistics. Unfortunately they are reinvented every time someone from those fields needs to solve a problem with them and written again and again in an imperative language, or even worse, a spreadsheet or statistics program, where the method is hard to abstract from the data it works on.
Tell us how you see the future of declarative programming. Do you have experience in a declarative language? Why is it exactly that these languages have trouble with some things like real time user interaction?