In Java, it is simple: file name for a type is the name of a type plus .java
suffix.
In Kotlin, you can write files that don't contain classes. Is there any convention to name them?
And also how would you name unit test classes for those functions?
File naming best practices:Files should be named consistently. File names should be short but descriptive (<25 characters) (Briney, 2015) Avoid special characters or spaces in a file name. Use capitals and underscores instead of periods or spaces or slashes.
Why use naming conventions? Naming records consistently, logically and in a predictable way will distinguish similar records from one another at a glance, and by doing so will facilitate the storage and retrieval of records, which will enable users to browse file names more effectively and efficiently.
StringExt.kt
for the file with extension functions of String
.
CollectionExt.kt
for Collections extension functions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With