Topics /

Software Engineering

The most popular blog posts about software engineering on Hacker News. 1,535 posts.

2024
662

Don't let dicts spoil your code

I restricted the use of dicts in my code to make it easier to follow and maintain. Here's my explanation of the benefits and advice on what you can use instead. Bonus point: what to do with all the legacy code when there's no time to eradicate all the dicts.

667

I'm not a fan of strlcpy(3)

strlcpy(3) is an OpenBSD function which is often hailed as a safer replacement for strcpy(3) and/or strncpy(3) . One of the obvious issues with strlcpy is that it's not safe if src isn't null-terminated. However, that's not the reason I don't like strlcpy. In fact despite knowing this, I used to think it was an okay…

672

Beating the Compiler

In modern times, everyone knows that writing assembly is a fool's errand: compilers are the result of literal engineer-centuries of work, and they know the processor much better than you do.

676

The search for easier safe systems programming

I've been involved in the Rust project in some form or another since 2016, and it's a language I'm very comfortable using. Many Rust programmers could say the same . But, if we take a step back and are honest with ourselves, we'd admit that the road to getting to that level of comfort was difficult.

681

The new APT 3.0 solver

APT 2.9.3 introduces the first iteration of the new solver codenamed solver3, and now available with the –solver 3.0 option. The new solver works fundamentally different from the old one. How does it work? Solver3 is a fully backtracking dependency solving algorithm that defers choices to as late as possible. It…

684

Stacking triangles for fun and profit

One thing you may have noticed about the trigonometric functions sine and cosine is that they seem to have no agreed upon definition. Or rather, different authors choose different definitions as the starting point, mainly based on convenience. This isn’t problematic or even particularly unusual in mathematics: as long…