3 ms·
> Functional programming has two simple, elegant design pattern that don't suck: noun and verb. I'd add adjectives (including adverbs), which is the metadata o
by vorg 13y ago
> Functional programming has two simple, elegant design pattern that don't suck: noun and verb.
I'd add adjectives (including adverbs), which is the metadata on the nouns and verbs.
- dscrd 13y agoInteresting point. I wonder if it would have an effect on how non-programmers view coding if programming language constructs were renamed like that.
- michaelochurch 13y agoAdjectives, to me, are more unresolved but I think Clojure's protocols appear to be close to the right answer. Adjectives are properties or classes of things, like Numeric or Closeable (with-open pattern) or Monad. The Haskell solution is type classes. The Java solution is OOP. The Erlang solution (fairly similar) is the actor model, which is the inspiration for OOP's principle of locally interpreted functions/methods (as opposed to global function definitions). OCaml's is functors, which are extremely powerful but hard for most people to use.
- vorg 13y agoPerhaps protocols/interfaces are like restrictive adjectival phrases, and metadata like non-restrictive. Just in case you don't know: Restrictive clauses limit the possible meaning of a preceding subject, whereas non-restrictive clauses tell something about a preceding subject, but do not limit its meaning. Example of restrictive use: The suspect in the lineup who has red hair committed the crime. Example of non-restrictive use: The suspect in the lineup, who owns a red car, committed the crime.