JakeWharton / JakeWharton/timber
Use Kotlin string templates or string formatting arguments?
- Dominant language
- Kotlin
- Stars
- 10.8k
- Forks
- 994
- Avg merge
- 17h 16m
- Merged PRs (30d)
- 17
Description
Kotlin has string templates, e.g. `"Hello, $person!"` where `person` can be some string. I wonder: how does such a string with template perform when passed to Timber, compared to a string formatted with arguments like so: `Timber.v("Hello, %s!", person)`? Is there a noticeable/significant difference between the two?
Therefore, should Timber's lint rules warn about string template usage?
Or on the contrary, should strings with formatting arguments in Kotlin files result in a warning that they can or should be replaced with templates?
Another thing to consider is a mention in the Timber docs about this: which of the two methods is preferable?
Kotlin string templates are an idiomatic language feature and may therefore be preferable. I'm unaware of the underlying compile-time/runtime details of string templates, which may be different per Kotlin platform.
This is related to a few other issues where Timber-Kotlin interop is discussed.
Contributor guide
No contributing guide indexed for this repository
Research direction
No files or tests are identified. Investigate Kotlin string-template compilation and runtime behavior, then compare both call forms with Timber's lint rules and documentation needs. Done means a decided recommendation for lint behavior and which form the docs should prefer.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- documentation, performance, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100