|
|
|
|
![]() ![]() |
Jul 21 2005, 09:14 PM
Post
#1
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 4 Joined: 19-July 05 Member No.: 7,246 |
two years ago i have discoverred function programming. i'd like to shortly discuss it here and, maby, encourage some of you to try your skills writing functions.
when programming imperatively, programmers often think of solving the problem in language categories. here i'd use an array, here i could use a pointer etc. funtion programming does not give programmer such tools. even more - thers is no such thing as variable. function programming was invented by mathematicians. it's very simmilar to mathematical modelling of universe. solving a problem - writing an algorithm, is to define some absrtact form from simple (mathematical) objects, like numbers, sets, functions. to show you some great abilities function programming gives the programmer it's good to think about everything as a function. even integers are functions! (please refer to Church numbers). now you can mix everything with everything and what you get might be also anything. function operating on funtions giving in result a function is common. in my opinion, what's most cool when programming functions, is that code you create is clear and easy to understand. it makes debugging very simple. although solving a problem with functions might take a bit more time than imperatively. but you don't spend time on debugging. For instance it took me just an hour to write from a scrach AVL trees and test them. In C or C++ it would take at least twice that time. if i interested you just a bit please refer to: http://caml.inria.fr/ http://homepages.inf.ed.ac.uk/wadler/guide.html This post has been edited by microscopic^earthling: Nov 8 2005, 03:41 PM |
|
|
|
Nov 8 2005, 11:02 AM
Post
#2
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 9 Joined: 21-April 05 Member No.: 4,198 |
Functional programming is indeed very nice. Also, it's now becoming a lot more useful with the introduction of F#, my current language of choice, that allows one to do functional programming (basically ocaml) in the .NET framework allowing you to link it up with everything else (including, for example, P#, a prolog interpreter for the .NET framework, allowing you do to predicate logic inference from a functional programming language :-)
Also, if you'd like to experiment to see what functional programming's about in a fun environment, I refer you to http://web.comlab.ox.ac.uk/geomlab/ |
|
|
|
![]() ![]() |
Similar Topics
| Topics | Topics | |
|---|---|---|
|
|
|
|
Lo-Fi Version | Time is now: 12th October 2008 - 09:56 AM |