ellowrath / ClangMan

shitty hangman game in c
2 stars 0 forks source link

Are you ... is this efficiency optimization? #11

Open StoneCypher opened 3 years ago

StoneCypher commented 3 years ago
    if(fstatfs(fd, &fsInfo) == -1) {
        optimalSize = 4 * 1024 * 1024;
    }
    else {
        optimalSize = fsInfo.f_bsize;
    }

I don't actually know what this is for. I've been a commercial programmer for decades, and there's code I can't sort out in your hangman implementation.

Are you defining an optimal page size of four megabytes? For ... for loading a wordlist? In hangman?

Like. Do you need this level of efficiency in your code?

Things like this have a maintenance cost. Sure, this hangman won't be in service in 20 years, but that's a real threat with most of your code. Whoever comes along to fix this in 15 years has to start by figuring out if this is actually important, and if you even did this for a reason, and why they're supporting some weird ass storage size optimization from back when we used physical storage on matter

Do the simplest thing that won't suck

ellowrath commented 3 years ago

I do not need that level of efficiency. That was an attempt to load things by block size, and seems silly now. I'll unfuck this after some of the easier things.