in our code, we need to handle configurations and in order to do that we need to pass the configuration names as std::string to our own framework.
Sample code:
framework.handle_config("enable-radio-link")
framework.handle_config("enable-tv-link")
framework.handle_config("enable-gateway-link")
so on to ...n
These strings will be written only in one place and they won't be repeated anywhere else.. except for only 2 or 3 configurations.
My team mate wanted to have it as #define and use, as it as best practice. like
#define ENABLE_RADIO_LINK "enable-radio-link"
#define ENABLE_TV_LINK "enable-tv-link"
framework.handle_config(ENABLE_RADIO_LINK)
framework.handle_config(ENABLE_TV_LINK)
I was thinking, it will simply make little bit more time to read code and cross reference what these #defines means.
Is it really a best practice, to #define(or static const whatever) them and use it even though it is used in one place?
what is the advantage of having this?