Android Programming with Kotlin for Beginners
上QQ阅读APP看书,第一时间看更新

Learning the jargon

Throughout this book, I will use simple English to explain a number of technical concepts. I will not ask you to read the technical explanation of a Kotlin or Android concept that has not been previously explained in non-technical language.

Note

A note to Java programmers who are new to Kotlin: if you have done some Java programming, then things are about to get weird! You might even swear that I have made some errors; perhaps you might even think that I have forgotten to add semicolons to the ends of all the lines of code! I urge you to keep reading because I think you will discover that Kotlin has some advantages over Java because it is more succinct and expressive. Learning Java still has its place because most of the Android API is still Java, and even if the entire Android community were to drop Java immediately (and they haven't), there would still be legacy Java code for years to come. I won't continually point out the differences between Java and Kotlin because there are so many and such an analysis is unnecessary. If you are interested, I recommend this article: https://yalantis.com/blog/kotlin-vs-java-syntax/. Ultimately, Kotlin and Java compile to the exact same Dalvik-compatible Java byte code. In fact, Java and Kotlin are 100% interoperable and can even be mixed together in a project. You can even paste Java code into a Kotlin project, and it will be instantly converted to Kotlin.

The Kotlin and Android communities are full of people who speak in technical terms; therefore, to join in and learn from these communities, you need to understand the terms that they use.

So, the approach that this book takes is to learn a concept or get a rough outline using entirely simple language, but at the same time introduce the jargon or technical terms as part of the learning.

Kotlin syntax is the way that we put together the language elements of Kotlin to produce code that executes. The Kotlin syntax is a combination of the words that we use and the formation of those words into sentence-like structures that is our code.

These Kotlin "words" are many in number but, taken in small chunks, they are certainly easier to learn than any human language. We call these words keywords.

I am confident that if you can read plain English then you can learn Kotlin, because learning Kotlin is much easier than learning to read English. So, what then separates someone who has finished an elementary Kotlin course such as this one and an expert programmer?

The answer is the exact same things that separate a student of language and a master poet. Expertise in Kotlin comes not in the number of Kotlin keywords we know how to use, but in the way that we use them. Mastery of the language comes through practice, further study, and using the keywords more skillfully. Many consider programming an art as much as a science, and there is some truth to this.