My worst public speaking experience...
Last week I was invited to the Rabobank (a Dutch bank), where the bank and the Utrecht JUG hosted a small two day conference.
The first day was about clean code and the second day was about architecture.
The main attraction of this conference: Robert C. Martin, also known as Uncle Bob. He is one of the founders of the Agile manifesto and wrote numerous very good books on topics like ‘Clean Code’ and ‘Clean Architecture’. He’s also the main advocate for the SOLID design principles.
This presentation of mine… turned out to be my worst...
Solving a word search puzzle
In the previous post I showed a nice snippet/trick at the bottom of the post to find all the neighbors in a 2D array.
Last week I used this snippet to solve a word search puzzle a colleague created for us as a “Back to work in 2019”-challenge:
(Note: Some fellow developer colleagues think that solving the puzzle with code is unfair… heh. really?!)
Reading the lexicon
Here is the complete code:
First we’ll need to read in all the possible words we’re looking for. And using the new Java streams...
The longest maze/snake
An amazing website I keep running into (especially through Hacker News) is: Red Blob Games.
It has a lot of amazing algorithms explained using interactive Javascript examples. For example take a look at how Amit explains Hexagonal grids and A* pathfinding. The interactive demo’s make it easy to grasp all these fun algorithms and implement them yourself.
Pathfinding for Tower Defense
Last week though I was reading this tutorial, Pathfinding for Tower Defense.
He explains a method for creating a single vector/flow field for game AI’s to follow. This allows a single calculation to...
Happy New Year: 2019
First of all, best wishes for 2019 from me.
Time for me to reflect on the last couple of months.
Public speaking
Last year has been a crazy busy year for me. I’ve been to and spoken at to J-Spring, J-Fall, Devoxx Belgium, Devoxx Poland and JavaOne… errr… Oracle CodeOne on various topics. From quantum computing to software architecture.
Here is a list of all my conference talks.
RotterdamJUG
I’m a big fan of sharing knowledge and getting people together to have fun. This is why I’ve decided to create...
Part 2: Native microservice in GraalVM
Last week I posted Part 1 of this series of blogposts about GraalVM.
We looked at GraalVM and what it can do. We dove into the native-image
command and transformed a simple HelloWorld application into a native application (running in Docker).
This time I want to go beyond “Hello World” and build something useful (despite all the limitations listed below). A CRUD microservice with REST API and database access.
TLDR; If you’re just intersted in the end result, go right to the results
Limitations
So what are some of the limitations that GraalVM currently has?...
Part 1: Java to native using GraalVM
One of the most amazing projects I’ve learned about this year is GraalVM.
I’ve learned about this project during Devoxx Poland (a Polish developer conference) at a talk by Oleg Šelajev. If you’re curious about everything GraalVM has to offer, not just the native Java compilation, please watch his video.
GraalVM is a universal/polyglot virtual machine. This means GraalVM can run programs written in:
- Javascript
- Ruby
- Python 3
- R
- JVM-based languages (such as Java, Scala, Kotlin)
- LLVM-based languages (such as C, C++).
In short: Graal is very powerful.
There is also the possibility to mix-and-match languages...
Part 2: OpenJ9 versus HotSpot
Intro
Yesterday I compared different JDK versions and OpenJ9 versus HotSpot on memory and speed. The memory part of the test was realistic if you ask me, an actual working Spring Boot application that served REST objects.
The speed/CPU test however was… lacking. Sorting some random arrays, just one specific test.
Today I decided to test OpenJ9 and HotSpot a bit more using an actual benchmark: SPECjvm2008.
SPECjvm2008
SPEC (Standard Performance Evaluation Corporation) has a couple of well defined benchmarks and tests, including an old JVM benchmark called SPECjvm2008. This is an elaborate benchmark testing...
Part 1: OpenJ9 versus HotSpot
TLDR;
OpenJ9 and IBM J9 are a different JVM implementation from the default Oracle HotSpot JVM. With the modern adoptopenjdk pre-made Docker images it is easy to swap and test different combinations and pick the right JVM for you.
The rumours seem to be true, OpenJ9 seems to blow HotSpot away on memory usage. HotSpot seems to have the edge CPU-wise.
OpenJ9
In the Java world most people are familiar with OpenJDK. This is a complete JDK implementation including the HotSpot JVM engine. Not a lot of developers know or try alternatives to HotSpot. Asking...
Java and Docker, the limitations
TLDR;
Java and Docker aren’t friends out of the box. Docker can set memory and CPU limitations that Java can’t automatically detect. Using either Java Xmx flags (cumbersome/duplicated) or the new experimental JVM flags we can solve this issue.
Docker love for Java is in its way in newer versions of both OpenJ9 and OpenJDK 10!
Mismatch in virtualization
The combination of Java and Docker isn’t a match made in heaven, initially it was far from it. For starters, the whole premise of the JVM, Java Virtual Machine, was that having a Virtual Machine makes the underlying...
In a microservices landscape; When do you update?
This week I’ve been stuggling with the following question:
When is the right time to upgrade?
By upgrading, I mean everything: libraries, tools, Java versions, application servers, MQ servers…
My current project uses a reactive upgrade policy, we upgrade for four reasons:
- Something is broken and fixed in a later version
- We need or want to use a new feature
- Support for a version we’re using is being dropped
- The old version we’re using has a known security issue/CVE
The first two reasons are entirely up to the programmers to decide. The third reason is up...
Fear of upgrading to Java 9, is it justified?
It seems that the adoptation of Java 9 is slow, very slow. In a Twitter poll this week I asked: “Which version of Java are you using in production?”
The poll got almost 300 replies and to my surprise just 3% of the respondents are using Java 9 at the moment. Most are using Java 8 and there are even more people using Java 6… So what is holding people back? Why is almost no-one using Java 9?
It turns out a lot of people are scared to upgrade to Java 9. They think it’ll be hard to do,...
Inverse Conway's law
Today I got to present at Devoxx Poland on being agile and managing your architecture.
One of the points I made during the talk had to do with Conway’s Law. For those unfamiliar with it, here it is:
organizations which design systems … are constrained to produce designs which are copies of the communication structures of these organizations M. Conway
This basically means that the code you create is likely to reflect the way the people and teams in your company communicate. For example, banks are usually pretty strict and have a tendency to document things. The...
JavaOne Rock Star 2016
Today I got an email with the subject: “Congratulations JavaOne 2016 Rock Star!”. It turns out the JavaOne 2016 Ignite session was voted enough to receive a JavaOne Rock Star Award!
I was so excited, elated even!
But I quickly found out that the JavaOne Rock Star lifestyle isn’t as much fun as it sounds.
- Being 3 hours late for a meeting, even a Rock Star can’t do that.
- Peeing in the corner of your office while holding a bottle of Jack Daniels, still not appreciated.
- Wearing ripped jeans, a leather jacket...
Vikipedia: A Java YouTube bot
YouTube, the future of television. I’ve got a lot of subscriptions to YouTube channels that deliver quality content, and those shows are ‘cast’ (using my Chromecast) to my TV. Another thing I often do is look up information, for example I watch talks from programming conferences like Devoxx using YouTube.
This gave me an idea, what if I can take some free information (like Wikipedia, all creative commons) and use that to create content for YouTube? Maybe I’ll even get some views :-)
So this is what I’ve come up with, the following video is generated completely automatically:
Three new JEPs
This morning Mark Reinhold submitted three brand new JEPs (JDK Enhancement Proposal).
- JEP 300: Augment Use-Site Variance with Declaration-Site Defaults
- JEP 301: Enhanced Enums
- JEP 302: Lambda Leftovers
These proposals are enhancements to the JDK (Java Development Kit) and OpenJDK. A long term roadmap for the JDK projects, a look into what the future of Java might hold.
Let’s dive right in and take a quick look on what these proposals actually are!
JEP 300: Augment Use-Site Variance with Declaration-Site Defaults
When you currently use Java Generics you probably already know about wildcards....