Any Kotlin/Google tech speakers?

#gdg #devfest #google
We know there are great speakers among us, technology guru’s, leaders of the pack… Yeah! That’s you we are speaking about!

We want to offer you to take part in GDG Devfest POLAND 2020 as a speaker and share your precious knowledge with our attendees.
Kotlin is already well settled in Android, well it’s a primary language there already, so if you would like to share your story please join us, and submit your talk at
The conference will be held online, but it’s still a great opportunity for speakers and attendees to meet other awesome people 🙂

submitted by /u/muflon1337
[link] [comments]

Continue Reading Any Kotlin/Google tech speakers?

Construct object through parent sealed class, and child private constructor


I want to implement some Scala inspired



I wanted to know if it is possible to make child class (




) not instantiate by themselves (no public constructor), but only from the


method. Here’s my current code with public constructor for both child, when I make them private I got an error in


method (which I understand). I found nothing in the Kotlin documentation about this kind of thing and I don’t think it is possible, so I post here just in case

sealed class Try<T> { companion object { operator fun <T>invoke(elem: () -> T) = try { Success(elem()) } catch (e: Exception) { Failure<T>(e) } } } data class Success<T>(val value: T) : Try<T>() data class Failure<T>(val e: Exception) : Try<T>()

Thanks in advance 😀

submitted by /u/lepaincestbon
[link] [comments]

Continue Reading Construct object through parent sealed class, and child private constructor

[HELP] Struggling at pair programming interviews

Hello everyone,

TL;DR: trying to get a job but keep failing at pair programming interviews over and over. Don’t know what to do and am considering leaving the tech industry to seek something else out of frustration.

I’ll start with a little bit of background so you can understand where I’m coming from. I started out as a web/java developer(4~ years exp) then became an Android developer (5+ years exp) and have led small sized Android teams over the last 2.5years.

Unfortunately, I lost my job in late March. Over the last 3 months I have been aggressively looking for a job but I seem to keep failing in the technical department when it comes to pair programming interviews. Though, I must say that I feel a lot more confident when I’m given one of those take-home tests where I feel like I can excel without being judged or something but that doesn’t seem to be the case nowadays as 90% of the companies I’ve interviewed with thus far didn’t do it. Out of all the companies I interviewed with, 4 of them I managed to get to very last step of their hiring process. But like you’d guess, they turned me down in the end. I tried to practice more, going to those code challenge websites along with working on my own small project to try and keep my mind sharp but that also doesn’t seem to help at all. With that being said, like the title says, I keep failing at pair programming interviews and I don’t know what to do about it anymore and decided to take it to the internet.

As a matter of fact, I do understand how software architecture works and what purpose they serve (MVVM for instance) and I can talk about it for hours because I really find it interesting. Not to mention the new Google Jetpack APIs etc. But for some weird reason my mind blacks out when in that scenario.

Lastly, what really intrigues me too is the fact that I see so many developers getting new jobs within weeks and I’m really starting to feel that I might’ve just “got lucky” so far in my career and that I might not be as good as I thought I was to begin with. I’m actually considering completely deserting the industry altogether to pursue something else instead.

Any thoughts?

submitted by /u/Cyberknucklez
[link] [comments]

Continue Reading [HELP] Struggling at pair programming interviews

Dependency injection with function types has some shortcomings compared to interfaces

One thing you sometimes find is that a code base may have a Foo interface that has several methods. When you’re writing a new function, you may only need one of those methods to operate:

interface Foo { fun doSomethingWithInt(x: Int): Int? fun doSomethingWithString(x: String): String? fun doSomethingWithBar(x: Bar): Bar? } fun coolNewStringFeature(foo: Foo): String? { // stuff return foo.doSomethingWithString("string") }

Now, if you want to test your


you have to mock/stub the whole interface. Either by hand, or with some mock library like mockk. On the other hand, if you just wrote your function as:

fun coolNewStringFeature(doSomethingWithString: (String) -> String?): String? { // stuff return doSomethingWithString("string") }

Now you just have to write a trivial closure to test the function! And it’s easy to quickly test a bunch of different inputs, instead of fiddling with your mocks or whatever.

But there are problems.

Problem #1: Function types can’t have arg labels.

fun withRange(operation: (min: Int, max: Int) -> Boolean) { operation(min = 0, max = 2) // compile error operation(0, 2) // which one means what? } interface MinMaxinator { fun operation(min: Int, max: Int) = //... } fun withRange(operator: MinMaxinator) { operator.operation(min = 0, max = 2) // okay! }

Problem #2: Functions with default args can’t be used as function types without those args.

fun importantWork(x: Int, y: Int, z: Int = 10) = //... fun doWith(work: (Int, Int) -> Unit) = //... doWith(::importantWork) // compile error

Just putting this out there. No real question. Just generally complaining about stuff 🙂

I like the idea of passing functions around instead of objects, but I keep running into papercuts.

submitted by /u/ragnese
[link] [comments]

Continue Reading Dependency injection with function types has some shortcomings compared to interfaces

End of content

No more pages to load