Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a recommended naming convention for files that contain only functions/extension methods?

Tags:

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?

like image 704
gvlasov Avatar asked Nov 10 '15 17:11

gvlasov


People also ask

What is the best choice for a naming convention for a file?

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 naming conventions are used in file management?

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.


1 Answers

StringExt.kt for the file with extension functions of String.

CollectionExt.kt for Collections extension functions.

like image 175
WangJie Avatar answered Sep 19 '22 20:09

WangJie