Jak Kotlin může vyřešit body bolesti Java Developer je?

Kotlin Vs Java

Kotlin Vs Java

Kotlin je vysoce výkonný jazyk (vyvinutý JetBrains), běží na JVM a využívá existující Java knihovny a nástroje. On the other hand, Java může také komunikovat s komponentami Kotlin hladce. Primárním cílem Kotlin je, aby bylo vhodné pro praktické skutečného života projektů, tak to byla vyvinuta od nuly a také atraktivní pro stávající vývojáři v Javě. Je také snadno naučit ve srovnání s jinými jazyky JVM bázi, jako je Scala. Jako Java má hluboké interoperabilitu s Kotlin, Java vývojáři jsou více přitahovány k učit se a vyzkoušet. Kotlin má silnou komerční podporu a stabilní obchodní model, takže to nebude pravděpodobné, že si opuštěný v blízké budoucnosti. Z pohledu vývojáře, Kotlin je velmi perspektivní a přinesou více příležitostí v příštích dnech. Takže můžeme s jistotou předpokládat, že Kotlin bude další velká věc pro komunitu Java.

Řešení problémů Java Development

JetBrains did not intend to do anything revolutionary with Kotlin. It wanted to provide a useful language that solves existing problems. Kotlin má tyto cíle, které pomohou řešit nebo se jim vyhnout existující problémy v Javě a dosahují lepších výsledků.

  • 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 linky (Cca.) kód napsaný v jazyce Java může být snížena na 2/3 (Cca.) linky v Kotlin.
  • Prevent null pointer exceptions.
  • Provide quick code compilation.
  • Reduce learning time for developers by providing documentation and support.
  • syntax kód Kotlin je snadné pochopit,, takže revize kódu je jednoduchá i pro nově příchozí.
  • Runtime režie je také nízká, protože standardní knihovna je malý a kompaktní.

Kromě výše uvedených hlavních výhod, Kotlin také poskytuje mnoho dalších nosičů, jako jsou snadnou konverzi kódu mezi Javou a Kotlin, snadná integrace IDE, full ladění, re-faktoringu a profilování atd. So, celkem, Kotlin je určitě snížit body bolesti, kterým čelí vývojáři v Javě.

Love funkce Kotlin

Nejvýraznějším rysem Kotlin jsou popsány níže, které vývojáři Java by měla láska k použití.

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.

Snadno se učit a používat pro vývojáře v jazyce 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, například. Also, Kotlin was inspired by Scala and according to many; it looks a lot like Scala. Kód používá JVM a 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.

zpětně kompatibilní

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

interoperabilita IDE

Kotlin má hodně podpor pro zvýšení produktivity. Je vysoce interoperabilní s IDE, tak refactoring, ladění, vyhledávání, Unit testování je velmi snadné provést.

Implementaci a použití výše uvedené funkce jsou opravdu zajímavé, takže Java vývojáři měli to zkusit a ochutnat krásy Kotlin. Může být, Java vývojář může převést část svého kódu v jazyce Java do Kotlin a uvidíte, jak to hraje. Ať už tedy následujeme, Kotlin je určitě dát dobrý dojem.

Pojďme k závěru,

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