this post was submitted on 10 Jul 2024
1051 points (93.7% liked)

Programmer Humor

19735 readers
418 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
[–] [email protected] 127 points 4 months ago (2 children)

Calls a static method on the OldMan class instead of the instance of oldMan that is actually dying.

[–] [email protected] 63 points 4 months ago* (last edited 4 months ago) (1 children)

Tonight's story: Every man older than OldMan.getMinimumAge() has been in perfect *unchanging* health for the last few months‽ To find out why, stay tuned! Our experts chime in to help you understand....

[–] [email protected] 8 points 4 months ago

But then they really have no idea and try to convince you it’s from some stupid diet trick fed to them by a sponsor.

[–] [email protected] 3 points 4 months ago (1 children)
[–] [email protected] 2 points 4 months ago (1 children)

Is this some .NET convention that references to instances start with capital letters?

[–] [email protected] 3 points 4 months ago (1 children)

Yeah, properties (like a field but with a getter and/or setter method, may or may not be backed by a field) are PascalCase

[–] [email protected] 3 points 4 months ago (1 children)

How is OldMan a property here? It's clearly the name of a class

[–] [email protected] 1 points 4 months ago (1 children)

Instance properties are PascalCase.

[–] [email protected] 1 points 4 months ago (1 children)

Yes I know, I've coded in .NET before, but so are class names.

[–] [email protected] 1 points 4 months ago

Okay, but this makes more sense as an instance method rather than a static one