Re:Reconstant: Share constant definitions between programmin...
by s_gourichon on Tuesday March 09, 2021 @02:51PM
(#26403227)
The better syntax being uncommon is not a reason to not adopt it. Sometimes the wide majority can be unaware of the better choice.
I would rather see the change suggested as an opportunity to educate the developers.
I can find data showing that adding the second const is uncommon. Here are the number of code results for different github searches:
"const char " - 310 million results
"const char" - 385 million results
"const char * const" - 30 million results
"const char* const" - 37 million results
"const char *const" - 36 million results
Unfortunately I'm not sure how to search for the array style syntax.
One way or another, my point is that I'm more interested in optimizing for readablity and the way people expect things to be defined rather than the extra bytes.