i'm not minding writing You Have Died in C but it really requires a lot of discipline to make sure everything you do is error checked, even if it's just an assert

fortunately i'd gotten used to writing code very defensively anyway even in C# cause crashing is just about the worst thing you can do, but still. it's a lot

@eniko I just want to note that I find it funny that you're doing a blobber in pure C because that's what I've been working on, too 😀

I've found the game code to be pretty straightforward and generally not very error-prone in C, but that may be because of choices I made with how structuring most of it (as few pointers exposed as possible) and the game still being very very simple. The editor/tools code on the other hand is a goddamn nightmare in C, even with things like the new defer statement.

@seanmiddleditch yeah i find if you try to avoid pointers/malloc as much as possible game code is quite amenable to C

but yeah i wouldn't wanna write tools in it. i can barely tolerate writing the code to load bespoke formats that i crafted to make them easier to load >_>

@eniko this! I had so much fun recently writing a simple game without ever touching malloc.

Entity entities[ENTITY_MAX];

I think I had just one segfault, easily fixed. Most joyful C programming I ever did.

@fabiosantoscode @eniko
Lol I did the same in the emulator, in C++.

All the memory allocation inside standard containers. I had a couple of array OOB because apparently I suck at math but in general it was quite pleasant. The problems came from figuring out the implementation rather than from crazy pointers.

@FromTheFourthPlanet so nice! I might just do the same if I ever get to that game boy emulator I've been thinking about
@fabiosantoscode
you can have a look at my code, if you want - the codeberg repo is in my bio
you can get ideas, I guess, even when my emulator is written more to be clear and easy to understand than performant
@FromTheFourthPlanet It's really clean! I almost never read C++ and I understood all I read. I like that there's a file for each instruction.