Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is functional programming relevant to web development? [closed]

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'?

like image 727
Hates_ Avatar asked Nov 15 '08 02:11

Hates_


People also ask

Is functional programming relevant?

Advantages Of Functional ProgrammingIt helps us to solve problems effectively in a simpler way. It improves modularity. It allows us to implement lambda calculus in our program to solve complex problems. Some programming languages support nested functions which improve maintainability of the code.

What type of programming is used in Web development?

While there are many different programming languages, the most common ones used in web development are JavaScript, HTML, CSS, PHP, etc. JavaScript has a popularity of nearly 65% among developers worldwide, as per Statista.

Is functional programming still used?

Functional programming has been in existence for the last six decades, but so far, it hasn't ceased to overcome the general use of object oriented programming.

Does functional programming have a future?

Still, "functional programming is unmistakably the future," says Felix. "It can help make a large proportion of the current problems we have in software development disappear.” And it can even be used within established Java ecosystems.


2 Answers

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.

like image 61
JacquesB Avatar answered Sep 20 '22 02:09

JacquesB


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)
like image 34
Greg Case Avatar answered Sep 22 '22 02:09

Greg Case