Data structures are an intrinsic part of every programming language, yet Java’s Stream interface lacks vital operations and its complex approach to extensibility gave rise to alternative libraries such as jOOλ and Guava. This article provides an alternative approach that can be easily integrated in any Java project using Kotlin's Sequence interface.
Sequenceinterface can be used as an alternative to Java's
Sequencehas better performance than
Streamas well as popular alternatives, such as Guava, Protonpack and Vavr, when it comes to sequential processing.
Sequenceeven in Java.
Sequenceoffers a less verbose way to extend its API.
Sequenceoffers a full suite of operations.
Over the past two years, Kotlin has been the fastest-growing language gaining over 1.1 million developers. It was designed for the JVM and Android, focusing on interoperability, safety and clarity, and was recently appointed by Google as the preferred language for Android development.
With the release of Kotlin 1.4 in August 2020, new features offered improvements mostly focused on quality and performance, including Kotlin’s Sequenceinterface which may be used as an alternative to Java’s Stream interface, even if you are developing in Java. It provides a full suite of operations and outperforms
Stream in a variety of benchmarks for sequential processing.
There are a few well-known third-party libraries that eliminate the limitations of
Streams, mainly due to its limited set of operations. Guava, Protonpack,Eclipse Collections, jOOλ, StreamEx or Vavr are some of the most used libraries in the Java ecosystem. Yet, none of them achieve better performance than
Sequence when it comes to sequential processing.
Since Kotlin is interoperable with the Java programming language, both may coexist in the same code bases. Yet, if you are unable to use Kotlin or prefer to avoid the mix between dialects and use a single programming language, then you can still use
Sequence while developing with Java.
What is OpenJDK? OpenJDk or Open Java Development Kit is a free, open-source framework of the Java Platform, Standard Edition (or Java SE).
Kotlin and Java have showcased the cut-throat competition in the lastest Android Development. There are a lot of ambiguities amongst developers to choose one, from both. This video will help you to understand the strengths and weaknesses of both with a head to head comparison.
DevOps and Cloud computing are joined at the hip, now that fact is well appreciated by the organizations that engaged in SaaS cloud and developed applications in the Cloud. During the COVID crisis period, most of the organizations have started using cloud computing services and implementing a cloud-first strategy to establish their remote operations. Similarly, the extended DevOps strategy will make the development process more agile with automated test cases.
This article provides a summary of how the InfoQ editorial team currently sees the adoption of technology and emerging trends within the Java space in 2020. We focus on Java the language, as well as related languages like Kotlin and Scala, the Java Virtual Machine (JVM), and Java-based frameworks and utilities.
What is DevOps? How are organizations transitioning to DevOps? Is it possible for organizations to shift to enterprise DevOps? Read more to find out!