Wednesday, 19 March 2014

So... I've been using blogger for a few years now. I like it because it's really easy just to start typing and get a blog out there, and because it provides simple analytics and easy integration into Google+ (OK, so I never use Google+, but hey, I'm trying to via blogger).

But there are a number of things blogger is not so great at, so I'm trying out a new platform at the moment, which I may or may not stick to. More to come on that when I've got more to report I guess.

But for those who read my blog via blogger (or the RSS feed associated with it), I wanted you to know that my latest blog post is over here. This particular experiment will help me figure out how many people read my stuff directly from here, and how many find it through other channels.

Hopefully more to come on the experiment, when I've got something to report.

Tuesday, 11 March 2014

Wow. My 4th QCon London. That’s not bad. And every time, it’s a different experience (if you must, see my blogs for 2013, 2012, and even 2007 (part 1 & part 2 - how cute was I? "agile seems like a jolly good idea; automated testing appears to be important")).

I can’t even tell you what I did on the first day, I was mostly panicking about my presentation - I was inspired after my trip to New York last month to change my talk at the last (responsible?) minute and do a live coding session, something much more technical than my recent talks. I’ll leave the details for a separate blog post though, when the video comes out.

The thing that stands out for me from Wednesday though was Damian Conway programming Conway's Game of Life in Klingon. Yeah. Just find the video and watch it, the man is a genius.

The Thursday keynote was inspiring too from a totally different point of view - Tim Lister of Peopleware fame shared stories from his career, and I came away from that really happy I work as a technologist, but with an increased desire to learn off other amazing people.

On Thursday I hosted the "Not Only Java" track - I’m on the programme committee for QCon, and this year we wanted to cover leading edge technologies (as always) but we didn’t want to slice things into strict technology silos [interruption: argh! the person in front of me nearly destroyed my laptop by suddenly moving their chair back! Why do people bother in economy on a morning flight?]. So I wanted the Java track to be more representative of what today’s Java programmers care about - for the programmers of course, but also because I know there are architects and team leads at QCon who might not realise how things have moved on with the language, and how much polyglot programming we do these days.

Martin kicked it off with a great history lesson on the progress (or occasionally, lack of it) in Java. He begged us to study and understand Set Theory, to use async design, to think of the users of our APIs, and, most of all, to design nice, clean code.

Next up, Eva took us through the fundamentals of Garbage Collection - this might not seem like a cutting edge subject these days, but it’s one of the most misunderstood subjects for Java programmers. Eva gave us a really great, understandable view of the different types of garbage collectors, how they work, and their pros and cons. She left us with a call to arms to not simply let other people try and solve this problem, but to get stuck in and contribute ourselves, via the OpenJDK.

After lunch was my nerve-wracking live coding session, putting together a full stack end-to-end web app using AngularJS, HTML5, Java and MongoDB. It only went wrong twice, and people seemed to like it. I’ll post the video in another blog post as soon as it's publicly available. Code is available on github.

We’ve been playing with the open spaces idea at QCon. The Java one only had a few people in it, but that gave everyone a chance to speak at least. We covered Java 8 (the Good and the Bad); other JVM languages; and UIs for Java (Javascript or GWT?). And I plugged the work the LJC does in London, of course.

After this Bodil blew me away creating a My Little Pony game using RX in the browser. ‘Nuff said.

Finally, Simon Ritter gave us a view of the Java 8 features most likely to impact the way Java developers think about software design - lambdas and streams. I thought this was a really great introduction to the concepts if you haven’t seen them before, and with concrete examples that showed how we should be using them. If you're not already looking at lambdas and streams, you should be - even if you're not going to be using Java 8 yet, it's worth getting a heads up on how it's going to impact our programming style.

I’m very pleased with the way the Java track turned out on the day - every speaker was first class, a wide range of topics was covered, and I, for one, learnt something in every presentation.

To finish off the day, Emma Langman gave an awesome keynote about how people are the messy bit of your system, and how they’re never rational and you shouldn’t expect them to be. I also highly recommend this talk, especially if you’re a techy and you’ve found yourself in some sort of management or team lead position.

Sadly I couldn’t stay for day three of the conference, I had to fly off to the Joy of Coding to re-give the live coding presentation there. Because, if you’re going to do something terrifying and doomed to failure, you might as well do it twice.

QCon is an expensive conference, especially compared to the developer-friendly prices of something like DevoxxUK, but for getting a big picture of where the industry is, of things you might be missing, for learning hard core technical skills and understanding the important of the fluffy-people-stuff, and finally for meeting a wide range of people from developers to CTOs, I think you'd be hard pushed to find something better in London. IMHO (and remember, I did disclose I'm on the programme committee).

