this post was submitted on 22 Nov 2025
651 points (98.7% liked)

Programmer Humor

27690 readers
316 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 2 years ago
MODERATORS
 

cross-posted from: https://lemmy.ml/post/39334581

you are viewing a single comment's thread
view the rest of the comments
[โ€“] SpaceCowboy@lemmy.ca -3 points 1 week ago (1 children)

A constant inside a function is not constant to the computer. It's only constant within the scope of the function. So it's not constant to the computer since every time the function is called the "constant" will have a different value.

Do you even know what a real constant is?

You maybe need to rethink some things.

[โ€“] masterspace@lemmy.ca 2 points 1 week ago

That variable is only created when the function is run, and it holds a constant value for the entirety of its lifetime.

It is literally constant from the perspective of the computer executing it. You're the one adding an extra layer of expectation here.