Rule #1 Of Programming Tutorials

Joel Spolsky and Jeff Atwood just opened up Stack Overflow to the public. SO is a Q&A website for technical questions, with a Digg-style rating system that will (hopefully) do for programming questions what Google did for search: get the best answers in front of you with almost zero effort.

I was thinking about Stack Overflow this evening as I fired up the F# interactive shell and started on some little demo scripts to help familiarize myself with the F# syntax, which, despite the name, has no homologic relationship to my beloved C#.

This tutorial to F#, written by Dr. Jon D. Harrop, starts off with a simple Fibonacci number generator that shows off some of the recursion and pattern-matching syntax of F#:

/// The Fibonacci function
let rec fib = function
| 0 | 1 -> 0
| n -> fib(n-1) + fib(n-2)

See anything wrong? What’s the second number of the Fibonacci sequence? Hint: it’s not zero.

The funny thing is I just bought Dr. Harrop’s book, F# for Scientists, and am thoroughly enjoying it (through about 60 pages thus far). So it’s a bit of a head-scratcher why his primary online tutorial for F# contains such an obvious error.


1 Response to “Rule #1 Of Programming Tutorials”

  1. 1 Kathleen September 16, 2008 at 9:29 pm

    Hi Anthony,

    Jomo emailed Dr. Harrop about the error.

    Hope all is well,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

TwitterCounter for @anthonyrstevens
Add to Technorati Favorites

RSS Feed

View Anthony Stevens's profile on LinkedIn

%d bloggers like this: