Top posts

Every blog post that took off on Hacker News, ranked by the votes of its best submission. 2,668 posts.

Any topic
2019
2071

A Fairly Fast Fibonacci Function

A common example of recursion is the function to calculate the $n$-th Fibonacci number: def naive_fib(n): if n < 2: return n else: return naive_fib(n-1) + naive_fib(n-2) This follows the mathematical definition very closely but it’s performance is terrible: roughly $\mathcal{O}(2^n)$. This is commonly patched up with…

2077

Tilton

In 2000, the programmatic browser differences were perplexing, so I made a tool to help manage the problem. I started with something similar to ecomcon (see How JavaScript Works , Chapter 23). I would have special markers in the source that designated sections of code that would only be delivered to particular…

2079

I’m Leaving IBM

Today is my last day at IBM. If you’ve been following along, IBM bought my startup Resilient Systems in Spring 2016. Since then, I have been with IBM, holding the nicely ambiguous title of “Special Advisor.” As of the end of the month, I will be back on my own. I will continue to write and speak, and do the occasional…

2090

Software Is Hard (2007)

"Software is hard," reads the quote from Donald Knuth that opens Scott Rosenberg's Dreaming in Code . The 400 pages that follow examine why: Why is software in a never-ending state of crisis? Why do most projects end up horribly over-budget or cancelled or both? Why can't we ship code without bugs? Why, everyone asks…

2098

Unintuitive JSON Parsing

Despite the goal of JSON being a subset of JavaScript — which it failed to achieve (update: this was fixed ) — parsing JSON is quite unlike parsing a programming language. For invalid inputs, the specific cause of error is often counter-intuitive. Normally this doesn’t matter, but I recently ran into a case where it…