Hi, If use a 3rd party library, like lets say mosh...
# getting-started
u
Hi, If use a 3rd party library, like lets say moshi, and I create useful extensions, and useful columnadapters etc, and want to distribute this to other consumers (internally). How should I name this module? Is the X suffix common place in kotlin in user space as well?
:moshix
? or more conservative
:base-moshi
? (
:sqdelightx
,
:retrofitx
etc) same goes for my custom
Flow
operators, since flow likes to keep it bare bones
a
foox
usually implies that you own
foo
,
yourlibrary-otherlibrary
is common, but there are as many opinions on this as stars in the universe
u
so how would you name the example,
ext-moshi
?
moshi-utils
?
I think utils is banned word in kotlin 😄
a
Probably something like
yourlibraryname-moshi
or something 🤷‍♂️
j
Google's approach in Android libraries is to use
libraryname-ktx
AFAICT, but as @Adam Powell said it sort of implies you own the lib.
a
Our use of
-ktx
is highly specific and only indicates converting the "host" library's existing APIs to more idiomatic kotlin usage, not adding new features
For example, adding
suspend
extensions to a library otherwise heavily based on callbacks or
ListenableFuture
j
Well, this is actually how I had understood the OP's usage: useful extensions being Kotlin adaptations of otherwise Java-like API, but upon reading I may be wrong - it looks like it may be about adding features as well. If that's the case then naming should be based on the features you are adding, so there is no real question of
x
,
ext
or the likes.