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.