And although it's really hard work putting together the programme for a track like this, and although both times I've said I'm Never Doing It Again, when it goes this well it makes you want to do it all over again. After a break. A looong break.

Monday, 10 March 2014

I’ve been running into BSkyB a bunch this week - firstly I was invited to kick off their innovation tech talks series last Monday, then I kept meeting Sky people (that makes it sound like they’re aliens) at QCon.

It seems Sky is keen to create/foster a culture of innovation, which is an ambitious goal for such a large company. So I was given a very vague brief for Monday’s presentation (“Can you do something Mongo-ish, maybe a bit of performance and concurrency stuff, and talk about overall best practice?”) I gave them an early view of a presentation I’m working on titled something like “Why do we keep reinventing the wheel?” (anyone who saw me at JFokus might realise that I cunningly swapped out most of the body of the “What do you mean, backwards compatibility?” talk and tried out this topic instead).

This was supposed to be a 20 minute intro talk (OK, so I clocked it at 40 minutes in rehearsal) with the rest of the time devoted to questions on any subject I know about, or even anything I have an opinion on. Sounds dangerous, but means I can always move fast on the answers I don’t know in order to cover more ground - cunning, you see? Actually, that sounds like it would be more fun if alcohol were involved.

Anyway. The talk bit of the session took up most of the time, because I had really good questions during the course of the presentation. It’s nice to talk to a much smaller group (there were maybe 30ish people, giving up their free time after work, like an internal user group). But I also had questions on remote working, on creating a culture that’s appealing for developers to come and work in, and on MongoDB.

I don’t know how many companies do things like this, or lunchtime brown bags, or something, but I think they’re a great idea. This was a mix of people from different departments, different teams, working on different technologies. It was a good way to get people from across the organisation talking with each other and sharing best practice between teams. Many organisations have people working in their little silo, and we (MongoDB) often find ourselves introducing teams from within the same organisation to each other - there’s no other mechanism for one team to find out about the other. I guess that’s what white-tower architects were supposed to be for - to know what everyone’s up to and make sure people are doing the “right” thing. Given this doesn’t seem to work, what else can we do to share knowledge internally? How else can we get the right people to meet each other?

Saturday, 8 March 2014

I’m on a plane (there’s a surprise) on my way back from The Joy of Coding. It’s the title that attracted me to this conference, and it was a great little one day event with awesome people like Dan North, Erik Meijer and Dick Wall presenting. What I liked about the themes is they were broadly technology agnostic, pulling back to a level which made me remember why I’m a developer. It inspired me to do more research and more thinking, and less panicking and trying to write code. That might seem odd, as someone who goes to as many conferences as I do should get loads more research and thinking time than most developers living under the whip, but I seem to spend so much time bouncing from thing to thing I don’t get space to just sit and think, or to read things in any depth.

The conference organisers made it easy to focus on the bigger things - the venue was great, with a nice space for mingling with people but nooks and corners for doing work or for video conferences. The hotel they chose was one of the best I’ve stayed at - the room had a sauna in it. A sauna! I spent the evening using every toiletry they provided, and moving between the sauna, the steam/shower cabinet and the jacuzzi bath. I won’t pretend I did a lot of thinking, but it was a really awesome way to top of a crazy week, and I feel almost sane.

