Comment Kotlin peut résoudre les points de douleur de développeur Java?

Kotlin Vs Java

Kotlin Vs Java

Kotlin is a high performance language (developed by JetBrains), runs on the JVM and uses existing Java libraries and tools. On the other hand, Java can also interact with Kotlin components seamlessly. The primary goal of Kotlin is to make it useful for practical real life projects, de sorte qu'il a été développé à partir de zéro et fait attrayant pour les développeurs Java existants. Il est également facile à apprendre par rapport aux autres langages basés JVM comme Scala. Comme Java a une interopérabilité profonde avec Kotlin, les développeurs Java sont plus attirés à apprendre et à tester. Kotlin a un support commercial solide et modèle d'affaires stable, de sorte qu'il ne sera pas susceptible d'obtenir abandonné dans un avenir proche. Du point de vue d'un développeur, Kotlin est très prometteur et il apportera plus d'opportunités dans les prochains jours. Donc, nous pouvons prédire sans risque que Kotlin sera la prochaine grande chose pour la communauté Java.

Résolution des problèmes de développement Java

JetBrains did not intend to do anything revolutionary with Kotlin. It wanted to provide a useful language that solves existing problems. Kotlin a les objectifs suivants qui aideront à résoudre ou éviter les problèmes existants en Java et un meilleur rendement.

  • Provide an intuitive language that can infer from codes written by developers and do a lot of work on behalf of developers.
  • Améliorer la productivité en réduisant l'effort nécessaire pour écrire du code. For example, un 50 lignes (environ.) un code écrit en Java peut être réduite à 2/3 (environ.) lignes Kotlin.
  • Empêcher les exceptions de pointeur nul.
  • Fournir code rapide compilation.
  • Réduire le temps d'apprentissage pour les développeurs en fournissant la documentation et de soutien.
  • la syntaxe du code Kotlin est facile à comprendre, de sorte que la révision du code est simple même pour un nouveau venu.
  • les frais généraux d'exécution est aussi faible que la bibliothèque standard est petit et compact.

Outre les avantages ci-dessus majeurs, Kotlin fournit également beaucoup d'autres supports tels que la conversion de code facile entre Java et Kotlin, intégration IDE facile, complète le débogage, re-factoring et le profilage, etc.. So, au total, Kotlin va certainement réduire les points de douleur rencontrés par les développeurs Java.

Amour caractéristiques Kotlin

The salient features of Kotlin are described below which Java developers should love to use.

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.

Easy to learn and use for Java developers

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, par example. Also, Kotlin was inspired by Scala and according to many; it looks a lot like Scala. The code uses the JVM and the 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.

Backward compatible

Kotlin offers backward compatibility for Java versions 6 et 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 interoperability

Kotlin has a lot of supports for enhancing productivity. It is highly interoperable with the IDEs, so refactoring, debugging, searching, unit testing are very easy to perform.

Implementing and using the above features are really interesting, de sorte que les développeurs Java devraient essayer et goûter la beauté de Kotlin. Peut être, un développeur Java peut convertir une partie de son code Java dans Kotlin et de voir comment il fonctionne. Quelle que soit la façon dont nous suivons, Kotlin va certainement vous donner une bonne impression.

Concluons

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.

 

Tagged on:
============================================= ============================================== Buy best TechAlpine Books on Amazon
============================================== ---------------------------------------------------------------- electrician ct chestnutelectric
error

Enjoy this blog? Please spread the word :)

Follow by Email
LinkedIn
LinkedIn
Share