Hello! I had a question about file naming conventi...
# getting-started
p
Hello! I had a question about file naming convention for file which contains multiple classes or only top-level declarations. https://kotlinlang.org/docs/reference/coding-conventions.html#source-file-names - use name with a upper first letter, but https://github.com/JetBrains/kotlin - use name with a lower first letter. What would be better? I prefer second way, but in little confuse why official kotlin github no follow official kotlin convention
h
Where did you find that
use name with a lower first letter
?
Kotlin itself uses source files starting with uppercase letters, see for example https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib/src/kotlin/collections
h
That's part of the build, not (directly) part of Kotlin itself. Anyway, I'd highly recommend following the convention from the docs.
a
It seems that if it is a single class file, then it matches its name of the class (which start with capital letters), But if the file contains multiple declarations it uses initial lowercase.
That's what I can reckon from the presented sample.
m
The link above to collections is a folder. Look at all the files within it and they're all uppercase first.