styleguides
styleguides copied to clipboard
Use descriptive names for constants
There is still a lot of code being written in the style of CONSTANTS c_01 ... VALUE '01'.
, I suggest this should be emphasised in its own section.
We could put this in the "Use descriptive names'' section too, but I feel it is better among constants because it also hilights that we should look to enumeration classes first.
Yes, I agree. This point could need some repetition. Two suggestions:
-
Let's make this the second sub-section inside the Constants section, directly after Use constants instead of magic numbers It fits better at the front there because it has more a general or introductive character and should come before we dive into the technical details of how to implement in the other two sub-sections. It also fits in nicely beside the general observation to not use magic numbers.
-
Let's add a link to the section Use descriptive names. Maybe a quoted paragrapth at the end:
This is a repetition of the rule Use descriptive names, specifically for constants.
@pokrakam Can you do these changes in your original branch? It's not inside this repository, so I cannot directly edit it. Or should I move the suggested changes over and add them from an own branch?
@HrFlorianHoffmann sure I can update this, bit busy but will get to it in the next couple of days.