You should learn multiple programming languages

You should learn multiple programming languages

The first language I used to write a small program was Pascal. Since then I have worked professionally with Java, JavaScript, Groovy and a few more. Currently, I am learning a bit of Go in my spare time. In this blog post, I want to encourage you to learn a new language as well and provide you with a few ideas. The more you know the easier it gets First of all, I have noticed that the more languages you already know, the easier it is to learn new ones. I guess like with everything, you start seeing familiar patterns and solutions and in general- things start to make sense much quicker. ...

June 16, 2019 · 6 min · Bartosz Jedrzejewski
Which Java JDK should I use? Which provide free LTS?

Which Java JDK should I use? Which provide free LTS?

With Oracle stopping free updates for Java 8 and effectively only maintaining free updates with the latest Java release (12 at the time of writing) a natural question arises… Which JDK should I use? This is a short article providing answers, depending on your circumstances. Let’s look at different scenarios that you may be facing: You are using Java 8 and want to keep Long Term Support (LTS) for free In this case, you should use Amazon Correto OpenJDK 8 distribution. Amazon Correto is a free JDK distribution that will provide you with free long term support: ...

March 30, 2019 · 3 min · Bartosz Jedrzejewski
Java 9 to 12 - all the language modifications

Java 9 to 12 - all the language modifications

We have all had quite a lot of time to get familiar with Java 8 and all the amazing features that it provided us with. Since then quite a lot have happened, with the release of Java 9, 10, 11 and this month 12 it is hard to stay on top of all the language changes happening! In here I will focus exclusively on the changes to the language leaving library changes to other writers. ...

March 26, 2019 · 4 min · Bartosz Jedrzejewski
Reddit API Authentication with Java/Spring

Reddit API Authentication with Java/Spring

I am a big fan of Reddit. The platform is great for learning and sharing programming knowledge… In fact, it contains so much knowledge and opinion, that there is no chance for any single person to analyze it all. Sounds like a job for a machine? Before we get started, we need to learn how to authenticate with the Reddit API. Public read-only API with JSON Reddit has a very friendly API, with multiple endpoints being simply accessible in a JSON format after adding .json to the request. For example to get a list of Java topics discussed on the /r/Java subreddit, as a human you would go to https://www.reddit.com/r/java and you would see something like that: ...

November 4, 2018 · 4 min · Bartosz Jedrzejewski
Java surprises - Unexpected behaviours and features

Java surprises - Unexpected behaviours and features

Java is a very mature programming language – in fact, it is over 21 years old, so if it was a person it could drink even in the USA! With age comes wisdom, but also with age comes quirkiness… at least sometimes. In this article, I will look at some of the more surprising and unexpected behavior and features of the language. Here we go, in no particular order, a collection of Java surprises to amuse you and impress your friends! ...

October 28, 2018 · 6 min · Bartosz Jedrzejewski
My favourite Design Pattern - Strategy

My favourite Design Pattern - Strategy

Among many OOP design patterns described, the one that influenced my development the most is the Strategy Pattern. In this article, I will briefly explain what the Strategy Pattern is and why it is so important. Strategy Pattern Defined The idea behind the Strategy Pattern is as follows: Imagine that you have SomeClass that needs to implement varying behaviour depending on a situation. You will implement it via a composition, creating a Strategy interface that would encapsulate this varying behaviour. The interface will have only one method (ie. execute) that runs when the strategy is used. It will look something like this: ...

October 14, 2018 · 3 min · Bartosz Jedrzejewski
Single Responsibility Principle - do you know the real one?

Single Responsibility Principle - do you know the real one?

Single Responsibility Principle, as defined in the very famous set of SOLID principles, is often misunderstood. When asked what it means, most developers go with- “a class should do only one thing”, or something along these lines. This is simplistic and frankly- wrong! Intrigued? Read on! Single Responsibility Principle – the real definition Single Responsibility Principle (SRP), as defined by Robert C. Martin states: “A class should have only one reason to change.” ...

October 4, 2018 · 4 min · Bartosz Jedrzejewski
Implementing Minimax Algorithm in Java

Implementing Minimax Algorithm in Java

If you want to write a program that is able to play a strategy game, there are good chances that you will be looking at a Minimax algorithm. This is especially true when it comes to games like chess, where variations of the Minimax algorithm are what is used to build the strongest chess-playing programs in existence. In this article, I will look at implementing the basic version of the Minimax algorithm with Java. ...

September 23, 2018 · 5 min · Bartosz Jedrzejewski
Please, stop writing so many “for loops” in Java!

Please, stop writing so many “for loops” in Java!

In this blog post, I want to take you back to basics and talk about Java for loops. To be honest, I am writing this blog post partially for myself, as this is something that I am myself too often guilty of. Since Java 8, we don’t have to write so many for loops in Java! I hope this blog post will make your code nicer to read and quicker to write. ...

September 15, 2018 · 3 min · Bartosz Jedrzejewski
Simulating the Secretary Problem with Java

Simulating the Secretary Problem with Java

You might have noticed that I like reading books. I have recently read *“Algorithms to Live By: The Computer Science of Human Decisions”*which absolutely fascinated me! The book mentions a famous optimal stopping (Wikipedia) problem called Secretary Problem. In this blog post, I will explain it and then we will have some fun simulating it with Java. Let’s see if we can find a solution by brute force! Secretary Problem Defined Imagine that you need to hire a secretary. Imagine now that you have 100 candidates that you are going to interview. Because you are a perfect interviewer, you can compare every single person against everyone else that you have seen so far. After the interview, you have to either hire the person or reject. If you reject, you can’t change your mind. You win if you have managed to hire the best candidate out of the whole lot. ...

September 9, 2018 · 5 min · Bartosz Jedrzejewski