Josh Jersild
banner
joshjers.drilian.com
Josh Jersild
@joshjers.drilian.com
I've been programming for way too long
Also sometimes I write or perform music
Mostly I talk about random bullshit
(he/him)

https://drilian.com/
https://cathoderetro.com/
https://procyongame.com/
https://www.youtube.com/@Drilian
Wash it down with a cold glass of sarcophagus juice
December 22, 2025 at 6:14 AM
One of my old phones would consistently correct "and" to "AMD" (all caps)

It felt like a brand deal gone wrong lol
December 21, 2025 at 10:56 PM
imo unit tests are great for utility classes and functions that are general, that work well in isolation (i.e. you don't have to mock up any bullshit to test them). Anything past that, I'm less a fan.

...still hate writing the tests though 🙃
December 21, 2025 at 9:30 AM
I'm with you on one point, though: when it comes to game systems, those typically aren't something that I would unit test, as they tend to truly rely on their interactions with other systems. Instead I'd do what you're suggesting: lots of carefully-chosen asserts and checks throughout the game code
December 21, 2025 at 9:29 AM
...and of course, that particular one was only a problem much later when the pointer was used (because it was freed but the smart pointer thought it was still alive), so it was a bit of a pain to track down.

A targeted unit test for that case would have caught it early and saved me much pain.
December 21, 2025 at 9:28 AM
For instance, in one project years ago I had a standard intrusive smart pointer class (based on AddRef/Release so it works with COM object because DirectX), it turned out there was a bug in the move assignment operator with an unexpected free that was there for *years* before I happened to hit it
December 21, 2025 at 9:26 AM
The problem there is that if you have a codepath in there that hasn't been exercised (especially if you *think* it has already), and then you add game code that suddenly uses it... well, I've spent a lot of time trying to debug the *new game code* instead of the *older library code* before realizing
December 21, 2025 at 9:24 AM
Also possibly I have too broad an idea of what constitutes a "unit test" vs whatever other kinds of tests there are
December 21, 2025 at 8:59 AM
basically, I think, anywhere the API surface is likely to remain stable, the internal implementation doesn't matter, and you don't have to do all sorts of weird bullshit poking into the internals to write the tests.

Anytime a unit test pokes into implementation details that's a red flag
December 21, 2025 at 8:58 AM
There are places where unit tests are useful, and places where they're not.

For instance, if you're building a core library (think: an STL) it can be really useful to have a suite of tests for that type of utility code...and those classes/functions should be stable, ideally
December 21, 2025 at 8:57 AM
I don't want the real answer I just want the funny version 😅
December 21, 2025 at 8:55 AM
at least they acknowledge he is 100% gonna be on the hell road
December 21, 2025 at 6:24 AM
It should just be a font ligature and not a whole-ass separate thing
December 17, 2025 at 8:49 PM
C'MON
December 17, 2025 at 3:13 AM
what if instead we just spend 70 million on trying to make people feel bad
December 16, 2025 at 7:59 AM
I love that not only can you see how much he and his writing/directing team have really gotten better through Breaking Bad/Better Caul Saul, but also how he's letting his X-Files flag fly again
December 16, 2025 at 7:54 AM