glenkpeterson
05/17/2021, 3:05 PMdec31_2015
in Java. How should I name that in Kotlin? I get this warning about the underscore.Ryan Smith
05/17/2021, 3:08 PMcamelCase
for identifiers in Java/Kotlin which is why you get the warning. Could go with dec312015
, but that is a bit harder to read. For the sake of readability you could ignore the warning, or consider renaming the variable entirely. newYearsEve2015
? decThirtyFirst
? Just date
?Roukanken
05/17/2021, 3:09 PMlastDec2015
? If it makes sense in the contextCasey Brooks
05/17/2021, 3:09 PM@Suppress("LocalVariableName")
on the function/class with that variable to document that the name not strictly following Kotlin standards is intentionalCasey Brooks
05/17/2021, 3:12 PM@Suppress
annotation to hide the warning. Either way, warnings are useful and shouldn’t simply be ignoredglenkpeterson
05/17/2021, 3:36 PMephemient
05/17/2021, 4:19 PMval `dec㉛2015`
/sShawn
05/17/2021, 5:03 PMDEC_31_2015
, following the static final
labeling schemeRob Elliot
05/17/2021, 5:44 PMval COMPANY_FOUNDING_DATE = "2015-12-31".toLocalDate()
captures both that it’s the 31st December 2015 and why that particular date is worth capturing as a constant.