Anonymous Methods: Now that's a dumb name!
secretGeek .:dot Nuts about dot Net:.
home .: about .: sign up .: sitemap .: secretGeek RSS

Anonymous Methods: Now that's a dumb name!

This has always bothered me and I've never quite put my finger on it until now.

I love anonymous methods (in .net 2.0+). I've over used them, sure. I've under used them, too. And I've gotten all too excited about them.

But the name is so very wrong. It puts the emphasis in all the wrong places. Anonymous, hey? Well what've they got to hide?

Consider this chunk of code:

Dim Result as Integer = Math.Sqrt(16)

What is '16' in the above snippet?

Well, it's a value. And it gets passed to a parameter. Simple. But a different answer we could give -- if we wanted to bamboozle people right at the start -- would be:

"Well in this case '16' is an anonymous variable."

A what? A huh? A... well.. you're just trying to sound clever aren't you?

Calling it an 'anonymous variable' is only useful if you are the damn fool who's stuck with the job of writing a compiler for the underlying language. It doesn't help the regular johnny coders like you and me who code in the damn language every day. (unless the build is broken that day of course.) (or there are too many meetings that day.) (or the keyboards are wrong.)

Similarly -- an 'anonymous method' is really just a 'code block', or an 'immediate method', or an 'inline method.'

The point isn't that it is anonymous, the point is that it's a method.

Maybe the term could be "throwaway method" -- as in, it's a method that's not designed for re-use. You just use it in this one place and then throw it away.

Ah, rant complete.

Meanwhile my VS2008 beta has just expired, and my msdn subscription has just run out. I've got some serious vs2008 home-work to do in the next few days... so this is bad stuff. Bad i tell ya!





'god's dog' on Sat, 15 Mar 2008 11:58:18 GMT, sez:

anonymous variable! very funny!

every line of code could also be called an anonymous statement.

regarding msdn subscription maybe u need 2 find a dodgy russian to help u out



'The Other Guy' on Sat, 15 Mar 2008 12:05:47 GMT, sez:

Anonymous means "without name". What's wrong with that? Regular functions are chunks of code with a name. Anonymous functions are chunks of code without name. I don't see anything wrong in that denomination.



'jonah' on Sat, 15 Mar 2008 12:28:47 GMT, sez:

Ah - good point.

Select queries in SQL could be said to return "Anonymous Tables"

@The Other Guy

>"Regular functions are chunks of
>code with a name"

Maybe regular functions should be called "Named Functions" and 'anonymous functions' just called 'functions'.



'Steve B.' on Sat, 15 Mar 2008 16:03:22 GMT, sez:

The better term is likely something more like either "in-line method" or "temporary method" but sadly we are stuck with "anonymous methods" for good now.

Cat == out of bag, Genie == out of bottle, Pandora's box == opened :)



'MattyT' on Sat, 15 Mar 2008 22:49:01 GMT, sez:

"Well in this case '16' is an anonymous variable."

I think of it as an integer of value 16. There's nothing anonymous about it in my (admittedly warped) brain.

