Skip to main content

Kotlin fun to learn

Kotlin is a programming language developed by JetBrains for modern multiplatform applications. It runs on the Java Virtual Machine(JVM) and also can be compiled to JavaScript code or use the Low Level Virtual Machine(LLVM) compiler infrastructure. It is safe, concise and fun to read and write.

why kotlin ?

kotlin is a statically typed programming that works in JVM, Android, JavaScript, and Native. It compiles to bytecode which makes a strong case for incorporating performance tuning into the development. some main features:

1. Open Source: Kotlins is distributed under Apache License, Version 2.0. The kotlinc(Kotlin compiler), Intellij IDEA plugin, enhancements to basic Java libraries and build tools all are open source.

2. Interoperable with Java and Android: It is designed with Java interoperability in mind. This means all current java and the android code works smoothly with kotlin.

3. Easy to Learn: It is influenced by Java, Scala, Groovy, C#, JavaScript and Gosu so learning kotlin is easy as one is familiar with any other programming language. 

4. Tool-friendly: As it is developed by JetBrains, it's is seamlessly integrated with IDE developed by them. Some of IDE were IntelliJ IDEA, Android Studio, Eclipse and also work with command line using kotlin compiler.

5. Safe: Avoid entire classes of errors such as null pointer exceptions. It also has the ability to catch more errors at run-time as it is statically typed.

Many companies like Coursera, Atlassian, Evernote, Uber, Pinterest, Corda, Netflix, Trello etc. are using kotlin to create applications. At Google, I/O held on 17 May 2017, Android team announced Kotlin as an official language for Android app development.

Tools for learning kotlin are:
1. IntelliJ IDEA,
2. Android Studio,
3. Eclipse, and 
4. Also, kotlinc (kotlin compiler) for the command line.
Link: kotlin compiler

First Kotlin Program:

fun main(args : Array<String>){
     println("Hello, Kotlin!")
}

output:

Hello, Kotlin!

Above code is equivalent to

class HelloJava{
        public static void main(String[] args){
               System.out.println("Hello, Java!");
        }
}

Kotlin Website(Official site):

To learn kotlin, the official site is the most reliable source to follow:
1. kotlin reference,
2. kotlin tutorial, and 
3. kotlin Blog.

Comments

Popular posts from this blog

Kotlin Coding Conventions

In this post, I will discuss the Kotlin coding conventions which are a lot similar to other programming languages. So without further delay lets move to our today's discussion. Source code organization Source code organization is one of the first things we need to discuss in Kotlin coding conventions . Just like in other programming languages, an organization of source code is important in Kotlin for a consistent look across all the projects. Directory structure The source files should reside in the same source root as the Java source files, and follow the same directory structure. In pure Kotlin projects, the recommended directory structure is to follow the package structure with the common root package omitted. Example: if all the code in the project is in the "org.example.kotlin" package and its sub-packages, files with the "org.example.kotlin" package should be placed directly under the source root, and files in "org.example.kotlin.foo

Getting Started With Laravel & React.

Getting started with Laravel & React  is easy now with Laravel version 5.5 which is the next long term support (LTS) version of Laravel (the last being 5.1).  In prior versions of Laravel, only Vue scaffolding is included, but with the release of Laravel 5.5, new front-end preset options are available for bootstrap and React including Vue. In a fresh installation of Laravel 5.5, you can easily swap your Vue scaffolding to React scaffolding using the " php artisan preset react " command. The default Mix configuration, components, and all other related files will be updated accordingly. Now to understand it more let's get started with simple Laravel 5.5 & React demo project. First, choose a directory or folder where you want to place your Laravel project then open a terminal and copy the below command: composer create-project --prefer-dist laravel/laravel="5.5.*" DemoProject After successful completion, we need to change our Vue