Agile Ajax

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: , , ,

Topics:

Leave a comment

Powered by WP Hashcash

About Pathfinder

  • We design and build extraordinary applications for companies looking to make the next great idea a reality.
  • learn more

Topics

WordPress

Comments about this site: info@pathf.com