Why Trailing Commas In Kotlin Are Hype
An Android Developer's Blog
by Egor Andreevich
4y ago
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 compilerThe compiler now allows leaving a dangling comma after function, constructor, lambda parameters, and many other places where it was previously forbidden. Why does it matter? The answer is - the diffs! Let's look at an example: class NoCommas( val foo: Int ) class YesCommas( val foo: Int, ) We've got two simple classes, each declaring a single property insid ..read more
Visit website

Follow An Android Developer's Blog on FeedSpot

Continue with Google
Continue with Apple
OR