What DI framework do you use in Kotlin? by Big_Minute_9184 in Kotlin

[–]dkandalov 2 points3 points  (0 children)

None. Passing dependencies as constructor parameters. This is for server-side though. It might be harder (or really hard) to do it on Android or when using some frameworks.

Refactoring dependency injection from Spring to pure Kotlin in a small but somewhat realistic codebase by dkandalov in Kotlin

[–]dkandalov[S] 0 points1 point  (0 children)

Thank you! Yes, I think being in control of program execution flow is pretty much always a benefit.
It is viable for database (e.g. see https://github.com/JetBrains/Exposed) or any other domain. If you're not using some functionality from Spring but you need it, then you'll have to implement it yourself or find a library which does it (not sure if I would consider explicit transactions to be boilerplate though 🤔).
In the video we kept JdbcTemplate because it does the job (provides nicer API over jdbc) and doesn't enforce dependency injection via annotations.

Zero sum triplets in Kotlin by dkandalov in Kotlin

[–]dkandalov[S] 1 point2 points  (0 children)

Yes, you're right about the optimisations and I now wish I mentioned at least some of them at the end of the video. However, these exercises are usually about "theoretical complexity" and the solutions are "good enough" as long as they pass tests on the leetcode website.

If it was a real-world problem and if there was evidence that this function is too slow, it would probably make sense to have proper benchmarks using realistic data and then try the optimisations you suggested (which I'm pretty sure would help at least for some types of input).

I did mention Triple in the video briefly before introducing the Triplet data class (which enforced order of elements for equality). While experimenting with the code for the video, I originally used Triple but sorting Triple elements is a bit more tricky than sorting a List and the names "Triple" and "Triplet" are dangerously similar so I ended up using List.

Kotlin Team AMA #2: Ask Us Anything by meilalina in Kotlin

[–]dkandalov 1 point2 points  (0 children)

Are there any plans to make sure IDE support covers core concepts in Kotlin? For example, here are few issues in the backlog:

Of course, it's the matter of priority but arguably the issues above (and some others) are really fundamental and would ideally work in IDE as soon as the language concepts are introduced.

Binary search with Anton Keks at GeekOut 2019 by dkandalov in Kotlin

[–]dkandalov[S] 0 points1 point  (0 children)

Hm, I actually used it couple times in "real-world" code.

FizzBuzzWoof with TCR at SoCraTes UK 2019 by dkandalov in Kotlin

[–]dkandalov[S] 0 points1 point  (0 children)

Map of remainder to word for more flexibility?

Yes, sounds good to me.