It's Healthy to Look Outside Your Own Tribe!

It’s time for me to interrupt the ordinary programming on this little part of the interwebs that I call my blog and not do the usual schtick with numbers, code and c++-bashing and be a bit more philosophical instead.

One of my favorite philosophers!

I think most of us working in tech, especially if we have been doing it for a while, know quite well what we like, what we think is “good engineering” or dare I say it “clean code”! We have found our bunch of people, our “tribe”, where we tackle similar problems, like the same kind of solutions and feel at home! Unfortunatly we also tend like to fling poop over the fences towards the other “tribes” and not really care where or on who it may land. Im unfortunatly not free of sin here, and you are probably not either!

Read More

Extending an Enum in Zig

For a while now I have been dabbling with zig and as a small test writing a NES-emulator (everyone should have written an 8-bit emulator in their life right?). While doing this I stumbled upon a kind of neat trick that you can do in zig that I thought was worth sharing… with kind of a “anti-climactic” end!

Some background

While writing some debug-tools I decided that I wanted to switch between ppu-palettes when displaying some data. At this time the available palettes were all described with an enum.

Read More

Compile Time Hashes in C - Revisied

Hashing strings in c++ at compile time has been possible since c++11 but is it worth doing? Me and a few colleagues was discussed this over a few beers and it reminded me that I have already written about it here (8 years ago… ARGH I’m getting old!).

But a lot of time has passed since I wrote that… and I didn’t make any measurements in that article! shame! SHAME I SAY!

Read More