this post was submitted on 02 Aug 2023
1456 points (98.0% liked)

Programmer Humor

32572 readers
780 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 

I'm doing you a favor

you are viewing a single comment's thread
view the rest of the comments
[–] Gecko@lemmy.world 32 points 1 year ago (2 children)

ngl, I'm annoyed whenever someone creates an application but doesn't want to publish their code cause it looks bad. Like no one cares that your code is bad and by publishing it, you can get others to help you improve it.

[–] lol@sh.itjust.works 13 points 1 year ago* (last edited 1 year ago) (1 children)
[–] rmuk 11 points 1 year ago (1 children)

Steadily increasing unsigned integer on a long-running piece of infrastructure: bonjour

[–] socsa@lemmy.ml 3 points 1 year ago* (last edited 1 year ago) (1 children)

Laughs in

struct LooooongCounter {
    long highPart;
    long lowPart;
};
LooooongCounter operator++(const LooooongCounter& c) {
    if(c.lowPart == ULONG_MAX) {
        c.highPart++;
        c.lowPart = 0;
    }
    else c.lowPart++;
}
[–] fer0n@lemm.ee 13 points 1 year ago

I think you convinced me to actually do it