Monday 10 November 2014

New beginning

So I know I have been rather quiet for a while, but I have began working on a new project recently and thought it might be worth sharing this to a wider audience.

The project will be a tournament database for the organised FIFA football games that my friends and I play every few months. This will be a bit more of an involved solution to the current spreadsheets that we are currently using to record the glorious victories and crushing defeats that occur, as well as who reigns as 'the champ' until the next tournament.

This project will be in Java, and I have decided to familiarise myself with IntelliJ for this project before. Until this point I have almost exclusively used Eclipse as my IDE of choice, but a new IDE for a new project right?

Step 1 - The scribble bit

So the first bit of design work I did was scratched out on the back couple of pages of a notebook one lunchtime at work. I spent the most time creating a schema, and there was a lot of back and forth in my head about what I should and should not include. The current schema looks a bit like this...
 Seeing as this is my first attempt at a more complex personal project, I opted to keep the schema simple.
The player table keeps the names of the players (simple naming scheme ftw).
The tournament table holds some basic information about the tournament, including the all important winner, the golden boot (most goals scored over the tournament), and the dubious honour of the wooden spoon holder (last place in the tournament).
The game table represents the information for a single game. Note a game has two players, and a game has to belong to a tournament. I decided to differentiate between goals scored and normal and extra time, to goals scored during any penalty shoot-outs. Whether this comes back to bite me remains to be seen.

Step 2 - The techy bit..

So for this I decided to use Java DB as my database. I chose it as it is easily embedded into an application, and is the Oracle supported tech. I wanted the database to be embedded within my application as it makes it easier to deploy and set up on another machine that is not set up for or maintained by a developer. Having an embedded database means that once it is set up, the user is good to go...hopefully.

When I have done some more tidying up, I will move the repo over github and share it on there. I'm currently wrestling with connection pooling choices, and build/dependency management.

To be continued...

Thursday 21 November 2013

TODOs and legacy code

So today I was working on a little side project at work. The project involved trawling through the code base for all TODO's, FIXME's etc and evaluating whether or not the comments were still relevant. It would be worth mentioning here that the product I work on is a large code base that has been live for about 14 years, slowly evolving over that time. There is code that pre-dates all the 'standard' things that I have learned during my university and my work experience so far.

So back to today, I got cracking to see how many things there would be in my list. 1063. Wow, this really felt like a lot. I tried to reason that this was actually not too bad, considering the code base is almost 1 million lines long, but damn if I didn't go and make a brew to consider my task.

Tea in hand I returned to my desk, and started to analyse the results. I was happy to discover that the bulk of the todo comments (~700) were actually a form of annotating that the method was overriding a method in a parent class from before override annotations were a thing.

Result!

Boosted by this I set about the remaining comments with increased optimism. This didn't last however as the rest of the TODO's were a weird and wonderful bunch. A few helpful ones that just said nothing, some where you could feel the original developer letting off steam with a useful //TODO NOOOOOOOOOOOOooooOOooOO!!! However just over 200 of the remaining TODO's I had to mark as 'requiring further investigation'. These will be given to the senior developers to look at further.

In all, it took about 5 hours to complete my review and hand it off. The overriding lessons that I took from the exercise was:
  1. Don't write TODO comments
  2. If you have to, you will forget about them before you get back to them
  3. You will write something that makes sense to you then, and only you at that time
So if you ever feel the need to write a TODO, and you really have to, then make it more explicit and verbose  than you think will ever need. Future you, and more than likely some poor soul years down the line, will thank you for it.

Happy commenting,

S


Wednesday 13 November 2013

OCAJP 7 Exam

So recently I took and passed the first Oracle certification exam, so I am now an Oracle certified associate Java 7 Programmer. Sounds kind of fancy right?
I have previously completed a Computer Science degree and had almost a year working as a Java developer as my experience going in to the exam room. Before I started revising for the exam, I had the assumption that it would be rather straightforward given all the theoretical knowledge I had from my degree.

How wrong I was.

The exam pretty much requires you to become a (very slow) human compiler. A lot of the mistakes I made in the practice tests were the sort of thing that any IDE would highlight right away, it was rather demoralising at first - getting the technical parts right but tripping over the package statement being after an import statement...
To revise for the test I made extensive use of the Oracle press OCAJP7 revision guide, and the mock exam program from Enthuware. The book was really good for the depth of information it provides, but it just didn't seem to sink in. The mock exams from Enthuware it when it really started to get through to me. The mock tests are a great deal more difficult than the actual exam, I think my highest score on Enthuware was about 65%, and I passed the exam with a score of 85%!


So, has it improved me as a developer? A little. My depth of knowledge is greater now, and arguably it has improved my program design through a greater understanding of polymorphism and inheritance. However I don't think that this is something that would be of benefit if it was taken as a stand alone exam - it needs the practical application and experience to really start to get more from it.


Anyhow, enough rambling for now.

S

Monday 11 November 2013

The journey...

Well here we are then. After graduating and spending the last year beginning to learn my trade, I have re-purposed a laptop as a machine to work and learn on outside of the daily grind.
How was it re-purposed? Well it now has a fresh copy of Linux Mint installed, some development tools installed (Git, Eclipse, OpenJDK). I have also copied over some e-books from my PC, and I intend to start to dabble with some C, and maybe some Python just to mix things up.
The intent for this little blog is just to be a place to note my thoughts and learnings as time goes on, and just maybe help someone else learn with me.
Here we go...

S