Founded in 2003, Dianping is one of the earliest consumer review websites in the world. With the advent of the mobile Internet era, users can easily query information about restaurants, cinemas, shopping malls, scenic spots and hotels in any city using dianping APP on their mobile phones, and see the comments written by other users. The app also uses user review data and expert reviews to create lists, such as “Bing series” lists and “Black Pearl” restaurant review systems. It also recommends restaurants and attractions that users may be interested in in the news stream based on their preferences.

△ Must-have list

The black Pearl series restaurant evaluation system

In order to ensure good user experience and continuous iteration of new functions, application stability and development efficiency are the top priorities of the review technology team.

“The development cooperation mode of Dianping Android apps is that shell Engineering relies on a series of basic and business components. The part applied to Kotlin is scattered among more than 10 business teams and nearly 40 business warehouses, covering core businesses such as home page, merchant page, live broadcast and list.”

“– Cheng Kangyang, Android developer

Kotlin’s modern language features, such as extension functions and lambda expressions, helped the team reduce code by nearly 30 percent and improve requirements development efficiency by nearly 20 percent. Therefore, the review team has used Kotlin to develop and maintain about 15% of its libraries.

△ Kotlin extension function

Another feature Kotlin has the development team praising is null security, which is also due to Kotlin’s excellent interoperability with Java — you just need to write @nullable and @nonNULL annotations in your Java code. You can ensure that the Kotlin code gets the right nullity inference. This convenient and powerful air safety feature also helped the team reduce application NPES from 3 per day to 0 per day.

Using null-safe annotations in Java code ensures that Kotlin code gets the right nullability inference

Ma shuangfei is one of the team’s “code cleanliness freaker.” Nowadays, almost every module he is in charge of is written and maintained entirely using Kotlin. And to use Kotlin so aggressively, you don’t need just one person who is fluent in the language. Fortunately, the cost of promoting Kotlin in a team is not that high.

“Kotlin’s syntax is intuitive and modern. Learn the basics in a day or two and you’ll be able to use Kotlin for development. So if you don’t have Kotlin’s development experience, it’s not a problem. After all, the learning cost is not high. Certainly someone with Kotlin’s experience is better!”

— Ma Shuangfei, Android developer

Another reason that gives teams the freedom to promote Kotlin is powerful tool support. When requirements development involves large-scale modification of old Java code, team members use Android Studio’s convenient Convert Java File 2 Kotlin File function to Convert Java code into Kotlin code first, Continue development with Kotlin.

△ Convert Java File 2 Kotlin File function

“User experience is a very broad concept, and our product teams are working hard to help users eat better and live better with better and updated features. At the same time, we are working hard to improve the experience of developing our products with new technologies.”

— Zhang Xiaoyu, technical director of the team

As Zhang said, both the developer experience and the user experience are important. Kotlin can help review technology teams develop products faster and more flexibly while preserving historical assets, allowing developers to focus on business logic instead of wasting on template code.

Kotlin will be the language of choice for more and more review developers across the review community.

How many of your current development projects use Kotlin? Feel free to share your thoughts about using Kotlin in the comments section.

Click here to watch the Android Developer story video.