суббота, 21 апреля 2018 г.

Java 8. Files.lines() can cause possible resource leak.

Files.lines() method allows to receive stream of lines from file.
It seems to be very convenient apart from one thing - it can cause resource leak.
You must close this stream explicitly or use try with resource block.

It seems to be strange that terminal operations in this case doesn't close the resources underneath a stream.

суббота, 7 апреля 2018 г.

Kotlin. Good point.

Hi!
Long time no see.

What I'm currently observing is the rise of Kotlin language. Kotlin is the child of JetBrains company which brought to us IntelliJ.
Why Kotlin could in the future replace Java? What are the selling points of Kotlin?
Let's try to figure this out:

  1. Kotlin works on JVM.
  2. Kotlin can use all the java libraries.
  3. Java can call code written in Kotlin.
  4. Kotlin is open source.
  5. Kotlin is developed and supported by JetBrains.
  6. Google officially supports Kotlin as a second development language on Android platform.
  7. IntelliJ has very good support tooling for Kotlin.
  8. Spring Boot supports Kotlin.
  9. Spring Framework 5 supports Kotlin.
  10. Kotlin can be translated to java script.
With Kotlin you can migrate the project in Java in small steps.

Is not it enough to sell Kotlin to management and start using it in production?