<@U8LBKF6AJ> soooo are we going to live stream the...
# san-diego
m
@ianbrandt soooo are we going to live stream the Kotlin meetup next month?
i
Hi Mitch, I think we could use Google Meet and it should work okay. The main thing we still need is a speaker, or a few lightning talks. I've asked a couple people, but no luck so far. I've got a few things I've been toying around with, but nothing that would likely be ready in time for next week.
Actually, I've got one thing I could demo about using JUnit 5's
DynamicTest
from Kotlin for parameterized unit testing. It's really only enough content for a quick lightning talk, though, so we'd need something more or it'll be a pretty short meeting.
m
I wouldn’t mind doing some research on Kotlin Higher Order Functions… i.e. Run, Let, Apply, etc….. It’d probably end up being 15 - 30 mins to go in depth
@August Gruneisen Do you have anything you’d present on?
Some other things I need to learn more about is • When to use lateinit vs lazy in Android Dev • Reified • Inline • Generics • Alias …. I have an idea but wonder if there’s more to it • Writing Gradle Tasks… Could be a Groovy --> Kotlin equiv • Coroutines
a
I could do something on lateinit vs lazy regarding thread safety. Maybe 15-30 minutes as well :)
l
I'd love to hear more about lateinit vs lazy, my coworker says lateinit is evil! I like that lazy works well with LiveDatas
i
I was experimenting with lateinit for my
previousWallTimeNanos
property here:
Copy code
private const val UNINITIALIZED = -1L

class GameClock {

	private var previousWallTimeNanos = UNINITIALIZED

	var deltaTimeNanos: Long = 0L
		private set

	fun update(wallTimeNanos: Long) {

		if (previousWallTimeNanos == UNINITIALIZED) {
			previousWallTimeNanos = wallTimeNanos
			return
		}

		deltaTimeNanos = wallTimeNanos - previousWallTimeNanos
		previousWallTimeNanos = wallTimeNanos
	}
}
Unfortunately...
Copy code
'lateinit' modifier is not allowed on properties of primitive types
So I ended up going with the plain old "if uninitialized" logic. The use case is single threaded, so I didn't need to worry about synchronization. I thought about creating a "LateInit" property delegate, but I'd only need it for the one instance in this application, so it didn't seem worth the added complexity. I'm a little surprised there isn't already such a property delegate in the #stdlib. Maybe I'll write one up and submit a pull request.