That Ugly C# Code

Everyone’s Favorite C# Code

If you’re on the internet and are in any vaguely programming-oriented communities I’m sure you’ve seen the really ugly C# sharp code the Dutch government released recently. To save you the trouble, they’re just if else-ing percentages to give a progress bar.

For whatever reason I thought it’d be fun to do a bunch of performance benchmarks in Python 3.10 to see if those silly Dutch programmers were onto something and to see how much sillier and faster I got.

tl;dr

It’s quicker than I would have wrote it, honestly.

I ended up writing 4 different implementations of the code on top of a Pythonized if-else version and the original implementation was pretty performant comparatively.