what are the benefits of learning a functional programming?
I am learning scala which a mix of both programming model (OO and functional) I am wondering what are the benefits of functional programming language.
I am confused on what approach I should take, mainly its about what components I should keep functional and which ones I should code in a regular OO way.
I was trying to write a simple chat server in scala. ( I may be wrong but I guess chat server kind of application may not require the complexity / constructs scala has to offer)
Posted Apr 7, 2013, 3:11 PM UTC
Sure, most programs don't require every single feature in Scala, or C++, or a lot of other languages...
One example is the pattern matching.
http://www.scala-lang.org/node/123:
This can be used to avoid things like null pointer exceptions, if you use Option instead of nulls.
The message passing between local and remote nodes in Scala is also pretty neat. You should be able to write a chat server with less code in Scala than in any other language, since you really don't have to deal with the networking stuff, if this is just over a lan.