Recently returned to Java after a period of 1 and half years of not programming in it. I convinced myself as I had been using it for 15 years or more previously, I would be able to jump straight back into it. I have been coding in Scala recently.
I sat down one evening thinking I could try a TDD kata. When it came to attempt this I found I had forgotten how to construct a Junit test class. I then realised I’d forgotten how to write a basic gradle build file, a basic maven pom file. Most new roles require some form of test. A remote tech test is fine as you can refresh your memory as you go and no one is looking at whet you are doing until your code is submitted. However in a live pairing exercise you need to be ready to code away with confidence.
Anyway I found all this knowledge was there, just my ageing brain had decided to file it under a different folder (“for later”). I started thinking “Can I write some simple exercises I am able to use in future?”. “That can be used to refresh my memory so I am able to complete a pairing exercise?”.
Obviously there are probably lots of resources out on the internet to use as reference. But I wanted something personal to me that I could refer back to time and time again. In this instance it was returning to Java, next time it might be returning to Scala. Then it could be language x ,y or z.
So lets start with build tools and exercises to get back on track with that…
Refresher Steps
1). Write a basic build configuration file for common build tools that pulls in one dependency. for Gradle & Maven make that dependency be Junit. For Scala / sbt make the dependency scalaTest. We ideally need to be able to build using the command line.
2). Once we have a basic build file pulling in a test dependency. We can write a test. A suggestion is to keep some skeleton projects in github or locally that can be used as reference points later.
3). Code wise we might want to aim for a number of things. Collections, control flow, dependency injection, mocking.
4). Assuming microservices are what we will be building, we need to look at frameworks what frameworks will you be building with. (Dropwizard, Spring boot, Play…?)
In summary I have found that having a collection of simple reference projects is the most use. Over timeI have written various technical tests, personal projects in various languages with various frameworks. I found these were invaluable. Having recently done a tech test that required me to return to Java and learn /include brand new technologies . The original worries of forgetting the language were unwarranted. I now have another reference project I can refer to that includes two new technologies which may come in handy on the next “gig” / client.