The Artima Developer Community
Sponsored Link

Artima Developer Spotlight Forum
Will Functional Programming Go Mainstream?

61 replies on 5 pages. Most recent reply: Aug 16, 2006 10:50 AM by Alex Fabijanic

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 61 replies on 5 pages [ « | 1 ... 2 3 4 5 ]
Terje Slettebø

Posts: 205
Nickname: tslettebo
Registered: Jun, 2004

Re: To what extent do you think functional programming will become more mai Posted: Aug 15, 2006 1:33 PM
Reply to this message Reply
Advertisement
> Javascript is an excellent language for functional
> programming, but it really should have a functional style
> standard library, and sugar for lambda's.

Yes, I agree that JavaScript is a quite well-designed language, with a somewhat unknown capability for functinal programming (http://www.crockford.com/), and it does lambdas and closures nicely (even if you might "sugar" the lambda syntax even more, as you say).

However, it doesn't have native support for currying, although it can be done (http://www.svendtofte.com/code/curried_javascript/). I guess that's what I was thinking of regarding higher-order programming. You can indeed pass and return functions to/from functions.

> I agree about Java though ;-)

What, isn't anonymous inner classes a nice hack^H^H^H^Hfeature? :)

Alex Fabijanic

Posts: 71
Nickname: aleksf
Registered: Aug, 2006

Re: Will Functional Programming Go Mainstream? Posted: Aug 16, 2006 10:50 AM
Reply to this message Reply
> If languages had the
> standard functions to do the most common things on
> collections already built in, then the few times when you
> had to use function pointers in C or functors in Java to
> define some custom operation would not be such a big deal.

Ever heard of a language named C++? STL anyone?

Few other points for this discussion in general:

Functional programming not only has future, it also has past and present, alongside objects and generic programing (please, do not mix Java generics here - Sun got stuck in backward compatibility issues and the best they could come up with under the circumstances was angle-bracketed cast syntax dubbed "generics").

A well-balanced and thought out approach is called multi-paradigm programming and is very well explained in this FAQ:

http://www.research.att.com/~bs/bs_faq.html#multiparadigm

Back to functions, here is another well-explained and valid argument for functions:

http://www.ddj.com/dept/cpp/184401197

The above article explains how and when non-member functions can actually improve encapsulation.

In the end, let me say that it does not cease to amaze me how crowd gets pulled around by either marketing machines with a technology "de jour" - the most recent example being OO (Objects Only), or religious language-zealotry groups about exclusive and superior qualities of certain programming styles regardless of circumstances.

There are good and bad things about any mainstream programming style. The art is to find the optimal balance between them and succesfully apply it.

Flat View: This topic has 61 replies on 5 pages [ « | 2  3  4  5 ]
Topic: Geir Magnusson on Open Source Java Previous Topic   Next Topic Topic: Cameron Purdy on Dealing with Failure

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use