this post was submitted on 15 Aug 2024
679 points (98.4% liked)

Programmer Humor

19149 readers
1214 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
 

Which will probably be never.

you are viewing a single comment's thread
view the rest of the comments
[–] nexussapphire@lemm.ee 2 points 4 weeks ago (10 children)

I forgot to assign a variable, now it crashes %5 of the time. It's wild how c doesn't default variables to null or something.

[–] CodeMonkey@programming.dev 9 points 4 weeks ago* (last edited 4 weeks ago) (5 children)

C does exactly what you tell it, no more. Why waste cycles setting a variable to a zero state when a correct program will set it to whatever initial state it expects? It is not user friendly, but it is performant.

[–] nexussapphire@lemm.ee 1 points 4 weeks ago

It wouldn't be that much processing compared to the rest of the app. It would lot more efficient than running an effectively infinite loop or arithmetic on an arbitrarily large number as a result of an unsigned variables.

load more comments (4 replies)
load more comments (8 replies)