Asian Tech is now Monstarlab.Visit our new website

asiantech asiantech
  • Development
    • Our Strength
    • Team Structure
    • Our Tech Stack
    • How To Start
    • FAQ
  • our work
    • Cases
    • Testimonials
  • About us
    • Vision
    • Company Profile
    • Our Story
    • our CEO
  • Careers
    • Join Us
    • Who We Are
    • Life at Asian Tech
    • Jobs
    • Job Roles
  • News
  • Blog
  • Jp / En
  • Contact us
asiantech
Jp / En
Contact Us
  • All
  • Development
  • Interview
  • Danang
  • Asian Tech
  • Others
IT professional Apr 26, 2019

GET TO KNOW KOTLIN!

Share
Tweet img

Hi, my name is Hung Truong, an Android and Backend developer at Asian Tech. Having known Kotlin since its first Beta versions, I enjoy researching its possibilities and sharing knowledge to anyone interested in Kotlin by continuously adopting and promoting its potential.

This time I would like to share about how we use Kotlin at Asian Tech.  

Content

  1. Why Kotlin?
  2. Key Features
    1. Null Safety
    2. Extension Functions
    3. Data Classes
    4. Java Interoperable
    5. Multi Platform
    6. Coroutines
  3. Kotlin at Asian Tech
  4. A glance at the future

Why Kotlin?

Kotlin is an Object Oriented Language created by a Czech company called JetBrains. It is also a statically-typed language like Java, can be run on Java Virtual Machine and use LLVM to compile native code that supports multiple platforms. The very first question people usually make is why they invented this language. And what are its advantages over the others?

Interestingly JetBrains did not make Kotlin to sell, they made it to solve their own development problem instead. Most of their products were built with Java. That means a huge amount of maintenance work will be required over time. Java, like all of us know, is a powerful, stable but at some points using old-fashioned ways to write code.

It would be extremely cost intensive to rewrite all of their existing Java applications in any other languages. With that being said what they needed was a modern language that was compatible with Java, so that they could add new features to old applications using the new language without completely rewriting the applications from scratch. And that’s where Kotlin was born.

Key Features

Kotlin is being adopted progressively by the industry. As of right now Android is still the main reason why they love Kotlin and come along with Kotlin. But we still have 30% of total Kotlin people who tend to be experienced programmers are using this language for Backend development. Let’s take a look at the spotlighted features that make people fall in love with Kotlin.

 

 

Null Safety

Null safety is the favorite feature for everyone who ever had a NullPointerException in Java. If you operate servers that run JVMs, there is no need to mention anymore about all the incidents involving NullPointerExceptions. Then you may ask yourself if there is any chance that none of those incidents would have happened. Lucky for you Kotlin is null safe by default! In Kotlin, from the variable declaration, you have to decide the variable whether nullable or not nullable and then the compilation will help you to avoid calling the null reference.

Extension Functions

If you’ve ever watched any Intro to Kotlin talk, you’ve probably seen extension functions being told as one of the best features of this language. With Java, you might have to inherit a class or create some utility static method just to add a small piece of functionality to some classes. It works fine but not really convenient.

Kotlin provides the ability to extend a class with new functionality without having to inherit from the class or use any type of design pattern such as Decorator. It allows you to add behavior to a class without the need of getting to its source code since an extension function can be declared outside the scope of its class. And by doing so, they also improve the readability of your code.

Data Classes

While building any application, we often need to create classes in which the primary purpose is to hold data/state. These classes generally contain the same old boilerplate code in the form of `getters`, `setters`, `equals()`, `hashcode()` and `toString()` methods, and with these methods, it probably takes about 50 lines of code. You don’t need to write these code by yourself, any good IDE can generate all the boilerplate for you but the code is still there.

Kotlin has a better solution for you to create the classes to hold data/state. It’s called a Data Class. A Data Class is like a regular class but with some additional functionalities.

 

 

Java Interoperable

Java was born in the early 1990s and until now Java is still the most popular programming language for developers. Along with its long history, an abundant ecosystem with so many frameworks and libraries was created by Java. By using Java’s legacy and with the ability to be 100% interoperable with Java, we can use both languages in the same project without any problem.

 

 

