Is there any particular set of reasons for requiri...
# ktor
s
Is there any particular set of reasons for requiring “wildcard imports” in Ktor? I am pretty sure ie. exposed requires “no wildcard imports” and seems the google guide for java is the same.
s
Can you clarify what you mean by “required”? I doubt it’s anything more than a style preference
s
Regardless, the question is the same
e
I do not use any wildcards in my imports with ktor. It is completely up to you how to do your imports.
1
s
I was reminded of this while looking at some
.editorconfig
stuff just now — the IDE is configured by default to use wildcard imports for Ktor (
ij_kotlin_packages_to_use_import_on_demand = java.util.*,kotlinx.android.synthetic.**,io.ktor.**
). This can be disabled from
Preferences → Editor → Code Style → Kotlin → Imports → Packages to Use Import with '*'
h
This is more an IDE default than it is Ktor. Personally I don’t really see much value in individual imports to be honest (with the minor exception of looking at your code outside of an IDE and wondering what symbol belongs to what package).
s
So this seems to have been completely misunderstood. I am not asking as a user of ktor the framework. I am asking for why it has been chosen as a code style for contribution to ktor. I can place a guess that it is to reduce merge conflicts for collaboration on the codebase but obviously not know for sure. Especially since Exposed has chosen (I think, cant find it in the docs atm) and google has chosen differently.
h
Because it’s the code style that we generally follow on various teams at JetBrains.