Doug's Resume
OO Lexicon
Chat with Doug!
Recent Entries
You may also be interested in...

heaters
hotels boeken in 7 sec
Engagement Rings
Online Dating Australia




SURF'S UP!
You:
Your Web Site:
<< May, 2008 >>
SMTWTFS
123
45678910
11121314151617
18192021222324
25262728293031
Search Blog

ColdFusion Jobs
Recent Comments
Re: Promoting Family Unity: Lowering Your Utility Bills! (by Fernando Lopez at 5/07 10:12 PM)
Re: Why I Hate ORMs (a solicited rant) (by Richard at 5/06 10:56 AM)
Re: Why I Hate ORMs (a solicited rant) (by dougboude at 5/06 10:27 AM)
Re: Why I Hate ORMs (a solicited rant) (by Richard at 5/06 6:50 AM)
Re: Why I Hate ORMs (a solicited rant) (by Sean Corfield at 5/06 1:40 AM)
Re: Why I Hate ORMs (a solicited rant) (by Steve Bryant at 5/05 5:07 PM)
Re: Why I Hate ORMs (a solicited rant) (by dougboude at 5/05 4:36 PM)
Re: Why I Hate ORMs (a solicited rant) (by Mark Mandel at 5/05 3:52 PM)
Re: Why I Hate ORMs (a solicited rant) (by dougboude at 5/05 3:42 PM)
Re: Why I Hate ORMs (a solicited rant) (by Brian Rinaldi at 5/05 3:14 PM)
Categories
Archives
Photo Albums
Funnies (5)
Family (3)
RSS
Reciprocal Links

Powered by
BlogCFM v1.11

07 March 2008
What IS a Function, Anyway?
Function.
The word has given not just new coders wrinkled brows and vacant stares, but also most everyone who encounters the term initially. Though we programmers might tend to think  "function" only applies to us, in reality it crosses every boundary and therefore I believe that NOBODY should live one moment longer without being armed with a precise understanding of it. Here's what got me thinking about it...

Today as we were driving my step daughter home from school, I asked her what she was doing in math these days and she told me they were working with functions. It immediately brought to mind my first foray into Calculus taught by Mr. Musgrave, when "Eff of X" was a phrase I heard constantly yet was NEVER given the understanding of. Every single day I struggled to wrap my mind around what a function really was, what "Eff of X" was really saying, and never managed to until just a few years ago (hence I hobbled by with a mere C in that class). Now that I'm older and wiser, the term is no longer foreign to me and in fact is second nature, as I finally connected the dots between Calculus functions, Javascript functions, Coldfusion functions, and even the functions that occur in nature. What follows is my personal definition of what a function is, accompanied (as usual) by a colorful and simplistic analogy to help illustrate.

The Definition: A function receives something into itself, performs some kind of work on whatever the input was, and spits the results of that work back out. Period.

It can be a math function that accepts a value 'x', plugs it into some equation, and then returns the mathematical result; it can be a programmatic function that receives something into it...be it a numeric value, a string of text, an object, etc....and returns the results of the code it was told to execute. Ah, and here's the clincher, the missing link that will help ANYBODY, I mean even your TODDLER, to completely understand what a FUNCTION is:

Even your own BODY is a function! You give it some kind of input...let's say, a peanut butter sandwich. Your body performs some kind of WORK on that input (in our case, digestion), and VOILA! You get some output. In this case, a turd.

There is absolutely NO difference whatsoever between a calculus function, a programmatic function, the Human function, or even the myriad of individual functions that work in harmony within our own ecosystem. A function receives something in, performs some work on it, and gives something back.

Pass this tidbit on to everyone you know, even and especially your kids, so that perhaps when they too first encounter Mr. Musgrave's endless repitition of "Eff of X, boys and girls, EFF OF X!", they can avoid the mental anguish of trying to grasp something so simple and common sense, yet perpetuated (for some odd reason) as being so deep and abstract.

And now, if you choose to accept, your Assignment:
Find the nearest individual who you think would be least likely to understand what a function is (young or old), take two minutes to teach them the concept using their own body, their Play Doh Fuzzy Pumper Number 9, the oven, or anything else you can think of that they can relate to, and see if their retention of the definition isn't 100% every time you ask them thereafter.

Doug out  :0)



Posted by dougboude at 1:27 AM | PRINT THIS POST! |Link | 0 comments
Subscription Options

You are not logged in, so your subscription status for this entry is unknown. You can login or register here.

No comments found.

Name:   Required
Email:   Required your email address will not be publicly displayed.

Want to receive notifications when new comments are added? Login/Register for an account.

Time to take the Turing Test!!!

What letter comes one place(s) after the letter E?
Type your answer exactly four time(s) in the designated box.

Type in the answer to the question you see above:

Your comment:

Sorry, no HTML allowed!