Saturday, 12 July 2014

Update and New Career

I thought it was about time I dropped an update onto the blog about why I've been quiet recently and what has been going on.

Early this year I decided to change career paths slightly and become a technical trainer. The highlights of my career as a developer have been to help others improve and learn from others in an informal supportive environment. I am now lucky enough to be able to do this full time designing new and fun ways of helping others learn Java, Python, C++ and .NET technologies. I work for my own company James Gough Ltd, with one primary client Mallon Associates. So far I've run ten training courses and had people booking onto my future courses, it's been challenging but one of the best things I've done. I have a fairly packed end to 2014 as I gear up for our 15 week training program.

As well as working on private training I have also teamed up with Richard Warburton and Raoul-Gabriel Urma. I am excited to announce will be offering public Java 8 courses with a focus on Lambdas and preparing Java developers for the changes that are right on our doorstep. Java as we know it is going to change, for years some developers have been dragging their feet with Java 1.4 style syntax and missing some key changes. An appreciation for the Object Oriented/Functional relationship is now required to both be able to design and build code that is succinct and solves the business problem in the best way.

This year is very busy with it being my first year in business and getting married so sadly I've had to put conferences on hold for a year, but I'm hoping that early next year I can attend jfokus.


Friday, 24 January 2014

Live Coding on Java 8 Date Time API

Yesterday I recorded a live coding session on java.time. Below is all the information so you can code along if you like:

The Video


The Source Code

All the source code is freely available on github you can get this running the following command:

The (brief) details for setting up the IDE can be found in the readme.

The Slides


Monday, 20 January 2014

Java 8 Date Time: Happy Martin Luther King Day

Today is Martin Luther King Day in the US. I had totally forgotten about this holiday until I saw a few tweets this morning about it. The interesting thing about this holiday is that rather than being on a specific day, it is on the third Monday of January.

As I'm currently preparing some JSR-310 material, I thought it would be interesting to share (and discuss) TemporalQuery - a new interface in Java 8 that makes it possible to write custom queries against the new DateTime classes. There is often a use case in business that an event happens that is unique to a particular domain, an example would be Futures market rolls of contracts or time periods of validity.

TemporalQuery allows us to capture the logic to perform an operation against a temporal class and return an object representing what we were querying. The interface is generic so we can choose what we return. This is a really neat design feature in Java 8 allowing us to externalise logic outside of the core API, but encapsulate the functionality as a data operation.

TemporalQuery is also a FunctionalInterface so it can be used as a lambda on a stream of temporals. In the example below we just consider one date. To find the next Martin Luther King day we can take the current date and perform the following:

LocalDate.now().query(new NextMartinLutherKingDayQuery());

The NextMartinLutherKingDayQuery is our implementation of a TemporalQuery:

Here are some things to note about the implementation:

  • In the private method I take a date at the beginning of January of the year passed. Using a TemporalAdjuster I manipulate that date to cycle it forward to where I want to be. TemporalAdjusters add more power than just plusDays or minusMonths to allow us to work on more expressive situations with date and time. 
    • The TemporalAdjusters class has some really nice methods as used here, or you can write your own TemporalAdjuster if it doesn't exist. 
    • NextOrSame is useful for this type of operation where we don't know what day we are on, but if it's the day we are querying we don't want to advance the day. We use it to iterate to the third Monday of the month of January in the year in question.
  • I then use a the Period class to find out from the date passed whether Martin Luther King Day has passed, or it is today. If it has passed I return next year's date, otherwise returning this year's date. Period is a nice abstraction so I don't have to start subtracting millisecond values etc - yes we've all seen it. 
If you're interested in playing around with this I suggest downloading the latest Java 8 beta and having a go. 

Happy Martin Luther King Day!

Saturday, 18 January 2014

User Group Visit to San Francisco

Why am I in San Francisco? 

Is it:
  • A micro brewery pub crawl?
  • The fact it's almost 20°C tomorrow?
  • To attend a Brazilian BBQ in January? 
These things are certainly going to be a nice bonus of being here, however that's not the main reason. I'm here representing the London Java Community at Oracle's big annual user group leaders convention. The purpose of the conference is to bring leaders of a variety of different Oracle user groups together to discuss best practices and drive improvement of communities and involvement for all those concerned. Particularly this year the topics I am interested in and will be participating in are:
  • Using social media - I'm particularly interested in discussing handling negative discussion and feedback via this extremely public forum.
  • Turning members into leaders and growing speaker talent. This has been an active stream in the LJC and Trisha Gee and team have been doing a fantastic job of running workshop and helping people gain the courage to make that first talk. 
  • Gamifiying your user group experience and improving user group content. I'm mainly interested in this because I get motivated by badges and awards for certain things. I think it could put a fun spin on how we run certain events in the LJC.
