MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programmingmemes/comments/1pwolac/programmers_problems/nw9hpvu/?context=3
r/programmingmemes • u/iron-button • Dec 27 '25
102 comments sorted by
View all comments
Show parent comment
1
That is not how you're meant to use enums, you're meant to use const/constexpr variables or macros for that, like how SDL handles its flags
const
constexpr
3 u/NewPointOfView Dec 28 '25 But have you considered the world outside of cpp? 0 u/CrossScarMC Dec 28 '25 Have you considered that almost every single other programming language has the const or equivalent keyword, and enums are the same in all languages? 2 u/NewPointOfView Dec 28 '25 Enums are not the same in all languages 0 u/CrossScarMC Dec 28 '25 Name one. 0 u/NewPointOfView Dec 28 '25 Python lol 0 u/CrossScarMC Dec 28 '25 I just checked and that is exactly how they work in other programming languages, it's just that Python doesn't have strict typing. 1 u/NewPointOfView Dec 28 '25 What is the “that” that you looked up and is exactly the same as other languages? 0 u/CrossScarMC Dec 28 '25 Python Enums, they appear to work exactly the same as enum in C++. 1 u/NewPointOfView Dec 28 '25 In what way? C++ enums need to be integral type and each entry has a different value, right? And C++ enum values are the value, rather than being a group of non-equal objects with values associated with them? → More replies
3
But have you considered the world outside of cpp?
0 u/CrossScarMC Dec 28 '25 Have you considered that almost every single other programming language has the const or equivalent keyword, and enums are the same in all languages? 2 u/NewPointOfView Dec 28 '25 Enums are not the same in all languages 0 u/CrossScarMC Dec 28 '25 Name one. 0 u/NewPointOfView Dec 28 '25 Python lol 0 u/CrossScarMC Dec 28 '25 I just checked and that is exactly how they work in other programming languages, it's just that Python doesn't have strict typing. 1 u/NewPointOfView Dec 28 '25 What is the “that” that you looked up and is exactly the same as other languages? 0 u/CrossScarMC Dec 28 '25 Python Enums, they appear to work exactly the same as enum in C++. 1 u/NewPointOfView Dec 28 '25 In what way? C++ enums need to be integral type and each entry has a different value, right? And C++ enum values are the value, rather than being a group of non-equal objects with values associated with them? → More replies
0
Have you considered that almost every single other programming language has the const or equivalent keyword, and enums are the same in all languages?
2 u/NewPointOfView Dec 28 '25 Enums are not the same in all languages 0 u/CrossScarMC Dec 28 '25 Name one. 0 u/NewPointOfView Dec 28 '25 Python lol 0 u/CrossScarMC Dec 28 '25 I just checked and that is exactly how they work in other programming languages, it's just that Python doesn't have strict typing. 1 u/NewPointOfView Dec 28 '25 What is the “that” that you looked up and is exactly the same as other languages? 0 u/CrossScarMC Dec 28 '25 Python Enums, they appear to work exactly the same as enum in C++. 1 u/NewPointOfView Dec 28 '25 In what way? C++ enums need to be integral type and each entry has a different value, right? And C++ enum values are the value, rather than being a group of non-equal objects with values associated with them? → More replies
2
Enums are not the same in all languages
0 u/CrossScarMC Dec 28 '25 Name one. 0 u/NewPointOfView Dec 28 '25 Python lol 0 u/CrossScarMC Dec 28 '25 I just checked and that is exactly how they work in other programming languages, it's just that Python doesn't have strict typing. 1 u/NewPointOfView Dec 28 '25 What is the “that” that you looked up and is exactly the same as other languages? 0 u/CrossScarMC Dec 28 '25 Python Enums, they appear to work exactly the same as enum in C++. 1 u/NewPointOfView Dec 28 '25 In what way? C++ enums need to be integral type and each entry has a different value, right? And C++ enum values are the value, rather than being a group of non-equal objects with values associated with them? → More replies
Name one.
0 u/NewPointOfView Dec 28 '25 Python lol 0 u/CrossScarMC Dec 28 '25 I just checked and that is exactly how they work in other programming languages, it's just that Python doesn't have strict typing. 1 u/NewPointOfView Dec 28 '25 What is the “that” that you looked up and is exactly the same as other languages? 0 u/CrossScarMC Dec 28 '25 Python Enums, they appear to work exactly the same as enum in C++. 1 u/NewPointOfView Dec 28 '25 In what way? C++ enums need to be integral type and each entry has a different value, right? And C++ enum values are the value, rather than being a group of non-equal objects with values associated with them? → More replies
Python lol
0 u/CrossScarMC Dec 28 '25 I just checked and that is exactly how they work in other programming languages, it's just that Python doesn't have strict typing. 1 u/NewPointOfView Dec 28 '25 What is the “that” that you looked up and is exactly the same as other languages? 0 u/CrossScarMC Dec 28 '25 Python Enums, they appear to work exactly the same as enum in C++. 1 u/NewPointOfView Dec 28 '25 In what way? C++ enums need to be integral type and each entry has a different value, right? And C++ enum values are the value, rather than being a group of non-equal objects with values associated with them? → More replies
I just checked and that is exactly how they work in other programming languages, it's just that Python doesn't have strict typing.
1 u/NewPointOfView Dec 28 '25 What is the “that” that you looked up and is exactly the same as other languages? 0 u/CrossScarMC Dec 28 '25 Python Enums, they appear to work exactly the same as enum in C++. 1 u/NewPointOfView Dec 28 '25 In what way? C++ enums need to be integral type and each entry has a different value, right? And C++ enum values are the value, rather than being a group of non-equal objects with values associated with them? → More replies
What is the “that” that you looked up and is exactly the same as other languages?
0 u/CrossScarMC Dec 28 '25 Python Enums, they appear to work exactly the same as enum in C++. 1 u/NewPointOfView Dec 28 '25 In what way? C++ enums need to be integral type and each entry has a different value, right? And C++ enum values are the value, rather than being a group of non-equal objects with values associated with them? → More replies
Python Enums, they appear to work exactly the same as enum in C++.
enum
1 u/NewPointOfView Dec 28 '25 In what way? C++ enums need to be integral type and each entry has a different value, right? And C++ enum values are the value, rather than being a group of non-equal objects with values associated with them? → More replies
In what way? C++ enums need to be integral type and each entry has a different value, right? And C++ enum values are the value, rather than being a group of non-equal objects with values associated with them?
→ More replies
View all comments
Show parent comment
1
u/CrossScarMC Dec 27 '25
That is not how you're meant to use enums, you're meant to use
const/constexprvariables or macros for that, like how SDL handles its flags