<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Hacker News: olcay_</title><link>https://news.ycombinator.com/user?id=olcay_</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Thu, 16 Apr 2026 15:39:41 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=olcay_" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by olcay_ in "High-Level Rust: Getting 80% of the Benefits with 20% of the Pain"]]></title><description><![CDATA[
<p>There definitely is Kotlin without Java, and you can compile Kotlin code for use in jvm, ios/ipados/macos, android, wasm/js, and native.</p>
]]></description><pubDate>Sun, 12 Apr 2026 10:05:09 +0000</pubDate><link>https://news.ycombinator.com/item?id=47737905</link><dc:creator>olcay_</dc:creator><comments>https://news.ycombinator.com/item?id=47737905</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47737905</guid></item><item><title><![CDATA[New comment by olcay_ in "Meta told to pay $375M for misleading users over child safety"]]></title><description><![CDATA[
<p>I think they meant that Meta is offloading the cost (fines) of farming minor's data onto the operating systems. With an up-front cost of 2 billion dollars in lobbying, they can avoid paying 300m+ fees regularly.</p>
]]></description><pubDate>Wed, 25 Mar 2026 12:46:44 +0000</pubDate><link>https://news.ycombinator.com/item?id=47516621</link><dc:creator>olcay_</dc:creator><comments>https://news.ycombinator.com/item?id=47516621</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47516621</guid></item><item><title><![CDATA[New comment by olcay_ in "So you want to write an “app” (2025)"]]></title><description><![CDATA[
<p>I think Jetpack Compose is not actually as bad as you think. I think it's really great and I wish more people caught on actually.<p>I can't comment on the learning materials as I was following it since the project started and I was already accustomed to the Android Developers website.<p>Kotlin has a few reactiveness concepts that make reactivity easier but might scare off developers from other languages. The most important ones are Flows and Coroutines.<p>Say you want to have a UI that shows the current list of connected devices that should always show up to date info. The function to get the list would be something like this:<p><pre><code>  val devices = manager.getDevices()
</code></pre>
But you need it to be declarative instead of imperative, so you use a Flow:<p><pre><code>  val devices = flow {
      while(true) {
          emit(manager.getDevices())
          delay(1000)
      }
  }
</code></pre>
Devices is now a <i>cold</i> flow. It does nothing unless it's being collected. When you start collecting it, e.g. by using collect:<p><pre><code>  devices.collect { list -> ... }
</code></pre>
Now it starts running the while loop and you get the up to date devices list in your lambda every second. You can also make the lambda run only when the list has changed, or debounce it, or run only for the latest value, and more with trivial function chaining.
But this function is suspending, which is Kotlin's way of async functions, and suspend functions take turns running on the threads that are managed by the <i>coroutine scope</i> they are in, so you need to provide it a coroutine scope by wrapping your collection in scope.launch { ... } .<p>And your viewmodel can now collect the flow in a way that's going to be accessible without suspending (async) functions by turning it into a StateFlow:<p><pre><code>  val devicesStateFlow: StateFlow<List<Device>> = devicesFlow.stateIn(scope, some more arguments...)
  // Now synchronous code can call like this:
  print(devicesStateFlow.value)

  // And Compose (reactive ui) code can do this in Composable functions:
  val devicesState by vm.devicesStateFlow.collectAsState() 
</code></pre>
I think that was the source of confusion you had when you were trying to use datastore. It's designed for reactive applications so you were supposed to use it in a viewmodel, turn it into a stateflow and collect it as state in your ui.</p>
]]></description><pubDate>Tue, 10 Mar 2026 01:13:50 +0000</pubDate><link>https://news.ycombinator.com/item?id=47317994</link><dc:creator>olcay_</dc:creator><comments>https://news.ycombinator.com/item?id=47317994</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47317994</guid></item></channel></rss>