What then, is b?
secretGeek .:dot Nuts about dot Net:.
home .: about .: sign up .: sitemap .: secretGeek RSS

What then, is b?

(This was going to be an article about how impossible it is to design one language that has all my favourite features. But instead, became a scene from "A Coder's Edition of Saw.")

You wake up, in unfamiliar surroundings.

You must've experienced some kind of memory loss because you have no idea how you got to where you are. Your forehead is brittle with dried blood.

In front of you is a computer screen, and on the screen it says:

a = Add(2,3);

//a is 5.

b = Add(2);

//what is b?

Intriguing. What is b?

Because you're uncertain of the language in question, you can't be sure.

It could be that Add is an overloaded function, in which case b would be an integer. Its exact value is anyone's guess.

Or it could be that Add has an optional second parameter. Again b would be an integer, though its value could be anything.

It could be that the code refuses to run. The missing parameter is a deal breaker.

But you look at the tattoo on the back of your hand, the 11th letter of the greek alphabet, and you are certain.

What then, is b?





'Tommy' on Sun, 18 Jul 2010 12:20:32 GMT, sez:

b is a function that adds 2 to its argument.



'Richard Mason' on Sun, 18 Jul 2010 12:27:20 GMT, sez:

I thought it was more the smell of vindaloo on his breath that gave it away.



'Huseyin Tufekcilerli' on Sun, 18 Jul 2010 12:30:08 GMT, sez:

b is 42



'OJ' on Sun, 18 Jul 2010 12:31:29 GMT, sez:

One side of me says it's a partially applied function waiting for a number to add to 2.

The other side of me is telling me to stop playing spin the bottle with Neo.



'kokokrunch' on Sun, 18 Jul 2010 13:15:32 GMT, sez:

b is 2



'Shalom Craimer' on Sun, 18 Jul 2010 14:05:23 GMT, sez:

"the 11th letter of the greek alphabet" ? That's a heavy-handed hint, sir!

Thanks for the laugh - that was fun!

(The article almost makes me yearn for a Zork-style story about a programmer coming-of-age or something.)



'tarun' on Sun, 18 Jul 2010 20:42:40 GMT, sez:

I am with tommy on this one:

eleventh letter of greek alphabet is lambda.
hence applying lambda calculus (in particular currying) and we can see that b is a function that is just curried form of add(x,y) where b adds 2 to its argument.



'pizza' on Sun, 18 Jul 2010 23:01:32 GMT, sez:

> let add x y = x + y
> add 2 3
5
> :type add
add :: (Num a) => a -> a -> a
> :type add 2
add 2 :: (Num t) => t -> t
> :type add 2 3
add 2 3 :: (Num t) => t



'Code Rant' on Fri, 23 Jul 2010 09:25:05 GMT, sez:

You've been smoking that Haskell crack again.



'free promo codes' on Sat, 31 Jul 2010 14:42:21 GMT, sez:

yes as you said its difficult to understand any unknown language and its true as well that all features cant be obtained in the same langauge




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