Engineering is often viewed as a highly technical discipline where hard skills are the key to success. But if you take a closer look at what we - engineers - do in our daily jobs, a lot of it boils down to… communication! When we write code, submit pull requests,...
https://thebakery.dev/93/ Today, we talk about KotlinPoet with Egor Andreevich. KotlinPoet is a library from Square used to generate Kotlin code. It’s a great tool to generate code at compile time, and it’s used by many libraries and frameworks for Android and not only. Egor has been involved with KotlinPoet for...
I constantly rave about how much I enjoy the code review culture at Cash App. My colleague Saket wrote an excellent post about it titled “Great teams merge fast”, where he goes into detail on how we approach shipping code. A very important aspect of this culture is crafting small,...
Android’s testing story has come a long way since the early days (old timers might recall not being able to run unit tests on the local JVM, or struggling to write UI tests in the low on caffeine pre-Espresso world), and nowadays there’s a multitude of tools, both 1st and...
Unit testing is one of my favorite software engineering techniques. In our industry, the word “testing” is strongly associated with the word “bug”, so the common belief is that unit tests help find/eradicate/prevent bugs. And while this is not untrue, there’s much more that unit testing can offer! Here’s my...
Kotlin Multiplatform doesn’t need a formal introduction – while still considered experimental, it’s already helping teams around the world to share their business logic across multiple platforms. It’s like magic! At Cash App we use Protocol Buffers to model the domain and establish communication between our server and client apps....
https://talkingkotlin.com/going-full-kotlin-multiplatform/ Co-presented with Jesse Wilson. We sit down with Jesse and Egor from CashApp (Square) to discuss how they decided to port OKio and OKHttp completely to Kotlin Multiplatform back when Kotlin wasn’t even officially supported by Google. We discuss their ventures, reactions from the community, as well as some...
Kotlin 1.3.70 landed last week with a bunch of new APIs, bug fixes and tooling improvements (check out the release blog post), but a small change that mostly flew under the radar is this: KT-34743 Support trailing comma in the compiler The compiler now allows leaving a dangling comma after...
Co-presented with John Rodriguez. As more and more Android code is being written in Kotlin, and many developers are switching over from Java, the performance of the Kotlin compiler has become a hot discussion topic. Javac has been tuned and optimized for many years, so how does kotlinc compare? In...
Co-presented with Benoît Quenaudon. Protocol Buffers (or Protobuf) is an efficient schema-based data serialization protocol, and gRPC is a high-performance, HTTP/2-based RPC framework. The two work together flawlessly to help you build world class distributed systems. At Square, client and server engineers collaborate on Protobuf schemas to define APIs. We...
There’s plenty of ways to design an Android application, most of them are correct and some of them scale well. The Cash Android app is growing in size and complexity, which constantly prompts us to re-evaluate our design decisions. This talk will provide a thorough overview of the state of...
Co-presented with Alec Strong. With Kotlin having full interop with Java, mixed codebases have become common and effective - but have made writing developer tools more challenging. How do you support multiple languages with a single tool? How do you convert existing plugins from Java to Kotlin and is there...
https://thecontext.github.io/website/episodes/24-multiplatform/ Co-presented with Jesse Wilson. In this episode Artem and Hannes chatted with Jesse and Egor from Square about multiplatform development with Kotlin. Jesse and Egor shared their experience of migrating Okio to Kotlin and which strategies they have applied to make it multiplatform ready.
Co-presented with Jesse Wilson. Okio is a small library that powers a lot of Square’s open source software, such as OkHttp, Moshi and Wire. Okio makes I/O easy by solving the most common problems in a simple and efficient way. At Square, we’re investing in Kotlin. We love the language...
Back in the early days of Kotlin adoption on Android, many people started writing their unit tests using Kotlin. Even though the primary goal of this approach was to have a possibility to enjoy Kotlin without letting it slip into the actual production code, it turned out that Kotlin is...
Did you know that you can inline properties in Kotlin? I discovered this small feature accidentally while browsing through Kotlin docs, and thought it’s worth a short article. So why is this useful? Let’s take a trivial Android example: val View.isVisible get() = visibility == View.VISIBLE That’s a simple yet...
Input validation is important, so you’re most likely familiar with the following pattern in Java: public static <T> T getFifthElement(@Nonnull T[] array) { if (array == null || array.length < 5) { throw new IllegalArgumentException( "array should be non-null and have at least five elements!"); } return array[4]; } What...
There has recently been a discussion online about the best approach for storing global constants, or public static final fields in Javaspeak. This short article describes available options and points out some of the pitfalls you can run into. But before we start, let’s talk a bit about decompiling Kotlin...
Nowadays, Gradle is undoubtedly The Build Tool in Android development, and a very powerful one. In addition to that, Gradle keeps evolving fast, each new release bringing new features and performance optimizations. However, many of us are using just basic Gradle config and waiting patiently for minutes until our builds...
In this presentation you’ll learn about ways in which Kotlin can improve the readability and maintainability of your unit tests. Kotlin is a very expressive language, and it’s a great tool for writing clean and readable tests. We’ll look into a number of great Kotlin features and frameworks that make...