Kotlin je visoke performanse jezik (razvijen od JetBrains), radi na JVM i koristi postojeće Java biblioteke i alati. On the other hand, Java također mogu komunicirati s Kotlin komponente besprijekorno. Primarni cilj Kotlin je da bude koristan za praktične stvarnom životu projekata, pa je razvijen od nule i napravio atraktivan na postojeće Java programere. To je također jednostavan za naučiti u odnosu na ostale JVM na temelju jezicima kao što su Scala. Kao što je Java je duboko interoperabilnost s Kotlin, Java programeri su više privlače naučiti i test. Kotlin ima jaku komercijalnu podršku i stabilan poslovni model, Ne tako da će vjerojatno dobiti napušten u bliskoj budućnosti. Iz perspektive zahvata, Kotlin je vrlo obećavajuće i to će donijeti više mogućnosti u narednim danima. Dakle, možemo sa sigurnošću predvidjeti da će Kotlin biti sljedeća velika stvar za Java zajednici.
Rješavanje Java razvojnih pitanja
JetBrains did not intend to do anything revolutionary with Kotlin. It wanted to provide a useful language that solves existing problems. Kotlin ima sljedeće ciljeve koji će vam pomoći riješiti ili izbjeći postojeće probleme u Java i bolje.
- Provide an intuitive language that can infer from codes written by developers and do a lot of work on behalf of developers.
- Improve productivity by reducing the effort needed to write code. For example, a 50 linije (cca.) kod napisan u Javi može se svesti na 2/3 (cca.) linije u Kotlin.
- Prevent null pointer exceptions.
- Provide quick code compilation.
- Reduce learning time for developers by providing documentation and support.
- Kotlin kod sintaksa je lako razumjeti, tako da je kod pregleda je jednostavan čak i za novi došljak.
- Runtime nadzemne je također niska kao standardni knjižnica je mali i kompaktan.
Osim gore navedenih glavnih prednosti, Kotlin također pruža mnogo drugih oslonaca kao jednostavan kod pretvorbe između Jave i Kotlin, jednostavna integracija IDE, puna ispravljanje pogrešaka, re-factoring i profiliranja itd. So, ukupno, Kotlin definitivno će smanjiti bol točke s kojima se suočavaju Java programere.
Ljubav Kotlin značajke
Istaknute značajke Kotlin su opisane u nastavku koji Java programeri trebaju vole koristiti.
No more null pointer exceptions
This is probably the most important feature. The null pointer exception is one of the most dreaded, unsolved issues developers face. Kotlin’s type system does not compile code that assigns or returns null. See the below example.
val name: String = null // tries to assign null, won’t compile
stephen getName() : String = null // tries to return null, won’t compile
Since every method call on a nullable type can potentially cause a null pointer exception, the Kotlin compiler forces the developer to use the Elvis operator whenever the call result is assigned to a non-null type.
Lesser coding
Kotlin compiler can infer or understand from the code written by a developer and can develop or write the remaining code unlike in Java. Java requires the developer to explicitly write everything which consumes a lot of time and effort. Kotlin saves effort and time and improves productivity. For example, Kotlin compiler can infer types in variable declarations as well as compiler-generated getters/setters/equals/hashCode. On the other hand, the Java compiler does not infer as much and requires the developer to explicitly write code.
Jednostavan za naučiti i koristiti za Java programere
Since Kotlin is nothing revolutionary, any software developer can learn and start to use it especially the Java and Scala developers. The main reason is Kotlin is dependent on Java in a lot of ways and extensively uses the Java library, na primjer. Also, Kotlin was inspired by Scala and according to many; it looks a lot like Scala. Šifra koristi JVM i javac, the primary Java compiler. The learning curve for Java developers is not steep and they can leverage the Kotlin documentation and get started quickly with coding.
unatrag kompatibilan
Kotlin offers backward compatibility for Java versions 6 i 7. It states in its blog that over the next few releases, it is going to speed up development workflow, reduce the size of the runtime library and provide more tooling support. Kotlin will be introducing a feature known as incremental compilation in its Gradle build plug-in. This will enable Kotlin to compile and build only the changes in the code and not the whole code over. This is going to save a lot of time.
IDE interoperabilnost
Kotlin ima puno oslonaca za povećanje produktivnosti. Vrlo je interoperabilne s ides, tako refactoring, otklanjanje grešaka, u potrazi, jedinica testiranje su vrlo jednostavne za izvođenje.
Implementacija i korištenje gore navedene značajke su stvarno zanimljivo, tako da Java programeri bi trebali dati ga probati i okusiti ljepotu Kotlin. Može biti, Java programer može pretvoriti dio svog Java koda u Kotlin i vidjeti kako to obavlja. Bez obzira na način na koji ćemo slijediti, Kotlin definitivno će vam dati dobar dojam.
Idemo se zaključiti
Its evolving state notwithstanding, Kotlin already looks like a tool that is going to improve productivity significantly. Many developers are positive about Kotlin enabling them to achieve a breakthrough in their productivity. A discussion on Hacker News website which hosts a discussion on Kotlin reveals that Kotlin solves many Java pain points without really reinventing how coding should be done. What are the challenges ahead? To find huge acceptance, it needs to be able to impress firms like Google which is a huge Java user and has been working on other alternatives to Java. It will be interesting to watch how Kotlin goes about its plans and how it faces the challenges ahead.