And I don't really have a problem calling it an anonymous method. Consider what the fundamental difference is between these and regular methods. It's not that they are inline (regular methods can be too), immediate (they're not) or a code block (like all fns), it's that they have no defined name.

You can always call 'em lambdas... :)

Anyways, as always, thanks for making me think but I'm sticking with "anonymous methods"!



'Eber Irigoyen' on Sun, 16 Mar 2008 00:08:25 GMT, sez:

kinda late in the game to be ranting about that, I agree with the other guy

'Anonymous means "without name". What's wrong with that?'



'lb' on Mon, 17 Mar 2008 00:03:19 GMT, sez:

yeh alright -- i'll concede on this one. Anonymous methods *is* a good enough name.

Another possibility i've come up with is "ad-hoc methods"



'Waterbreath' on Mon, 17 Mar 2008 15:09:21 GMT, sez:

How do you feel about "function expressions" or "function literals"?

Those are the terms that I typically use when I am explaining to someone what an "anonymous method" is. You can substitute "method" for "function" if you like, but I prefer "function".



'Ben' on Mon, 17 Mar 2008 16:18:20 GMT, sez:

Ditto on "function literal" or "method literal".

You don't call character literals anything else do you?




name


website (optional)


enter the word:
 

comment (HTML not allowed)


All viewpoints welcome. But the right to delete any post for any reason is reserved. Don't make me do it. Comments may be republished, emailed to your loved ones or printed and used as toilet paper. Who reads this legal bit anyhow?

TimeSnapper is a life analysis system that stores and plays-back your computer use. It makes timesheet recording a breeze, helps you recover lost work and shows you how to sharpen your act.

TimeSnapper won last year's Developer Competition at Larkware.com, and is used by over 10,000 people.

Articles

JSON Query Languages: 5 special purpose editors JSON Query Languages: 5 special purpose editors
What then, is b? What then, is b?
SQLike: A simple editor SQLike: A simple editor
Yet Another BizPlan Generator. Yet Another BizPlan Generator.
HOT GUIDS: A hot or not site for guids HOT GUIDS: A hot or not site for guids
How does life get better? One tiny hack at a time. How does life get better? One tiny hack at a time.
24 things to do, and 100 things *not* to do (yet) for building a MicroISV 24 things to do, and 100 things *not* to do (yet) for building a MicroISV
Venture capital won't kill Jeff Atwood, it will only make him Jeffer. Venture capital won't kill Jeff Atwood, it will only make him Jeffer.
A handy workflow image for newbie mercurial users A handy workflow image for newbie mercurial users
Fractal Feedback, a diversion into recreational programming Fractal Feedback, a diversion into recreational programming
Hump-Jumping: How the Education of Computer Science can be Saved, err, maybe. Hump-Jumping: How the Education of Computer Science can be Saved, err, maybe.
Suggested User Experience Improvements for DiffMerge Suggested User Experience Improvements for DiffMerge
SQL Style Extensions for C# SQL Style Extensions for C#
The Movie Hollywood (And My Wife) Doesn't Want You To See: Weekend at Jacko's The Movie Hollywood (And My Wife) Doesn't Want You To See: Weekend at Jacko's
Sysi: the ultimate administrators toolkit Sysi: the ultimate administrators toolkit

Archives .: secretGeek :: Complete Archives
TimeSnapper -- Automated Screenshot Journal TimeSnapper.com    
Version 3.3: true productivity boost

Next Action NextAction
Managing the top of your mind

World's Simplest Code Generator (html edition) World's Simplest Code Generator

25 steps for building a Micro-ISV 25 steps for building a Micro-ISV
3 minute guides -- babysteps in new technologies: powershell, JSON, watir, F# 3 Minute Guide Series
Universal Troubleshooting checklist Universal Troubleshooting Checklist
Top 10 SecretGeek articles Top 10 SecretGeek articles
ShinyPower (help with Powershell) ShinyPower
Now at CodePlex

Realtime CSS Editor, in a browser RealTime Online CSS Editor
Gradient Maker -- a tool for making background images that blend from one colour to another. Forget photoshop, this is the bomb. Gradient Maker


[powered by Google] 


How to be depressed How to be depressed
You are not inadequate.



Recommended Reading

The Best Software Writing I
The Business Of Software (Eric Sink)

Recommended blogs

Jeff Atwood
Joseph Cooney
Phil Haack
Scott Hanselman
Julia Lerman
Rhys Parry
Joel Pobar
OJ Reeves
Eric Sink

Aggregated Links

proggit
dzone
hacker news
dot net kicks

Human Link Machines

interesting finds
a continuous learner's weblog
arjan's world
weekly link post

LinkedIn profile
LogEnvy - event logs made sexy
ShuffleText - fuzzy search for .net
PC Smart Buys - Computer Hardware in Australia
 
home .: about .: sign up .: sitemap .: secretGeek RSS .: © Leon Bambrick 2006 .: privacy

home .: about .: sign up .: sitemap .: RSS .: © Leon Bambrick 2006 .: privacy