[erlang-questions] Similarities between web programming and functional programming

黃耀賢 (Yau-Hsien Huang) <>
Mon Jun 14 17:27:38 CEST 2010

On Sun, Jun 13, 2010 at 4:19 AM, Nilanjan Raychaudhuri <
> wrote:

> Hi all,
> As a newbie into functional programming I am curious to know how functional
> programming style fits into building web applications? And how it
> compares to building web apps in Ruby or Java.
> Any pointer to article/literature will be helpful.
> Thanks
> Nilanjan

In general, subjects in Functional Programming may be:
* Value is function, and anything is value.
* Immutable value.
* Lazy evaluation strategy, and what about that when some but not all
arguments are
  given to a function you get another function. (I forgot terms about the
later one.)
* Higher order function.
* Pure function, or imperative, with side-effect.

How does it fit Web Programming? In my opinion,
1. Anything is value, yes, some techniques and paradigm of Web Programming
   as that about XML technologies follow this style. XSLT can be written
   Parts of web technology are not Software Engineering any more but Data
2. Immutable value means that program runs without depending on state.
   .Net Framework tried making the stateless Web environment stateful. In
   programming, when you send a different request, the program generates
   set of values instead of making a response with a modified state.
3. Partial application of function arguments is powerful than other
programming styles.
   Consider a web form as a function that it accepted some of it arguments
   `became' another function, that is, another web form or the original form
   some arguments and waiting for other arguments.
4. High order function plays role of glue. Web Programming is performed in
   you and your colleagues write each's programs, and you put those
   and those works as a whole. High-order function do somethings similarly:
   Functions may be glued by some function, and those work as a whole while
   each can be run separately for the debugging purpose.

You post the question in Erlang mailing-list. About Erlang, its
Programming style is more feasible for Web Programming and more discussible
than functional programming features.

Best Regards,
Y.-H. H.

More information about the erlang-questions mailing list