So if I’m going to leave you with one thing from my experience at the Joy of Coding, it’s to Stop. Stop and think. Stop and ask. Stop and read. What are you doing? Why are you doing it?

Monday, 3 March 2014

I was aware that there have been many changes in the last few years, and I’ve seen maturity come to web platforms in the form of standardisation and common reusable libraries and frameworks - and I don’t mean reusable in the way we used to “reuse” stuff by nicking it off other people’s websites when we saw something cool.

I used to be a web developer. Sort of. Some times I’ve been on the bleeding edge, and others… I remember using JavaScript to call back-end services with an XML payload before people were using the term AJAX, but I also remember working on an enterprise um… “classic”… JSP application only “recently” - in fact that was probably the last job where I did anything that looked like web development.

So this blog post is going to chart the progress of web development through my own experience. Of course, this doesn’t by any means cover the whole spectrum, but I think my experience has been not unusual for a Java programming working through the noughties.

Over the course of my career I moved further away from the UI, because certainly early on the money and status was in “back end”, whatever that means, and not “front end”. Which is ridiculous, really, especially as back then you couldn’t really follow best practices and clean code and test first and all that awesome stuff when doing front end development because none of the browsers played by the rules and frankly if you got it working at all you were a bloody genius. And that’s not even considering the fact that as a “front end” developer you should be thinking about actual real human beings who use your product, and actual real human beings are messy things and understanding them is not (we’re told) traditionally a domain that we developers are naturally proficient in.

Anyway, I digress. This was supposed to be a history lesson. Or a nostalgia trip. Or possibly Ranty Trish waving her walking stick in the air and shouting “You kids don’t know how good you’ve got it these days”. If nothing else, I hope that it makes other “back end” developers like myself appreciate how much things have moved on.

