Skip to main content

Questions tagged [kotlin]

-4 votes
2 answers
342 views

I have a method like this private void foo() { this.myValue = readSomeValueFromFileSystem() } What is the good name for that ? Is there any convention about it ? I feel that it is kinda set but ...
gstackoverflow's user avatar
2 votes
1 answer
227 views

Given that there are no checked exceptions in Kotlin, are Result types the correct way to indicate an exception occurred to the caller? For example, I have the following function in my code: suspend ...
Adam's user avatar
  • 272
3 votes
4 answers
825 views

I have a good understanding of when coroutines in Kotlin are superior to threads. I know that coroutines are lightweight and are great for massive concurrency when, in contrast, spinning up lots of ...
J-bob's user avatar
  • 357
0 votes
1 answer
177 views

I have the following module structure: core persistence extension In my core module, I have an interface: Handler. This interface has multiple implementations in the core module as well as extension ...
alturkovic's user avatar
-1 votes
1 answer
527 views

Originally posted here, moved to code review, redirected from code review back here as there is no code to review. I think the question is enough abstract to be asked here. I have a mono repo with ...
Alexander Petrov's user avatar
-1 votes
1 answer
136 views

The Kotlin language brings the simplification of function calls to the natural language. This article shows a nice example: Function: fun of(suit: Suit) = Card(this, suit) val card = Rank.QUEEN.of(...
Nikolas's user avatar
  • 613
2 votes
1 answer
162 views

I am trying to migrate to Jetpack DataStore from good ol' SharedPreferences and there is one thing I am struggling to come to terms with and that is the amount/size of the data pulling out of ...
TheLibrarian's user avatar
0 votes
1 answer
487 views

With the purpose of learning Hilt I started "migrating" my multi-module Kotlin app from using classes with static methods as helpers to Hilt injection. After a lot of headaches, now ...
Diego Perez's user avatar
0 votes
1 answer
1k views

I've already read this carefully, but still need more clarification. I'm not new to dependency injection, but new to Hilt, and trying to implement Hilt in my multi-module app. The reason? I currently ...
Diego Perez's user avatar
0 votes
0 answers
550 views

I have been working on an Android application for some time, and ever since the beginning I've developed a practice of splitting my class's (mostly activity/fragment) code up into multiple files. This ...
thebluepandabear's user avatar
-1 votes
1 answer
224 views

I wanted to learn Kotlin but after reading online most experts seem to agree that learning Java first would be a first step in the roadmap of learning Kotlin. Their argument based on the fact that ...
Ladan's user avatar
  • 1
0 votes
2 answers
768 views

I want to perform some operations on data class fields before accessing them and I am confused about which approach I should follow. I want to write code so that it makes sense to everyone and follows ...
Lokik Soni's user avatar
1 vote
1 answer
267 views

I'm struggling to test functionality in a class where the class has to be in a certain state for the functionality to work, but the class cannot be put directly into a given state by design, to ...
gotube's user avatar
  • 127
1 vote
2 answers
561 views

I often find it helpful to use KDoc/Javadoc comments inside of a class or function instead of normal comments. IntelliJ colorizes them more obviously by default and, more importantly, allows ...
Matt Robertson's user avatar
0 votes
2 answers
148 views

Consider an interface: interface Auth { fun doAuth() } this can be implemented for multiple APIs: class GoogleAuth : Auth { override fun doAuth(){ throw NoGoogleAuthImpl(); } } class ...
mrahimygk's user avatar
  • 117

15 30 50 per page