Kotlin Style Guide
Why You Need a Style Guide
It is crucial to have a style guide to follow and look up to whenever you are working on a project. Having a style guide is even more important when you work with other developers.
Imagine a company that has hundreds of developers working on a project. Without a style guide to follow, each developer has his or her own preferences when it comes to how to name variables, number of spacing for tabs, and even where to place the starting brackets. Dev A might avoid using a comma because he hates using them. Dev B likes having lots of white spaces so he leaves a bunch of empty lines, which forces other developers to frequently scroll.
However, we can eliminate all of these problems by having a single style guide that all developers must follow. Big companies like AirBnb, Facebook, and Google all have their own set of rules for each programming language. And it is a requirement that their developers must maintain and conform to their style guides in order to ensure that their projects are easy to read, document, and maintain.
As you work on your homework project, we encourage you to look up and follow one of the style guides that are freely available on the Internet or pick from a list we've have provided below.
Selection of Style Guides
Kotlinlang.org's Coding Conventions offers the current coding style guide for the Kotlin language.
Android's Kotlin Style guide is Google's very own style guide for writing Kotlin for Android development
Ray Wenderlich's Kotlin Style Guide is another recommended one. Ray also frequently posts lots of useful content on Kotlin too.
Last updated