this post was submitted on 06 Jul 2024
1498 points (99.4% liked)

Programmer Humor

18961 readers
1197 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] Miaou@jlai.lu 4 points 1 month ago (2 children)

Hard disagree on your first point. Name the flags with descriptive name, move this initialisation to a function, and there you go, self-documented and clear code.

[–] Ephera@lemmy.ml 2 points 1 month ago

Hmm, maybe my opinion is just shit in that regard. I don't code terribly much low-level, so I'm probably overestimating the complexity and underestimating the options for cleaning things up.
That was kind of just a random example, I felt like there were many more cases where low-level code is complex, but I'm probably basing this off of shitty low-level code and forgetting that shitty high-level code isn't exactly a rarity either.

[–] AdNecrias@lemmy.pt 2 points 1 month ago

I'm with you but sometimes you don't have the chance in low level. Max you can do is create local variables just so the bits you're XORing are more obvious. And whenever you're working with something where that'd be wasteful and the compiler doesn't rid if it, you're better off with comments (which you need to maintain, ugh)