Com pot resoldre Kotlin punts de mal de Java Developer?

Kotlin Vs Java

Kotlin Vs Java

Kotlin és un llenguatge d'alt rendiment (desenvolupat per JetBrains), s'executa en la màquina virtual Java i utilitza les biblioteques i eines Java existents. On the other hand, Java també pot interactuar amb els components Kotlin sense problemes. L'objectiu principal d'Kotlin és fer que sigui útil per als projectes pràctics de la vida real, pel que ha estat desenvolupat des de zero i va fer atractiva per als desenvolupadors de Java existents. També és fàcil d'aprendre en comparació amb els altres idiomes basats JVM com Scala. Com Java té una profunda interoperabilitat amb Kotlin, els desenvolupadors de Java són més atrets per aprendre i provar. Kotlin té un fort suport comercial i el model de negoci estable, No pel que serà probable que es va abandonar en un futur proper. Des de la perspectiva d'un desenvolupador, Kotlin és molt prometedor i que portarà més oportunitats en els pròxims dies. Així podem predir amb seguretat que Kotlin serà la propera gran cosa per a la comunitat Java.

Solució de problemes de desenvolupament Java

JetBrains did not intend to do anything revolutionary with Kotlin. It wanted to provide a useful language that solves existing problems. Kotlin té els següents objectius que ajudin a resoldre o evitar problemes existents en Java i obtenir millors resultats.

  • 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, 01:00 50 línies (aprox.) codi escrit en Java pot reduir-se a 2/3 (aprox.) línies en Kotlin.
  • Prevent null pointer exceptions.
  • Provide quick code compilation.
  • Reduce learning time for developers by providing documentation and support.
  • la sintaxi del codi Kotlin és fàcil d'entendre, de manera que la revisió de codi és simple, fins i tot per a un nouvingut.
  • sobrecàrrega de temps d'execució també és baixa a la biblioteca estàndard és petit i compacte.

A part dels avantatges principals anteriors, Kotlin també proporciona gran quantitat d'altres suports com la fàcil conversió de codi entre Java i Kotlin, la integració IDE fàcil, depuració completa, re-factoring i perfils, etc.. So, en total, Kotlin és, sens dubte va a reduir els punts de dolor que s'enfronten els desenvolupadors de Java.

Amor característiques Kotlin

Les característiques més destacades de Kotlin es descriuen a continuació, que els desenvolupadors de Java han d'estimar a utilitzar.

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.

Fàcil d'aprendre i utilitzar per als desenvolupadors de Java

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, per exemple. Also, Kotlin was inspired by Scala and according to many; it looks a lot like Scala. El codi utilitza la JVM i el 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.

compatible amb versions anteriors

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.

interoperabilitat IDE

Kotlin té una gran quantitat de suports per millorar la productivitat. És altament interoperable amb els entorns de desenvolupament, pel refactorització, depuració, recerca, la unitat de proves són molt fàcils de realitzar.

Implementació i ús de les característiques anteriors són realment interessants, de manera que els desenvolupadors de Java han donar-li una oportunitat i provar la bellesa de Kotlin. Pot ser, un desenvolupador Java pot convertir part del seu codi Java a Kotlin i veure com es porta a terme. Qualsevol manera seguim, Kotlin és, sens dubte va a donar una bona impressió.

Acabem

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.

 

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

Enjoy this blog? Please spread the word :)

Follow by Email
LinkedIn
LinkedIn
Share