News for hackers. Stuff that matters.

reillyrider

Why would anyone prefer signed for indexing and sizes?

With unsigned you only need one check: 'i < bound', it works always, regardless how i is computed, and it doesn't matter if the calculation overflowed or wrapped around, still works.

With signed you need: 'i >= 0 && i < bound', and you need to be very careful how you calculate i because overflow is undefined behavior.

Re:How to CAD Almost Anything on Friday November 20, 2026 @03:07AM (#50571589)
I'm not really sure about AI CAD. The things I CAD are very specific, I can't just go "give me a generic box", it needs to be these exact dimensions, it needs to have cutouts at this position with this size, it needs holes at this spot, manufactured with these materials and tolerances, then I need this all nicely parametric and easy to change. If I need to put that many specific details in my prompt (and then double check the work afterwards) I might as well just do it myself.

And how would iteration look like? It's a million times faster and easier to just navigate around a 3d model, click on the feature to edit, start editing. Describing which feature for the AI to change seems like a nightmare.

Re:Unreal Tournament 2004 in the Browser on Thursday November 19, 2026 @06:27AM (#50558764)
I mourn the loss of private dedicated servers for multiplayer games. I guess the mainstream player likes matchmaking or "invite a friend", but I just hate it. There was something special about becoming a regular on some server, get to know other regulars, the admins, chit chat on the forums, teaching new players the ropes, etc.
Re:Multiple vulnerabilities in Regexp and String case conversion on Thursday November 19, 2026 @06:19AM (#50558682)
It's because of shitty cowboy C.

Writing *p++ = c;

to append to a buffer is just insanity, I don't know why so many people like to write "clever" code like this.

I have a buf_putc(struct buf *b, int c); which does bounds checking (and potentially growing the memory), and I've used this kind of abstraction for decades.

Same with "use after free" bugs, WHY are people malloc()ing and free()ing all over the place, and storing away pointers to things all over the place (people just looove their "objects" and stuffing pointers to things into structs and classes so now you have these insane lifetime couplings).

Ban pointer arithmetic, ban null terminated strings, ban malloc() and free() (and similar general purpose allocators), ban passing arrays without a length (and preferable have a struct ptrlen {} and pass it by value) and you eliminate 99.9999% of these bugs.

Multi threading in C is genuinely difficult because you get zero help from the compiler, but these low hanging bounds and lifetime problems can easily be eliminated with simple abstractions.