Is functional programming relevant to web development?

I've been seeing so much recently about functional programming and Clojure looks particularly interesting. While I 'understand' the basic description of what it is, I can't figure out how I would use it on a day to day basis as a web developer, if I can at all. A lot of what I have read focuses on the maths side of functional programming rather then typical programming situations found in regular OO.

Have I got the wrong end of the stick? Is functional programming totally un-related to web development? If not, are there any examples of it being used 'for the web'?


A few examples off the top of my head:

  • Yahoo! Store is powered by Lisp (originally named Viaweb prior to acquisition)
  • Reddit was fully prototyped in Lisp, although they switched to Python in 2005
  • Hacker News is written entirely in Arc (a Lisp dialect)

  • Functional programming matches web apps very well. The web app recieves a HTTP request and produces a HTML result. This could be considered a function from requests to pages.

    Compare with desktop apps, where we typically have a long running process, a stateful UI and dataflow in several directions. This is more suited to OO which is concerned about objects with state and message passing.


    我不明白为什么不这样做 - 只要您向浏览器提供符合标准的HTML,他们不会在意您用来生成它的内容,是一种功能性语言,命令式语言或训练有素的猴子。

    链接地址: http://www.djcxy.com/p/47730.html

    上一篇: Haskell和OCaml中的函子如何相似?

    下一篇: 函数式编程是否与Web开发相关?