Pull to refresh
15
0
Vadims Savjolovs @savjolovs

Senior Software Engineer at Meta

Send message

Solving coding problems with Kotlin: Collection functions

Reading time 7 min
Views 2.6K

(originally published on Medium)

I have talked to many Android developers, and most of them are excited about Kotlin. So am I. When I just started learning Koltin, I was solving Kotlin Koans, and along with other great features, I was impressed with the power of functions for performing operations on collections. Since then, I spent three years writing Koltin code but rarely utilised all the potential of the language.

During this year, I did more than a hundred coding problems on Leetcode in Java. I didn’t switch to Kotlin because I know the syntax of Java 6 so well, that I could effortlessly write code without autocompletion and syntax highlighting. But I didn’t keep track of new Java features, as Android support of Java SDK lacked many versions behind. I didn’t switch to Kotlin for solving problems right away. Although I was writing Kotlin code for several years, I felt that I need to make an extra cognitive effort to get the syntax and the language constructions right. Solving algorithmic problems, especially under the time pressure, is very different from Android app development. Still, the more I learned about Kotlin, the more I realised how many powerful features I’m missing, and how much boilerplate code I need to write.

One day, I have decided that I need to move on, so I started a new session in Leetcode and switched the compiler to Kotlin. I solved just a few easy problems, but I already feel that I have something to share.

Читать далее
Rating 0
Comments 0

RxJava to Coroutines: end-to-end feature migration

Reading time 7 min
Views 4.5K
image

(originally published on Medium)

Kotlin coroutines are much more than just lightweight threads — they are a new paradigm that helps developers to deal with concurrency in a structured and idiomatic way.

When developing an Android app one should consider many different things: taking long-running operations off the UI thread, handling lifecycle events, cancelling subscriptions, switching back to the UI thread to update the user interface. In the last couple of years RxJava became one of the most commonly used frameworks to solve this set of problems. In this article I’m going to guide you through the end-to-end feature migration from RxJava to coroutines.
Read more →
Total votes 3: ↑3 and ↓0 +3
Comments 2

Flutter app architecture 101: Vanilla, Scoped Model, BLoC

Reading time 8 min
Views 9.5K


(originally published on Medium)


Flutter provides a modern react-style framework, rich widget collection and tooling, but there’s nothing similar to Android’s guide to app architecture.


Indeed, there’s no ultimate architecture that would meet all the possible requirements, yet let’s face the fact that most of the mobile apps we are working on have at least some of the following functionality:


  1. Request/upload data from/to the network.
  2. Map, transform, prepare data and present it to the user.
  3. Put/get data to/from the database.

Taking this into account I have created a sample app that is solving exactly the same problem using three different approaches to the architecture.

Read more →
Total votes 17: ↑15 and ↓2 +13
Comments 0

Information

Rating
Does not participate
Location
London, England - London, Великобритания
Registered
Activity