Finding When Premature Optimization Is Evil

This article is based on the Software Mistakes and Tradeoffs book by Tomasz Lelek and Jon Skeet.

There is an old computer science saying that Premature Optimization is the root of all evil. The saying has stuck around because it’s accurate for a lot of use cases. Without any input data about expected traffic and SLA, it’s hard to reason about your code and its required performance. Optimizing random paths in code in such a situation is like shooting in the dark. You will complicate your code for no good reason. 

Concatenating Strings in Java 9

Have you ever had the need to build a comma-separated list of values from a list or an array in Java or wanted to create a file path using concatenated folder names and a file path delimiter? Well, in the article Cocatenating Strings in Java 8, I have described a convinient way to use Java 8 APIs to do the job.

This not only reduces your development time and prevents additional errors, but it also let's you write more readable and understandable code. But what exactly happened since Java 9 was released, and does it apply to the code presented in the cases described in the aforementioned article.

A Kafka Tutorial for Everyone, no Matter Your Stage in Development

I'll keep the existentialism to a minimum, promise

In this edition of "Best of DZone," we've chosen to take a look at Apache Kafka, the low-latency stream-processing platform that has become an industry-standard for real-time streaming and analytics, log aggregation, and Spark data ingestion since LinkedIn first released it to the open source community in early 2011. 

With this collection, we hoped to provide readers with the resources and knowledge they need, regardless of their level of expertise with working the platform or big data in general, to master all things Kafka. 

Should I Parallelize Java 8 Streams?

[Java] parallel streams

In Java 8, the streams API is easy to iterate over collections, and it's easy to parallelize a stream by calling the parallelStream() method. But should we be using parallelStream() wherever we can? What are the considerations? 

You may also like: Think Twice Before Using Java 8 Parallel Streams

Look at the following ParallelStreamTester class to generate collections of different sizes for the purpose of testing parallel streams performance against a sequential stream.