What Java inexperienced people did to study Kotlin

Introduction

I'm a college student who usually writes only Python. Currently, I am making a messaging app as a training because I was accepted by an intern who applied for it with half interest.

For this intern, the recommended language was Kotlin on both the server side and the client side. I was a little worried if I could implement it in Kotlin because I had never touched Java, but when I tried it while investigating, I was able to remember it ** easily **.

I think that many articles on the net are Kotlin articles for the purpose of comparison with Java. For someone like me who isn't migrating from Java, it's also hard to get along with.

So, this time, I would like to introduce in order what Java inexperienced people did to study Kotlin.

Understanding language

Kotlin Startbook-New Android Programming

Kotlinスタートブック -新しいAndroidプログラミン

https://www.amazon.co.jp/Kotlinスタートブック-新しいAndroidプログラミング-長澤-太郎/dp/4865940391/

Overview

--The first book I bought to learn Kotlin's grammar ――The layout is beautiful and the design is easy to stick to.

You can find it by searching for "Kotlin" on Google, but it's hard to find a site that is systematically organized from the basic grammar. I rarely study with books, but I bought it this time.

The content is divided into three parts, the first two parts are about Kotlin's grammar, and the last third part is about the implementation on Android. The amount is also about this ratio.

grammar

It covers ** basic grammars ** required for programming such as classes and inheritance from simple conditional branches and functions. Anyone who has even a little bit of a bit of another programming language will understand it right away, and even those who have no programming experience will (probably) understand it.

Android This is written on the assumption that you have some knowledge of the Android implementation. ** ** I was also a complete beginner with the Android implementation, so I had a little trouble understanding it. However, when I read it back now, what was stuck was not Kotlin, but the description of the xml file, the concept of the adapter, and so on. It's written using a lot of Kotlin-specific techniques, so I think there are many parts that make me think "I see." For client engineers who are considering migrating from Java.

Kotlin web application new server-side programming

Kotlin Webアプリケーション 新しいサーバサイドプログラミング

https://www.amazon.co.jp/Kotlinスタートブック-新しいAndroidプログラミング-長澤-太郎/dp/4865940391/

Overview

--Introduction to Kotlin written by the same person as before --Half is written about ** implementation of server-side API **

In Java, a sample implementation using Spark and Spring Boot, which are famous as web frameworks, is introduced. However, techniques using Kotlin-specific grammar were also written, and some of them were "certainly useful."

If you don't implement Android, this book may be better.

After learning the basics

Once you've learned the basics, you'll have to look at what you don't understand individually. Here, I would like to introduce an article that focuses on the part where I am stuck.

Summary of usage of Kotlin scope function

--Many ** scope functions ** are provided by default in Kotlin. ――Frequently used scope functions are organized in a table in an easy-to-understand manner, and I was able to understand them easily. ――There are definitions and examples for each scope function, so I often look at it as if I were looking at the reference.

Kotlin Grammar-Functions and Lambda

--Kotlin has an example of a ** higher-order function **. ――When I wanted to write a callback-like process on my own, I searched for it. ――When I first saw the definition of a higher-order function, I thought, "What is this?", But I understood it by reading it carefully.

Introduction to Kotlin coroutines

--This article I found because I wanted to do ** asynchronous processing ** in Kotlin. ――Honestly, I couldn't understand it at first when I read it, but I could understand it after reading ** n times. ** ** ――Look at the practical examples using Coroutines described later, and if you want to investigate in detail, you should take a look.

Make Retrofit more convenient with Kotlin's Coroutines!

--This is an implementation example of asynchronous API client using Retrofit + Coroutines. ――It seems that RxJava is the mainstream for asynchronous processing on Android, but I learned by reading that the number of implementations using Coroutines will increase as the transition to Kotlin progresses. -** I was surprised that asynchronous processing can be written synchronously without using callbacks. ** **

Reference - Kotlin Programming Launguage --The official Kotlin reference. ――Somehow ** † Strongest † ** ――I think that the British and strong people can learn everything with this alone (I can't do it)

Summary

What did you think? It's easy to think that Kotlin has to be learned from Java, but it's surprisingly easy to learn. There is also a part that makes you feel a modern language in writing.

"Buy a book for the time being, and if you have any questions, look it up online." This may be the fastest way to learn Kotlin.

Why don't you study Kotlin with this in mind?

~~ It's a secret that I sometimes think "This processing Python is quick". ~~

Recommended Posts

What Java inexperienced people did to study Kotlin
What I did when I converted java to Kotlin
A study method for inexperienced people to pass Java SE 8 Silver in one month
How to study Java Silver SE 8
Kotlin Class to send to Java developers
[Android] Convert Android Java code to Kotlin
What I thought about when I started migrating from Java to Kotlin
Kotlin Class part.2 to send to Java developers
What you did to get the Oracle Certified Java Programmer, Silver SE 8
"I'm sure it's good to study Java"
Kotlin scope functions to send to Java developers
Inexperienced learning methods to get Java Silver 11
What Java programmers find useful in Kotlin
Memo for migration from java to kotlin
Kotlin functions and lambdas to send to Java developers
Introduce Kotlin to your existing Java Maven Project
I did Java to make (a == 1 && a == 2 && a == 3) always true
Migrate from Java to Server Side Kotlin + Spring-boot
Initial settings for rewriting Java projects to Kotlin
What a beginner did to understand Object Orientation
Getting started with Kotlin to send to Java developers
How to get and study java SE8 Gold
Two-dimensional array by just starting to study Java
Where Java programmers tend to trip over Kotlin
How to write Java String # getBytes in Kotlin?
Let's study Java
What is java
What is Java
[Java] Introduction to Java
Java 8 study (repeatable)
Java study memorandum
Introduction to java
Kotlin Study Book (Kotlin)
Mastering Kotlin ~ Convert Java File to Kotlin File Road to Graduation ~ Part 3
paiza Ruby What I did to become B rank
Mastering Kotlin ~ Convert Java File to Kotlin File Road to Graduation ~ Part 2
Mastering Kotlin ~ Convert Java File to Kotlin File Road to Graduation ~ Part 1
I want to transition screens with kotlin and java!
What Java engineers need to prepare for the Java 11 release
I tried to find out what changed in Java 9
How to study kotlin for the first time ~ Part 2 ~
How to study kotlin for the first time ~ Part 1 ~
Java beginners who used Ruby stumbled on learning Spring, what they did to solve it