为什么Android开发人员转向Kotlin

When we talk, or the discussion is about Android app development, the first of the major programming language that comes to developer's minds is ‘ Java’. However, Java isn’t the only language you can use or is suitable for Android programming — you are free to use any language that compiles to the JVM. Recently, a new language has been into the limelight and has caught the attention of the Android community — Kotlin.

当我们谈论或讨论有关Android应用程序开发时 ,开发人员想到的第一种主要编程语言是“ Java”。 但是,Java不是您可以使用的唯一语言,也不是适用于Android编程的语言-您可以自由使用可编译到JVM的任何语言。 最近,一种新语言引起了人们的关注,并引起了Android社区Kotlin的关注。

Kotlin has been developed and actually been around since 2011, but it was only in May 2017 that Google announced that the language was to become an officially supported language in the Android operating system. This is one of the many as well as the major reasons why Kotlin’s adoption has been so dramatic. The Realm report, that was published at the year's end of 2017 has made some suggestions. It suggests that Kotlin is likely to overtake Java in terms of usage in the next couple of years.

自2011年以来,Kotlin一直在开发中并且实际上已经存在了,但是直到2017年5月,谷歌才宣布该语言成为Android操作系统中受官方支持的语言。 这是Kotlin如此被广泛采用的众多原因之一,也是主要原因。 2017年底发布的Realm报告提出了一些建议。 这表明Kotlin在未来几年可能会超过Java。

When you as a developer, want to work on custom Android applications, advanced technology will help you achieve your goals. Java as well as its younger brother, Kotlin has commonly used languages for Google for writing Android Apps. Great importance has been provided to programming languages because it has the ability in order to cut down some of your time and money.

当您作为开发人员想要使用自定义Android应用程序时,先进的技术将帮助您实现目标。 Java和它的弟弟Kotlin都是Google编写Android Apps的常用语言。 编程语言非常重要,因为它具有减少您的时间和金钱的能力。

There are many reasons why mobile developers and programmers are choosing to switch from Java to Kotlin. Below are some of the most significant.

移动开发人员和程序员选择从Java切换到Kotlin的原因很多。 以下是一些最重要的内容。

熟悉Java的任何人都可以轻松学习Kotlin (Kotlin is easy to learn for anyone familiar with Java)

Similarities in typing as well as syntax make Kotlin very easy to master for anyone who’s already working with Java. If you’re worried about a deep or a steep learning curve, you’ll be pleasantly surprised by how easy it is for emerging as well as experienced developers to dive into coding in Kotlin. Kotlin has proven to be and has been evolving with a lot of support from the developer community. A lot of developers and programmers who contribute to Kotlin’s evolution are freelancers who find work on different platforms and experience a wide range of smaller projects with varied needs. Other contributors include larger companies and SMEs as well as industry giants like Google.

输入和语法的相似性使Kotlin对于已经使用Java的任何人都非常容易掌握。 如果您担心学习曲线的深浅或陡峭,那么无论是新兴的还是经验丰富的开发人员都可以很轻松地潜入Kotlin中进行编程,这会让您感到惊喜。 在开发者社区的大力支持下,Kotlin已经证明是并且一直在发展。 为Kotlin的发展做出贡献的许多开发人员和程序员都是自由职业者,他们在不同的平台上找到工作,并经历了各种具有不同需求的小型项目。 其他贡献者包括较大的公司和中小型企业,以及Google等行业巨头。

Kotlin needs 30 percent less coding when you write the same application in Kotlin compared to Java. Java has now been a bit outdated, which means every new launch has to support features included in the previous version. This eventually leads to an increase in the code to write, resulting in absence of layer-to-layer architecture. If you compare the coding done using Java class and Kotlin class, you will find that the one written in Kotlin will be much more compact as well as readable than the one written in Java.

与Java相比,用Kotlin编写相同的应用程序时,Kotlin所需的编码减少了30%。 Java现在已经过时,这意味着每次新发布都必须支持以前版本中包含的功能。 这最终导致编写代码的增加,从而导致缺少层到层体系结构。 如果将使用Java类和Kotlin类完成的编码进行比较,您会发现用Kotlin编写的代码比使用Java编写的代码更紧凑,更易读。

