Mittwoch, 19. September 2012

Development Styles in Functional Programming

Functional programming is programming with functions, obeying referential transparency.

Data Driven Development with Clojure
Use functions and fundamental data structures provides by the language (List,Vector, Map, Set)  to express intended structure and behavior.

Seemingly simple in its fundamental constructs this avoids  classes or class hierarchies or even types. But to work effectively here the standard data structures and their functions should be well known.
I wonder in which way this differs from the usual development process in erlang?

Type driven Development with Scala or Haskell
Encode the data model and relations into ADTs[2] as types and use functions together with category theory abstractions to express intended structure and behavior.
Pro/Contra:
If Data is encoded with ADTs the behavior must stil lbe described with CT Abstrations so its necesarry to know that beforehand

I can see interesting tradeoffs from varying degrees comparing these approaches. It is also interesting to contrast this with classed based design from languages like java or prototype based ones like JavaScript.

[2]http://en.wikipedia.org/wiki/Algebraic_data_type
similar: http://debasishg.blogspot.de/2010/09/domain-models-thinking-differently-in.html

Keine Kommentare:

Kommentar veröffentlichen