Multi Platform

Kotlin Multiplatform project was introduced since Kotlin version 1.2 and 1.3. From the beginning, working on all platforms is an ultimate goal for Kotlin and the more important goal is the ability to share code among platforms. Despite the fact that it is slowly picking up, cross-platform Kotlin is still very promising for developers to truly write once run anywhere, so that they can save effort for the more challenging stuff in the near future.

Coroutines

Have you ever created million of threads running at the same time in your code? You will be highly likely to get an OutOfMemoryException because of the expensive and heavy Threads.

Coroutines, introduced since Kotlin 1.1, are computer-program components that generalize subroutines for non-preemptive multitasking. You can think of a coroutine as a light-weight thread. Like threads, coroutines can run in parallel, wait for each other and communicate. The biggest difference is that coroutines are very cheap, almost free: we can create thousands of them, and pay very little in terms of performance. True threads, on the other hand, are expensive to start and keep around. A thousand threads can be a serious challenge for a modern machine.

Kotlin at Asian Tech

 

 

 

Getting on with Kotlin from its first Beta version, we at Asian Tech are expanding Kotlin task force progressively.

By adopting Kotlin and applying it to real projects, what Kotlin benefited us are incredibly amazing in terms of Effort, Performance and Education Time.

・More concise and easier to learn compared with Java
・40% cut off lines of code
・More safety, less bugs

 

 

A glance at the future

Since Google announced Kotlin as the first class support language on Android in Oct 2017, Kotlin has definitely been growing very fast. Provided all the improvements and benefits Kotlin brings to us over the old man Java including the conciseness, safety and productivity, there is no doubt that Kotlin will completely replace Java in developing Android applications in the very near future.

But people actually expect more to see how Kotlin will manage to seriously break into the communities outside of Android to become the new standard for Web, iOS and Backend. Given all the support by both JetBrains and Google, and the almost universal love that Kotlin receives in the industry, we are sure there are exciting times ahead for Kotlin ecosystem.

Share
Tweet img

関連記事

  • Employee interview with Toshihiko Kubo What did I learn as project manager?
    Employee interview with Toshihiko Kubo What did I learn as project manager?

    Mar 20, 2019

  • What is year end party in Vietnam like Report on Asian Techs YEAR-END CELEBRATION 2018
    What is year end party in Vietnam like Report on Asian Techs YEAR-END CELEBRATION 2018

    Mar 20, 2019

  • What do I do as Business Analyst at AT?
    What do I do as Business Analyst at AT?

    Mar 20, 2019

  • Meet the CEO, Mr. Truong Dinh Hoang at Asian Tech Inc.
    Meet the CEO, Mr. Truong Dinh Hoang at Asian Tech Inc.

    Mar 20, 2019

Most Popular

  • image
    What do I do as Business Analyst at AT?

    Mar 20, 2019

  • image
    GET TO KNOW KOTLIN!

    Apr 26, 2019

  • image
    Employee interview with Toshihiko Kubo What did I learn as project manager?

    Mar 20, 2019

  • image
    Meet the System Engineer, Mr. Sai Takashi at Minagine Inc.

    Mar 27, 2019

  • image
    Meet the CEO, Mr. Truong Dinh Hoang at Asian Tech Inc.

    Mar 20, 2019

  • image
    What is year end party in Vietnam like Report on Asian Techs YEAR-END CELEBRATION 2018

    Mar 20, 2019

Top Hashtags

  • # BA
  • # Interview
  • # Asian Tech
  • # AWS
  • # Offshore
  • # IT beginner
  • # Startup
  • # IT engineer
  • # IT human resouce
  • # Event
  • # IT professional

ASIAN TECH SOCIAL MEDIA

asiantech
Contact us
  • home
  • Development
  • our work
  • About us
  • Careers
  • News
  • Blog
Powered by
monstarlab

Copyright Asian Tech Co., Ltd. 2019

Asian Tech is now ...

logo

Starting February 25, Asian Tech will be unified under the Monstarlab brand.

Visit our new website