# art and science of coding

Published articles for art and science of coding.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Maximizing Shared Code in Kotlin Multiplatform Apps

DevFeed: [Maximizing Shared Code in Kotlin Multiplatform Apps](<https://devfeed.tech/articles/the-art-of-multiplatform-programming-the-secret-to-maximizing-shared-code-34121.md>)

Original publisher: [Read original article](<https://artandscienceofcoding.com/science/kmm-maximizing-shared-code/>)

Author: Derek Lee

Published: 2022-10-01T00:00:00Z

Content type: tutorial

Language: en

Sources: [art and science of coding](<https://devfeed.tech/sources/art-and-science-of-coding.md>)

Topics: [Kotlin Multiplatform](<https://devfeed.tech/topics/kotlin-multiplatform.md>), [multiplatform](<https://devfeed.tech/topics/multiplatform.md>), [Mobile](<https://devfeed.tech/topics/mobile.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Dependency injection](<https://devfeed.tech/topics/dependency-injection.md>), [Dependency Inversion](<https://devfeed.tech/topics/dependency-inversion.md>), [Maintainability](<https://devfeed.tech/topics/maintainability.md>), [Android](<https://devfeed.tech/topics/android.md>), [iOS](<https://devfeed.tech/topics/ios.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [dependency-injection](<https://devfeed.tech/tags/dependency-injection.md>), [dependency-inversion](<https://devfeed.tech/tags/dependency-inversion.md>), [dependency-inversion-principle](<https://devfeed.tech/tags/dependency-inversion-principle.md>), [ios](<https://devfeed.tech/tags/ios.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [maintainability](<https://devfeed.tech/tags/maintainability.md>), [mobile](<https://devfeed.tech/tags/mobile.md>), [multiplatform](<https://devfeed.tech/tags/multiplatform.md>), [programming](<https://devfeed.tech/tags/programming.md>), [science](<https://devfeed.tech/tags/science.md>)

### AI overview

This tutorial explains how to maximize shared code in Kotlin Multiplatform applications for iOS and Android. It recommends isolating platform dependencies behind a platform-independent interface and using Dependency Injection and the Dependency Inversion Principle to improve maintainability and reusability.

### Source excerpt

TL/DR; - Writing your platform-dependent code for iOS or Android requires first understanding the platform API dependencies to help you craft a shared platform-independent interface. - Isolate platform dependencies to the smallest surface area possible to increase maintainability and reusability. - Leveraging Dependency Injection (DI) and the Dependency Inversion Principle (DIP) is key to effective multiplatform programming.

## When iOS Engineers Should Use Kotlin Multiplatform's expect/actual Syntax

DevFeed: [When iOS Engineers Should Use Kotlin Multiplatform's expect/actual Syntax](<https://devfeed.tech/articles/why-ios-engineers-should-avoid-this-glorified-kmm-technique-34119.md>)

Original publisher: [Read original article](<https://artandscienceofcoding.com/science/avoid-this-kmm-technique/>)

Author: Derek Lee

Published: 2022-09-22T00:00:00Z

Content type: opinion

Language: en

Sources: [art and science of coding](<https://devfeed.tech/sources/art-and-science-of-coding.md>)

Topics: [kotlin multiplatform mobile](<https://devfeed.tech/topics/kotlin-multiplatform-mobile.md>), [Kotlin Multiplatform](<https://devfeed.tech/topics/kotlin-multiplatform.md>), [Mobile](<https://devfeed.tech/topics/mobile.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Objective-C](<https://devfeed.tech/topics/objective-c.md>)

Tags: [guide](<https://devfeed.tech/tags/guide.md>), [kmm](<https://devfeed.tech/tags/kmm.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [mobile](<https://devfeed.tech/tags/mobile.md>), [objective-c](<https://devfeed.tech/tags/objective-c.md>), [science](<https://devfeed.tech/tags/science.md>)

### AI overview

This article argues that iOS engineers building multiplatform apps with Kotlin Multiplatform Mobile should generally write platform-dependent code in Swift instead of using the expect/actual syntax. It identifies building a multiplatform framework as the main case where the syntax may be worth considering and recommends consulting Apple's Objective-C documentation and Kotlin/Native headers when using it.

### Source excerpt

TL;DR If you're an iOS engineer who wants to build multiplatform apps using KMM, the few benefits of using the expect/actual syntax do not outweigh those of writing your platform-dependent code in Swift. The use-case for iOS engineers to consider leveraging expect/actual syntax would be when building a multiplatform framework. If you're going to use expect/actual, be sure to reference Apple's Objective-C documentation over Swift documentation and use the Kotlin/Native headers for the most accurate representation of the iOS APIs available in Kotlin. The expect/actual Syntax of Kotlin Multiplatform Mobile (KMM) The Kotlin Multiplatform SDK includes a syntactical construct integrated into JetBrains IDEs that engineers can use to define classes and functions that are expect -ed (pun intended) to have platform-specific implementations. The actual implementations are also written in Kotlin separately for Android and iOS. When looking at the code modules in a KMM project: within the KMM shared framework module, you first define a class or a function as expected. Then the actual implementations are written for each supported platform module. The following example illustrates what module the code is defined within for Android and iOS: The `common` module defines the expected classes and functions, and platform modules define the actual implementation. We looked at some simple examples in the last blog. These examples are helpful because they allow us to wrap our heads around the concept before diving into something more complicated. I want to take you on a journey of writing some code using this approach to illustrate how this can become more complicated in practice than expected. In fact, I'm going to make a bold statement and propose that there's only a single scenario where you, the iOS Engineer, should even consider using the expect/actual syntax. This post is part of a series on Kotlin Multiplatform: The iOS Engineer's Guide to Beginning Kotlin Multiplatform Development

## The iOS Engineer's Guide to Beginning Kotlin Multiplatform Development

DevFeed: [The iOS Engineer's Guide to Beginning Kotlin Multiplatform Development](<https://devfeed.tech/articles/the-ios-engineer-s-guide-to-beginning-kotlin-multiplatform-development-34120.md>)

Original publisher: [Read original article](<https://artandscienceofcoding.com/science/kmm-for-ios-engineers/>)

Author: Derek Lee

Published: 2022-08-27T02:00:00Z

Content type: tutorial

Language: en

Sources: [art and science of coding](<https://devfeed.tech/sources/art-and-science-of-coding.md>)

Topics: [Kotlin Multiplatform](<https://devfeed.tech/topics/kotlin-multiplatform.md>), [multiplatform](<https://devfeed.tech/topics/multiplatform.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [iOS](<https://devfeed.tech/topics/ios.md>), [Android](<https://devfeed.tech/topics/android.md>), [Mobile](<https://devfeed.tech/topics/mobile.md>), [Development](<https://devfeed.tech/topics/development.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [business-logic](<https://devfeed.tech/tags/business-logic.md>), [cross-platform](<https://devfeed.tech/tags/cross-platform.md>), [development](<https://devfeed.tech/tags/development.md>), [ios](<https://devfeed.tech/tags/ios.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [mobile](<https://devfeed.tech/tags/mobile.md>), [multiplatform](<https://devfeed.tech/tags/multiplatform.md>), [science](<https://devfeed.tech/tags/science.md>)

### AI overview

A guide for iOS engineers beginning Kotlin Multiplatform development. It explains how to distinguish platform-dependent from platform-independent code and outlines approaches for sharing code between iOS and Android applications, including native implementations and shared business logic.

### Source excerpt

Techniques for Sharing Code using Kotlin Multiplatform

## PostgreSQL

DevFeed: [PostgreSQL](<https://devfeed.tech/articles/postgresql-34117.md>)

Original publisher: [Read original article](<https://artandscienceofcoding.com/devrecipes/database/postgresql/>)

Author: Derek Lee

Published: 2022-03-01T00:00:00Z

Content type: tutorial

Language: en

Sources: [art and science of coding](<https://devfeed.tech/sources/art-and-science-of-coding.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [Databases](<https://devfeed.tech/topics/databases.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [configuration](<https://devfeed.tech/topics/configuration.md>), [timezone](<https://devfeed.tech/topics/timezone.md>), [JSON](<https://devfeed.tech/topics/json.md>)

Tags: [configuration](<https://devfeed.tech/tags/configuration.md>), [database](<https://devfeed.tech/tags/database.md>), [dev-recipes](<https://devfeed.tech/tags/dev-recipes.md>), [installation](<https://devfeed.tech/tags/installation.md>), [json](<https://devfeed.tech/tags/json.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [psql](<https://devfeed.tech/tags/psql.md>), [setup](<https://devfeed.tech/tags/setup.md>), [sql](<https://devfeed.tech/tags/sql.md>), [timezone](<https://devfeed.tech/tags/timezone.md>), [troubleshooting](<https://devfeed.tech/tags/troubleshooting.md>)

### AI overview

A reference guide to PostgreSQL installation, database and user management, SQL statements, configuration, time zone settings, psql commands, JSON fields, and troubleshooting connection problems.

### Source excerpt

Installation / Setup

## Using Makefiles to Simplify Command-Line Test Workflows

DevFeed: [Using Makefiles to Simplify Command-Line Test Workflows](<https://devfeed.tech/articles/readme-as-code-34122.md>)

Original publisher: [Read original article](<https://artandscienceofcoding.com/science/readme-as-code/>)

Author: Derek Lee

Published: 2022-02-19T05:00:00Z

Content type: tutorial

Language: en

Sources: [art and science of coding](<https://devfeed.tech/sources/art-and-science-of-coding.md>)

Topics: [make](<https://devfeed.tech/topics/make.md>), [Command-line interface](<https://devfeed.tech/topics/cli.md>), [test](<https://devfeed.tech/topics/test.md>), [unit tests](<https://devfeed.tech/topics/unit-tests.md>), [ci](<https://devfeed.tech/topics/ci.md>), [iOS](<https://devfeed.tech/topics/ios.md>), [Xcode](<https://devfeed.tech/topics/xcode.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>), [JavaScript](<https://devfeed.tech/topics/javascript.md>)

Tags: [automation](<https://devfeed.tech/tags/automation.md>), [ci](<https://devfeed.tech/tags/ci.md>), [command-line](<https://devfeed.tech/tags/command-line.md>), [communication](<https://devfeed.tech/tags/communication.md>), [discoverability](<https://devfeed.tech/tags/discoverability.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [ios](<https://devfeed.tech/tags/ios.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [make](<https://devfeed.tech/tags/make.md>), [science](<https://devfeed.tech/tags/science.md>), [simplicity](<https://devfeed.tech/tags/simplicity.md>), [test](<https://devfeed.tech/tags/test.md>), [unit-tests](<https://devfeed.tech/tags/unit-tests.md>)

### AI overview

This tutorial argues for using Makefiles to simplify and standardize command-line test execution across projects. It contrasts Makefiles with Fastlane and shell scripts, and begins an iOS example using Make targets to run an Xcode test suite.

### Source excerpt

I make a point of always running the test suite (at least the fastest of the bunch: the unit tests) from the command line before pushing code to CI to confirm that all has gone smoothly.

## Efficiently Learning IDE Keyboard Shortcuts

DevFeed: [Efficiently Learning IDE Keyboard Shortcuts](<https://devfeed.tech/articles/efficiently-learning-ide-keyboard-shortcuts-34116.md>)

Original publisher: [Read original article](<https://artandscienceofcoding.com/art/how-to-learn-keyboard-shortcuts/>)

Author: Derek Lee

Published: 2022-01-29T03:00:00Z

Content type: tutorial

Language: en

Sources: [art and science of coding](<https://devfeed.tech/sources/art-and-science-of-coding.md>)

Topics: [ide](<https://devfeed.tech/topics/ide.md>), [Learning](<https://devfeed.tech/topics/learning.md>), [Development](<https://devfeed.tech/topics/development.md>), [pair\_programming](<https://devfeed.tech/topics/pair-programming.md>), [Tool](<https://devfeed.tech/topics/tool.md>)

Tags: [art](<https://devfeed.tech/tags/art.md>), [developer](<https://devfeed.tech/tags/developer.md>), [development](<https://devfeed.tech/tags/development.md>), [ide](<https://devfeed.tech/tags/ide.md>), [keyboard](<https://devfeed.tech/tags/keyboard.md>), [keyboard-shortcuts](<https://devfeed.tech/tags/keyboard-shortcuts.md>), [learning](<https://devfeed.tech/tags/learning.md>), [pair-programming](<https://devfeed.tech/tags/pair-programming.md>), [plugin](<https://devfeed.tech/tags/plugin.md>), [plugins](<https://devfeed.tech/tags/plugins.md>), [productivity](<https://devfeed.tech/tags/productivity.md>)

### AI overview

This tutorial explains how developers can learn IDE keyboard shortcuts through pair programming, IDE feedback, menus, and plugins such as Presentation Assistant, KeyLimePie, and Key Promoter X.

### Source excerpt

Super charge your development productivity!

## Git Bisect

DevFeed: [Git Bisect](<https://devfeed.tech/articles/git-bisect-34118.md>)

Original publisher: [Read original article](<https://artandscienceofcoding.com/devrecipes/git/bisect/>)

Author: Derek Lee

Published: 2020-01-01T00:00:00Z

Content type: tutorial

Language: en

Sources: [art and science of coding](<https://devfeed.tech/sources/art-and-science-of-coding.md>)

Topics: [Git](<https://devfeed.tech/topics/git.md>), [bug](<https://devfeed.tech/topics/bug.md>), [test](<https://devfeed.tech/topics/test.md>)

Tags: [behavior](<https://devfeed.tech/tags/behavior.md>), [bug](<https://devfeed.tech/tags/bug.md>), [commit](<https://devfeed.tech/tags/commit.md>), [dev-recipes](<https://devfeed.tech/tags/dev-recipes.md>), [example](<https://devfeed.tech/tags/example.md>), [git](<https://devfeed.tech/tags/git.md>), [test](<https://devfeed.tech/tags/test.md>)

### AI overview

A reference guide to using Git Bisect to identify the commit that introduced a bug. It explains how to start the bisect process, mark known good and bad commits, test intermediate commits, repeat the process, and finish after finding the problematic commit.

### Source excerpt

Reference Documentation