Naming convention for private constants


#1

Hi,

Is there any reason for this convention?

class PrivatePropertyNameInspection :
        PropertyNameInspectionBase(
            PropertyKind.PRIVATE, "Private property", "_?[a-z][A-Za-z\\d]*",
            NO_MIDDLE_UNDERSCORES, NO_BAD_CHARACTERS_OR_UNDERSCORE
        )

here: https://github.com/JetBrains/kotlin/blob/e4bf20a2675242f71fc7c4f0401d4d02359ab8dd/idea/src/org/jetbrains/kotlin/idea/inspections/NamingConventionInspections.kt#L218

I have a private, constant within my class and in Java I used to do

private static final int HTTP_PORT = 80;

what’s the recommended way to name the val? HTTPPORT?


#2

httpPort, probably.