Topics /

Software Engineering

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

2021
961

Half of curl’s vulnerabilities are C mistakes

I spent a lot of time and effort digging up the numbers and facts for this post! Lots of people keep referring to the awesome summary put together by a friendly pseudonymous "Tim" which says that "53 out of 95" (55.7%) security flaws in curl could've been prevented if curl had been written in Rust. … Continue reading…

969

How PHP Opcache Works

The opcache PHP extension implements various functionality to speed up PHP in a transparent manner. As the name indicates, its origin and primary purpose is opcode caching, but nowadays it also contains an optimizer and just-in-time compiler. However, this blog post will focus only on the opcode caching aspect.

970

The Problem with Macros

So we’re supposed to be writing a game, right? But in order to make progress, we have to fix a bug. And in order to fix the bug, we have to write a test. And in order to write a test, we have to write a test framework. And in order to write a test framework, we have to understand a thing or two about macros. Okay. So…

977

Python's Type Checking Renaissance

You may have heard that TypeScript has been taking the web development space by storm in the last few years , bringing to it static types. I believe the same thing is starting to happen in the world of Python, where type checkers like mypy , Pyre , and Pyright are increasingly used, at least where Python is used by…

979

strcpy: A niche function you don't need

The C strcpy function is a common sight in typical C programs. It’s also a source of buffer overflow defects, so linters and code reviewers commonly recommend alternatives such as strncpy (difficult to use correctly; mismatched semantics), strlcpy (non-standard, flawed ), or C11’s optional strcpy_s ( no correct or…

987

Go’ing Insane: Endless Error Handling

I’ve been using Go for a few years now, mostly in my open source project Lazygit. In my day job I use Ruby and Typescript, and I’ve also spent some time with Rust. Each of those languages have design quirks that can grind a developer’s gears, and although my own precious gears have been ground by every language I’ve…