Fabulous Adventures In Coding

Eric Lippert's Blog

Recursion, Part Zero

I’ve mentioned recursive programming techniques several times over the years in this blog (Topological Sort, How Not To Teach Recursion, Fibonacci Challenge, Recursion and Dynamic Programming, Sometimes Breadth Is Better Than Depth, and probably a few others).  A lot of developers, particularly those without a formal education in computer science, are still pretty vague on this weird idea of functions that call themselves. 

If you’re interviewing at Microsoft for a development position you can expect that at least one person will ask you a whiteboarding question that involves some kind of recursive problem. This isn’t because we’re a bunch of architecture astronauts or theory wonks, it’s because if you want to be a dev here, recursion is simply one of the tools that you have to have in your toolbox. We use recursive data structures and algorithms quite a bit, and people are expected to know how they work.

I’d therefore like to take this opportunity to do a series on some of the theory and practice of writing recursive and recursive-like functions. I want to show that (a) they're not as mysterious as they seem, but (b) that they are potentially dangerous, and (c) there are some absolutely crazy-but-fun techniques for turning a recursive program into a nonrecursive program. Hopefully by the time we're done here your head will hurt, but hey, it builds character.

I'm going to get as much of this done as possible and queued up, because I'm going to go dark shortly. I'm getting married in less than two weeks! Between getting ready for that and finishing up stuff at work, I'm going to be swamped. (And you'd better believe I'm not blogging about recursive programming techniques from my honeymoon.)  I'll be back in late August and things should pick up then.

Published Monday, July 25, 2005 3:00 AM by Eric Lippert

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

nksingh said:

Congratulations, and thanks in advance for this series.
July 25, 2005 9:04 AM
 

Ben A L Jemmett said:

Hmm, you mean you'll have something more interesting to do on your honeymoon than blog about recursive programming techniques? Intriguing!
July 25, 2005 9:05 AM
 

Eric Lippert said:

I mean that I'll have no access to computers. We hope to spend most of our honeymoon on a cruise ship with a highly trained staff bringing us another glass of mango juice -- which is less interesting, but a whole lot more relaxing than, say, work.
July 25, 2005 10:37 AM
 

Neyah said:

What? You mean there isn't a publicly accessible wireless access point for your laptop that goes out through a satellite uplink? For shame!
July 25, 2005 2:13 PM
 

baljemmett said:

Now, see, that's the sort of relaxation I could do with! I was on holiday for a week recently; the boss promised to leave me alone, and until the penultimate day he did. Luckily he only disturbed me to arrange a site visit for the day after my return...

[I wonder how this form knows my URL on this machine but not in the office? Guess I'll find out if I'm logged in or something if/when this posts!]
July 25, 2005 2:42 PM
 

notgartner.com: Mitch Denny's Blog said:

July 29, 2005 12:41 AM

Leave a Comment

(required) 
(optional)
(required) 

  
Enter Code Here: Required
Submit

About Eric Lippert

Eric Lippert is a senior developer on the Microsoft C# compiler team. Before that he worked on the framework of Visual Studio Tools For Office. Before that, he worked on the compilers, runtimes and tools for VBScript, JScript, Windows Script Host and other Microsoft Scripting technologies. He lives in Seattle and spends his free time editing books about programming languages, playing the piano, and trying to keep his tiny sailboat upright in Puget Sound.

This Blog

Syndication


© 2010 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker