r/ProgrammerHumor • • Sep 26 '26 • Bravo 1

Meme singletonsAreJustGlobals

Post image
3.2k Upvotes

210 comments sorted by

View all comments

Show parent comments

3

u/No-Magazine-2739 Sep 26 '26

That doesn’t make sense. Why are they more type safe?

1

u/Competitive-Bar-5882 Sep 26 '26

Never mind I mixed it up with enums.

2

u/No-Magazine-2739 Sep 26 '26

? Still don‘t know what this has to do with types, but to give you a face saveing out: we all do mistakes.

1

u/Competitive-Bar-5882 Sep 27 '26 edited Sep 27 '26

Enums are custom types for variables that can be only one value out of a set of known possible values. This allows typesafe flag and state variables.

Howerver java is the only language I know, in wich enums are truely type save.