Hacker News new | past | comments | ask | show | jobs | submit login

> 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.

Interesting point. I wonder if it would have an effect on how non-programmers view coding if programming language constructs were renamed like that.

I could teach a student with good language theory to program faster this way, but other students probably not...

Larry Wall designed Perl from a linguistic perspective. But I think it didn't make so much of a difference.

Adjectives, 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.

Perhaps 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.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact