3 ms·
Really, quite a few of these hold outside of Haskell as well. * "reduce the interactions between components by relying on pure interfaces" * use purely functi
by silentbicycle 17y ago
Really, quite a few of these hold outside of Haskell as well.
* "reduce the interactions between components by relying on pure interfaces"
* use purely functional data structures to model key parts of the world you're talking to. Model-driven design with easy to verify logic
* Avoid partial functions
Pure interfaces require you to declare all context, and it's arguably
all the context implicit in typical OO software that kills reusability.
As Joe Armstrong put it, "...the problem with object-oriented languages
is they've got all this implicit environment that they carry around with
them. You wanted a banana but what you got was a gorilla holding the
banana and the entire jungle."
* use types to encode the design into a machine checkable form
* picking a good data type (like a zipper) will make hundreds of unit tests meaningless -- improving productivity.
The point of static typing is to structure code in a
way that more assumptions can be expressed and automatically checked. A well-chosen
data structure brings with it all of its expected behavior.
* ensure components have 'axiomatic' interfaces -- reduce complexity by avoiding redundancy
* if at all possible ensure your core algorithms and logic are referentially transparent -- this will dramatically simplify maintainanace and QA effort
"Declarative programming clears the mind." - Sterling & Shapiro, _The Art of Prolog_
- loup-vaillant 17y agoSarcasm: Now we just have to convince those C++ programmers that they might want to change their programming style a bit. Resignation: Alas, most C++ code is done with premature optimization in mind, which throws many of those good principles out the window.