Topics /

Software Engineering

The most popular blog posts about software engineering on Hacker News. 874 posts.

2019
663

Formatting Is Unreasonably Expensive for Embedded Rust

As a (late) part of the #rust2020 request, I wanted to talk about one of the paper-cuts that has become decently problematic for new and experienced users of Embedded Rust: The size costs of formatting in Rust today are unreasonably expensive for users of Rust on bare metal embedded systems. In particular there are…

679

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…

682

Let the callers of your API control allocations

This is a post about performance. Most of the time when worrying about the performance of a piece of code the overwhelming advice should be (with apologies to Brendan Gregg) don’t worry about it, yet. However there is one area where I counsel developers to think about the performance implications of a design, and that…

683

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…

687

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…