Let’s go back to the olden days, before I’d even graduated: picture a time before smart phones - before phones were even common (I was horribly mocked at university for being poncy enough to have a mobile), before we knew if all this work we were doing to combat the millennium bug was going to stop the end of the world. I was doing my first summer internship at Ford, and a contractor from Logica (who don't seem to exist any more??) told me that if I was messing around with web pages and HTML (my friends and I had geocities-and-equivalent sites) I should look at this JavaScript thing to make my pages “dynamic”. I didn’t have to just use GIFs to bring my page to life, I could move stuff around on the page. I think I wrote a “you are in a crowded room”-type adventure game, because my background was BASIC and that’s what you do.

Actually I haven’t even mentioned that we were creating these websites to stay in touch with each other. We’d discovered guest books, and used them to write comments and share stories since we’d all moved out of our home town to go to different universities. Man, why didn’t I invent Facebook back then? That’s what we needed.

Anyway.

A year later, I was back at Ford doing my sandwich year-in-industry. The first project I worked during this time was a web-based reporting tool that needed to dynamically display hierarchical data. We chose JavaScript trees to render this data - my year of messing around with my website paid off, and I was able to use my “cutting edge” Javascript skills in a real production environment. Yay? The back end was CGI - I think I was writing in Perl, but don’t tell anyone that. I was learning Java at university, but this was a new language and I don’t think Ford was using it yet.

The next project was a very ambitious one - be the first car manufacturer to sell new cars on the web. Ford was well ahead of their time - the millennium bug had not killed us all, but people were barely buying books online, never mind spending tens of thousands of pounds on a car they’d never driven. But it wasn’t just ahead of its time from a business point of view, technically it was very advanced too - we used lots of “DHTML” (as we were now calling it), a new-fangled technology called ASP, and we were writing modular, reusable COMponents. We used XSLT to parse the XML from the COM objects, and the ASP figured out whether you were Netscape or Internet Explorer (Firefox wasn’t even a gleam in the inventor’s eye, and forget Chrome, I think we using Alta Vista (whaaaat? AltaVista got bought by Yahoo??) not some new-fangled search engine beginning with G) so it could use the right XSLT to turn the XML into HTML that was readable by the browser you were using. My job was to get the DHTML pages rendering and animating correctly in both IE4 and Netscape 4. That was a lot of fun for me, but also very challenging. And imagine my shock when a few months later I tested the site from the university UNIX machines to find that Netscape rendered it completely differently under UNIX. I learnt a lesson about how important it was to test on different platforms.

We had some smart Microsoft people helping us out with this project, and, because it was 2000 and the dot com crash hadn’t happened just yet, we also had a lot of young, overpaid, overconfident contractors who believed anything was possible. I learnt a lot during this time, not just about the technology, but also about different approaches to shaping your IT career. And about how much you could earn before you were 25. I was definitely going to be a programmer when I left university the next year.

Yeah, so… I graduated in 2001. If you were around then, you’ll remember that getting a job was a bit more difficult than I had anticipated, especially as these young, overpaid contractors were now desperately grabbing anything they could find. But that’s a story for another day.

I didn’t go back to Ford straight away, I’d “been there and done that”. I worked on the website for Common Purpose. On the first day, they sat me down with a book on JSP and Servlets, and that was my reading material for the next few weeks. If I’d been fresh out of university where we’d been doing Applets, and where I’d written a Swing app on the side for my Dad’s school, this would have been a big mindset change for me. But having worked on the ASPs it wasn’t such a big shift. I did, however, like how JSPs and servlets made the separation between the view and all-of-the-other-logic-stuff a bit clearer - back in ASP-land we’d settled on a convention of dealing with the form data from the previous page in the first part of the ASP, and rendering the new page in the second part. To this day I still don’t know what we should have been doing instead. But in JSP-land it only took me... I dunno, about 6 months I think, to get the website up and running. The most difficult section was registrations. And yes, I was a graduate, and yes, I was new, but that was a good turnaround for a web application “in those days”.

In my spare time I used what I’d learnt on the blews website. I even had a section where people could log in and comment on photos - we had whole conversations on this website. It was a way for me and my friends to stay in touch. If I’d cracked the photo-uploading instead of it being a manual process for me, I would have invented Facebook. If only I’d known….

The work dried up and there was nothing else for a graduate in the early noughties, so I went back to Ford. My first role back I picked the same technologies we’d been using before - XML, XSLT, only this time we were using JSPs instead of ASP. Our project had a very tight budget and we’d worked out that using open source Java technologies and running the application on one of the many UNIX machines lying around the place was a lot cheaper than the Microsoft solution. I think we were the first team in Ford Europe to pick Java at a time when the recommended approach was Microsoft. We delivered on time and under budget, and Java was the way forward for the department from then on. But on this project I met a guy who would impact my career probably more than he even realises, a guy I’d work with again later. He told me that in Java we no longer used Vector by default, but ArrayList (whaaat? What’s an ArrayList? I had no idea what the differences were between Java 1.1, which we’d learnt at university, and Java 1.2, which was now standard). And questioned my choice of XML/XSL. Although I’d been learning new technologies and growing, he was the one who made it clear to me that I needed to keep myself ahead of the curve with the technologies I was using, or planned to use, if I wanted to stay relevant and make my life easier.

On the next project I worked with a genius guy who was definitely keeping ahead of the curve - he was using JavaScript to send small XML payloads to the server (which was coded in Java), and rendering the response in place on the page instead of reloading the whole thing. Mind. Blown. I didn’t even hear the term Ajax until a year or more later. We were fortunate in that this was once again an internal application, so we controlled the browser. This was back in the days when you wanted your users to be on IE5, as this was the only browser that supported this functionality.

The next few projects/jobs I worked on were all more pedestrian variations on the JSP theme - first I learnt Struts, which at least made us realise there was a model, a view, and a controller. Then at Touch Clarity I learnt about Spring MVC, which actually put the validation errors next to the boxes which cause the error - by default, without you having to mess around. Spring was a revelation too, a framework that really tried not to get in your way. It was also frustrating because you needed to understand its lifecycle, but it did so much heavy lifting for you, it sped up standard CRUD-app web development enormously.

A couple of years passed, during which time I was still working on a web application (for an investment bank) but I can’t for the life of me remember what technologies we used (other than Java). I know it was hard to test and I know the tricky stuff was “back end” not “front end”.

In the next project where I had any control of the technology, I picked Spring since I’d had such a good experience previously. It took 4 developers a couple of months or so to develop an admin application for a trading app. Given the previous timescales I’d worked with, this seemed pretty good. Until a few months later and two other guys on the project produced an admin app for our bank users in a matter of weeks. I can’t remember what they used, maybe Grails? But it was another demonstration of how I really should have been researching the field instead of simply sticking with what I knew, especially when I knew my knowledge was a couple of years out of date.

Fast forward to LMAX, and we were using GWT, pre-2.0 - I think this probably feels natural if you’ve been a Swing or AWT developer, but I’m still not convinced it’s a sound web platform (although I know it has improved). It was great because cross-browser was no longer an issue, but it was bad because it separates you from the underlying HTML, which means you can seriously mess up without realising. It’s also hard to use CSS correctly when you don’t have access to all the HTML components.

So we come to more-or-less the present day, as it should be fairly obvious that during the time I’ve been working on the MongoDB Java Driver I haven’t done a lot of GUI development. I’m lucky because attending lots of conferences means I see a lot more of the current-trending technologies, but up until a couple of weeks ago I hadn’t had a chance to play with any of them.

So now I’ve been trying Angular.js, Bootstrap, and UI Bootstrap. My goodness. It’s a whole 'nother world. I’m seeing at conferences and user groups that developers are increasingly polyglot, so maybe there’s no such thing as “just” a Java developer any more, but if you are “just” a Java developer, I think it could be… interesting… to get your head around some of the techniques. Since we don’t have closures, our callbacks are ugly and we tend not to program that way. Async is not something that comes naturally in a Java environment, I believe, although after working that way at LMAX I’m personally sold on it. Old-world JavaScript developers like I am/was might also find it hard to understand you can have clean, testable JavaScript code which Just Works. It didn’t even occur to me to worry about browser compatibility, and my app not only worked on my phone as well as my laptop, but looked really phone-ish and awesome with very minimal effort.

I’m currently on a plane on the way to QCon London where I’m going to demo this Brave New World of web development (together with a nice Java back end to prove how awesome Java is to work with and, of course, a MongoDB database). So it is not my intention in this post to explore what this new world looks like. But I have seen the Present, and it’s a lot better than the Past. Kids These Days don’t know how good they’ve got it - they’ve never had to struggle, to fight the browser, to hand-craft their JavaScript like we have, or had to work with raw, low-level JSPs and Servlets.

Now things are easier. There are standards, there are libraries, there are best practices and YouTube videos showing you how to create apps in 60 minutes (back in My Day I had to borrow someone else’s browser to use the Internet, and I debated for years the value of spending my own actual money on a Javascript actual paper actual book, which I could not afford). Now, you can get something quite pretty and functionally interesting, working in a lot less time than I realised. But that doesn’t mean the Kids These Days have it easier - it means there is so much more potential. Instead of beating your head against trying to get a specific version of IE to do what you want, instead of having to write separate pages for different browsers (although maybe that still goes on), you can be exploring so much further into the possible, try things that no-one else has done yet. It opens up so many interesting possibilities for apps on all platforms.

Exciting times.

So next time someone asks me “What is the de facto front-end framework for Java?” I’m going to say HTML5, CSS and JavaScript.