I plan to blog about interesting conversations and what comes out of these themes over the course of the week. The summit will only be the beginning of the discussions and I look forward to seeing more about what our members think to some of the ideas and which may work for us. 

When discussing any kind of conference and benefits of conferences I always say that it doesn't have to be a specific talk that motivates you but a catalyst to change. All the major turning points in my career have been down to ideas gained at conferences. It will be interesting to be involved in a non technical conference across a range of different products, experiences and backgrounds. 

I have very kindly had partial sponsorship from the LJC and the JCP Program Office to be here this week and I can't thank them both enough for the opportunity. 

I am now a JCP Executive Committee Representative

Why are the JCP helping to sponsor my visit here? After 3 years of working on JSRs with the London Java Community with the LJC JCP committee I have now stepped up my involvement and represent the LJC directly with other JCP executive committee members. I am attending my first face-to-face meeting at the end of this week. I'm really thrilled to be working with so many fantastic organisations and individuals to help maintain and form standards within Java. As the meeting has official minutes it's unlikely I will post anything further. 

Wednesday, 27 November 2013

Contributing to Java

I have just written a post on contributing to Java for the London Java Community's JCP Panel. You can find the full post here:



Sunday, 24 November 2013

The LJC Open Conference 2013

Yesterday I attended my 5th LJC open conference, and as always it is one of my favourite times in the year. Most of the major conferences have been and gone and people are winding down ready for Christmas. However, the combined knowledge and enthusiasm of the community doesn’t reflect this slower time of year. 

This year I got a lot more involved with helping in set up and planning board activities, as well as giving a talk on TDD primer. The session board looked like this first thing in the morning:


There are roughly 5 streams of topics at the conference, what interested me was the focus on development of people skills and testing of code - there was definitely a strong feel of craftsmanship in the air. 
  • Core Java
  • Java EE/Application Servers
  • Testing tools and processes
  • Community and soft-skills
  • Workshops
The slides I gave for my talk are below, it's based on a longer talk I gave at JAX London. The idea was to give people who haven't tried Test Driven Development before some guidance in getting started and what some of the pitfalls can be. Sadly I had a Mavericks and projector based issue, which meant I lost about 10 minutes of the talk. However, the show must go on so I covered the first slides without a project whilst the hero of the day John Stevenson fixed the projector. Minstrels will write songs about this day...


Test Driven Development Primer LJC Open Conference from jpgough

I got some good feedback on the talk - I need to refactor the examples in the slides a fair bit, this will be done when I put the information I presented at JAX into a blog series.

I also went to a talk on testing with Spock. It's not usually something I'd be particularly interested with it not being core Java, however it was interesting to see a different take on testing. I quite liked the way you can be verbose in your tests and get a lot of boilerplate you require in JUnit for free. The final talk I went to was on progressing your career without losing technical focus. A lot of people looking for mentorship and guidance at a senior level on how to remain technical. It was a good session, but only touched on a few issues in the time - it looks like something that could be run as a bigger round table.

It was great to catch up with old friends and people I've worked with in the community over the years, especially now I am not in London as often. It's also helped me start to focus on my own learning plan for next year. It's always a motivating weekend and if you didn't get chance to go this year I can't recommend it enough. As always thanks to the sponsors IBM for a great venue and beer from Zero Turnaround and some dodgy car salesman Simon Maple for organising the event.



Tuesday, 3 September 2013

Leaving London and keeping in touch

At the beginning of the beginning of the year Megan and I had our first child Emily and moved to Bedford. This sounds more severe than it actually was, the commute down from Bedford to Kings Cross is only around 40 minutes. It's been a busy 6 months since then working on multiple projects with Stackthread, getting promoted to Vice President at the firm and as you can imagine not too much sleep.

As a family, we have decided to take a step which will involve us spending a lot more time together - but sadly means that I will be leaving London as a work hub. Having just completed major project milestones at the bank I work for, I decided it was time for a change of roles and found an exciting opportunity in Milton Keynes. From a personal perspective this also cuts down a 2 hour commute (each way to Canary Wharf) to 20 minutes, and reduces my outgoing costs on expensive rail tickets.

This has left me with many decisions to make about what projects to keep working on in London and how to keep in touch with specifically the London Java Community and the London Java Community Process Committee. For now, I'm not going to make any rash decisions and see how things pan out in terms of time available and what I realistically commit to. With ever limited time, I am trying not to spread my contributions too thinly and want to ensure that whatever I do chose to work on in the next few years has a solid impact.

Currently, I next plan to be in London on:

  • 29th-30th October for JAX London.
  • One Saturday towards the end of November for the LJC Open Conference