days
-6
-1
hours
0
-1
minutes
-5
-9
seconds
-5
-8
search
Includes a preview of Kotlin 1.4 features

Kotlin 1.3.60 updates Java-to-Kotlin converter

Sarah Schlothauer
kotlin
© Shutterstock / Pattithi09

Java and Kotlin go hand in hand, especially when it comes to Android development. Kotlin version 1.3.60 just released and it contains a number of new updates and a few enhancements, including tooling improvements for debugging and Gradle scripts, a new worksheet mode for IntelliJ IDEA, improved error messages, and a preview of some Kotlin 1.4 features.

Kotlin’s newest version is here; 1.3.60 released on November 18, 2019.

Ever since Android expressed that Kotlin is a first-class language, it has seen a healthy amount of growth and adoption rates. Not only Android devs use it. According to the State of Kotlin 2019 survey, while 62% of devs develop mobile apps with Kotlin, 41% work on web back-end projects.

Let’s see what the update includes.

Improved scratch files and worksheets

Scratch files for Intellij IDEA get a new design.

Experiment with your code and see the results in a small scratch file. The scratch file exists as temporary code outside of the project. Yet, the snippet exists as a fully functional code that you can run and debug.

Or, for cases where you want to experiment inside the project, use worksheets. Worksheets are brand new and function similarly to scratch sheets. The main difference is that it is part of the project, so you can play with code and see how it works inside of your project.

Afterward, select run and execute your code. Read more about scratch files and worksheets in the documentation.

    In a cloud native world enamored with microservices and serverless, meet Quarkus – Java’s brilliant response to technologies like Node.js, Python and Go that had proven quicker, smaller and arguably more nimble. Download your free beginner's tutorial written by JAX London speaker Alex Soto.

Java-to-Kotlin converter

kotlin

Converting Java to Kotlin. Source.

Java developers especially have turned to Kotlin for both work and personal/side projects, either as a replacement, or an additional language. JetBrains reported: “Almost all Kotlin developers (92%) were using Java before they started using Kotlin.”

Now, the new default converter makes converting to Kotlin even easier. 1.3.60 fixes some previous conversion issues, including corner-case issues.

From the announcement post by Svetlana Isakova:

Now, when you convert several files at once, they are analyzed together and the usages from the other files affect the final result. For example, if you pass null as a String argument to a foo function in Java, after converting a function and its usage together, the converted Kotlin function will take a nullable String? as an argument:

Function breakpoints

Users can set function breakpoints into their code when using the debugger. When setting a function breakpoint, the debugger stops execution on either entering or exiting.

Read more about breakpoint properties.

SEE ALSO: State of the Octoverse 2019: Python outranks Java for the first time

Kotlin/JS updates

New changes arrive for Kotlin/JS, including quality of life updates and a new org.jetbrains.kotlin.js plugin. This plugin offers simplifications.

Source maps are now generated automatically for the code. This change will make debugging easier and includes support for breakpoints and code annotations, and more helpful info.

Now, when running tests on the JS platform, test outputs will be included in the generated Gradle report. The report allows for easy referencing, with line numbers and file names that directly point back to your code.

View the full changelog for 1.3.60 on GitHub for additional information and the complete list of bug fixes.

SEE ALSO: New Java group proposed for IDE & tooling support

Future plans

Since 1.3.60 is only a minor release, it does not include major changes to the language. However, Kotlin version 1.4 will arrive in 2020, as per the plan set by JetBrains.

Users can test out some of the upcoming features. You will have to specify the corresponding language version and set it to 1.4. Note that these features are currently experimental.

Kotlin 1.4 will include:

  • NPE assertions
  • Allows break and continue inside when
  • Fixes and changes for tail-recursive functions
  • Upcoming breaking change: Combining open and tailrec modifiers will display an error. Users will also not be able to use open and tailrec at the same time.
Author
Sarah Schlothauer

Sarah Schlothauer

All Posts by Sarah Schlothauer

Sarah Schlothauer is an assistant editor for JAXenter.com. She received her Bachelor's degree from Monmouth University and is currently enrolled at Goethe University in Frankfurt, Germany where she is working on her Masters. She lives in Frankfurt with her husband and cat. She is also the editor for Conditio Humana, an online magazine about ethics, AI, and technology.

Leave a Reply

Be the First to Comment!

avatar
400
  Subscribe  
Notify of