Kotlin具有Android Studio支持 (Kotlin has Android Studio support)

Because Kotlin is built as well as developed by JetBrains, it’s unsurprising that Android Studio (also a JetBrains product) has excellent support for Kotlin. Android Studio makes it incredibly easy as well as favorable to developers for configuring Ko or development toolkit will have no problem understanding as well as compiling and running Kotlin code once you have set up and configured Kotlin to be used for Android Studio. After configuring and setting up Kotlin for Android Studio, you can convert the entire Java source file into a Kotlin file.

由于Kotlin是由JetBrains构建和开发的,因此Android Studio(也是JetBrains产品)对Kotlin的出色支持也就不足为奇了。 Android Studio使其异常容易,并且对开发人员有利于配置Ko或开发工具包,一旦您设置并配置了可用于Android Studio的Kotlin,就不会有任何问题,以及编译和运行Kotlin代码。 在为Android Studio配置和设置Kotlin之后,您可以将整个Java源文件转换为Kotlin文件。

The fact that Kotlin has been designed to be Java compatible thus making it a uniquely useful language that can leverage JVMs. While at the same time, Kotlin is used to update and improve enterprise-level solutions that have enormous codebases written in Java.

Kotlin被设计为与Java兼容,因此使其成为可以利用JVM的独特有用的语言。 同时,Kotlin用于更新和改进具有大量用Java编写的代码库的企业级解决方案。

Kotlin非常适合过程编程 (Kotlin is great for procedural programming)

Every programming language as well as the paradigm has its own set of strengths and weaknesses. There will always be certain scenarios and situations that come across where one is more effective than another. One thing that’s so appealing about Kotlin is that it combines the strengths of two different approaches to development and programming — procedural and functional.

每种编程语言以及范例都有其自身的优点和缺点。 在某些情况下,总是会遇到一种情况比另一种情况更有效的情况。 关于Kotlin的一件如此吸引人的事情是,它结合了两种不同的开发和编程方法(过程和功能)的优势。

True, the largely procedural approach can prove to sometimes be the most challenging aspect of the language when you first start to learn and get to grips with it. However, the level of control such an approach can give you is well worth the investment of your time.

没错,当您刚开始学习并掌握语言时,主要是程序性方法有时可能会成为语言中最具挑战性的方面。 但是,这种方法可以为您提供的控制级别非常值得您投入时间。

Kotlin使开发变得高效,让您的生活更轻松 (Kotlin makes development to be highly efficient and your life easier)

This follows on nicely from the discussed points above. While there are certain aspects of Kotlin which require patience as well as concentration to master, in the long run, with lesser code, errors as well as bugs will be greatly reduced. That saves you developers time, thus making coding much more enjoyable and efficient rather than an administrative nightmare of spaghetti code.

从上面讨论的观点来看,这很好。 尽管Kotlin的某些方面需要耐心并集中精力来掌握,但从长远来看,使用较少的代码,错误和错误的发生率将大大降低。 这为您节省了开发人员的时间,从而使编码更加令人愉悦和高效,而不是管理意粉代码。

There are plenty of features that are present in Kotlin that makes it a practical solution to today’s programming challenges. Where JetBrains has been able to take the language next remains to be seen. We could, perhaps, see Kotlin move to iOS development, and if it compiled to JavaScript we may also begin to see it used more and more within web development. Of course, this will boil down to largely JetBrain’s goals regarding the future of Kotlin and just how much they want Kotlin to dominate the developer landscape.

Kotlin中提供了许多功能,使其成为当今编程挑战的实用解决方案。 JetBrains能够采用该语言的地方还有待观察。 也许我们可以看到Kotlin转向iOS开发 ,如果将其编译为JavaScript,我们也可能开始看到它在Web开发中越来越多地被使用。 当然,这将很大程度上取决于JetBrain关于Kotlin未来的目标,以及他们希望Kotlin在开发人员领域占据主导地位的目标。

翻译自: https://medium.com/@ajaykumbhar_31775/why-android-developers-are-switching-to-kotlin-6b85839def97

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值