- We design and build extraordinary applications for companies looking to make the next great idea a reality.
- learn more
Higher Order JavaScript
In computability theory the Church–Turing thesis (also known as Church's thesis, Church's conjecture and Turing's thesis) is a hypothesis about the nature of computers, such as a digital computer or a human with a pencil and paper following a set of rules. The thesis claims that any calculation that is possible can be performed by an algorithm running on a computer, provided that sufficient time and storage space are available. The thesis cannot be mathematically proven; it is sometimes proposed as a physical law or as a definition.
Informally the Church–Turing thesis states that our notion of algorithm can be made precise and computers can run those algorithms. Furthermore, a computer can theoretically run any algorithm; in other words, all ordinary computers are equivalent to each other in terms of theoretical computational power, and it is not possible to build a calculation device that is more powerful than the simplest computer (a Turing machine). Note that this formulation of power disregards practical factors such as speed or memory capacity; it considers all that is theoretically possible, given unlimited time and memory.
The thesis, named after Alonzo Church and Alan Turing, was first proposed by Church in 1934, then referencing the class of λ-definable functions, but did not gain acceptance until Turing defined the equivalent but much more convincing Turing-computable functions. -- From the Wikipedia
Back in college I took a graduate course in Recursive Function Theory. I studied Mathematics in college, am the son of two mathematician, and have a great love of complex problems with elegant solutions. So I enjoyed the heck out of this course. Lots of nifty little puzzles and mind benders. Translate these concepts, though, to practical software engineering through languages like ML and Haskell, and I break out in hives. It is too hard for most lunch pail developers to understand, and it causes too many unnecessary problems in common software engineering scenarios. That's my bias and I'm entitled to it.
Still, it is important to be exposed to these concepts as a developer, as some problems are definitely in functional programming's power zone. Enter Higher Order Perl, a book by Mark Jason Dominus that aims to educate the reader on the use of Higher Order Functions in Perl.
Higher-Order Perl is about functional programming techniques in Perl. It's about how to write functions that can modify and manufacture other functions.
Why would you want to do that? Because that way your code is more flexible and more reusable. Instead of writing ten similar functions, you write a general pattern or framework that can generate the functions you want; then you generate just the functions you need according to the pattern. The program doesn't need to know in advance which functions are necessary; it can generate them as needed. Instead of writing the complete program yourself, you get the computer to write it for you.
If this sounds a bit like the proverbial "genetic, neural network, self-modifying code," hold on. Successful and productive software design is all about abstraction. Object orientation is just one kind of abstraction, functional programming provides another.
Inspired by the Perl title, others have written online works on Ruby and JavaScript. I highly recommend the JavaScript work by Sean Burke. As I said before, even if you don't head down the road of functional programming in JavaScript, it is still a good thing to periodically expose yourself to some new and different ideas.
Technorati Tags: ajax, javascript, higher order functions, church's thesis
Topics: Javascript
Leave a comment
About Pathfinder
Recent
- Pimp my jQuery: Five plugins to replace the features Prototype and Scriptaculous users expect
- Thanksgiving 2008: What We’re Thankful For (In Rails)
- iPhone SDK: Testing with TextMate & GTM
- GWTQuery - JQuery-like Syntax in GWT
- Ask the readers: How do I fire native browser events in Prototype.js?
- News Rollup for the Week of November 17, 2008
- Rails ThreatDown!
- Automated Deployments Rock
- Bandwidth profiling Flex projects and more with Charles
- iPhone SDK: UIViewController Testing & TDD
Archives
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- June 2006
- May 2006
- April 2006
- March 2006

