Wednesday 25 February 2009

NHibernate in Action

I just had a copy of NHibernate in Action delivered at work and I felt strangely sad about it. As a Java developer I read Hibernate in Action around 3 years ago and after flicking through the .NET variant I don't see a huge deal of difference. Obviously there will be differences but not enough for me to invest the time in reading the book cover to cover... I'll most likely skim it for some new stuff.

The thing that I find sad about it is, I think it kind of sums what I have learned, in the technology front at least, in the last 9 months. I've learned huge amounts about team leading, agile (in action), manufacturing and after sales. I just don't feel I've stretched myself enough. Maybe sitting next to Ian Davies for 6 months prior to leaving JPM gave me a false expectation as to what I could learn. Or maybe it's just that having tasted life working with Ruby every day (using the wonderful Marjoree and Rails) I don't want to go back.

I had the chance to make my day job an RoR one but I think I made the right decision not going down that road... at least in the short term. It would have been a selfish choice to choose Rails over ASP.NET MVC + NHibernate. Don't get me wrong I'm under no illusion as to what is the better option it's just I don't think it fits where I am at the moment.

Another thing that makes me sad is I can hear what Jim O'Brian said at SoR 2008 ringing in my ears, if you are a Java developer and want stretch yourself then .NET is not what you are looking for. He's right, C# is sooo close to Java. On the up side it has some nice features/syntactic sugar like Delegates, Lambda's, Extension methods. On the down side keywords like virtual and override make it more strict and verbose. However I don't think that's worth 9 months of investment.

Saying all that I am my own worst enemy, after installing ReSharper the first thing I did was choose the "IntelliJ" short cuts option :)

How does Agile cope with chaos?

Does Agile need a business that knows what it needs?

If things are chaotic where does an Agile software development team fit in. How can it help the business meet the expectations of it's clients?

I guess the answer to my first question seems straight forward, what does it matter if you are using an Agile method or not, if a business doesn't know what it needs then how can you ever satisfy it? Maybe you can. If a software development team can take those snippets of requirements that the business has time to give then feedback to the them with ideas and direction maybe it can help shoulder the burden the business finds itself under and do a larger share of the thinking for it.

I think this is possible but I also think it requires a strong, focused team. Without that there is a danger that they get drawn into the chaos and end up thrashing around, never reaching the magical "done".

One way to combat this would be to use a Lean method. At the very least, in a manufacturing environment where I am, terms like kanban are common and the busy guys wouldn't have to invest time learning about and attending iteration planning meetings... yes they are that busy!

But the thing I like about XP/Scrum agile is iterations, they provide a common goal for the team, a time box in which you feel motivated to deliver for the business and your team mates.

Somehow I feel this isn't one that's going to be solved overnight.

Friday 7 November 2008

Giles Bowkett and SoR

Earlier on this year I attended Scotland on Rails. I had a great time, met some great people and was really looking forward to SoR 2009. I say was, I guess I still am but it's tempered by the fact that the energetic and inspirational Giles Bowkett won't be coming. He's now going to the WMC instead. It looks like the Ruby Community has fallen out with Giles and/or vice versa.

Thursday 24 July 2008

Regions

Does anyone use regions in their code?

Like many of the features in the .NET world that are not available in the Java world I’ve had to spend some time getting my head round them.

I think things like lambda expressions:

Html.ActionLink(c => c.Index())

and the single line getters & setters:

public string Name { get; set; }

are great language features. They, make our code neater, mean we can write less code and in the case of the lambda’s our code far easier and safer to refactor.

However, regions, I don’t get. To me they add zero value to the code we write, they are comments that allow our editors to arrange our code. Even one of the features of my much loved resharper will arrange code automatically putting it into regions… it’s one of the features I’m going to have to disable.

Anyway I read this blog entry earlier on and it hits the nail on the head for me.

http://www.codinghorror.com/blog/archives/001147.html

Saturday 5 April 2008

code == data, jRuby rocks and ohh BTW i killed a villager

I'm just back form my first conference, Scotland on Rails (or I was when I started writing this blog entry... it's been a hectic week, believe me). It was great, that is to say I really enjoyed it. There was a diverse range of talks, from an experience report by first time speakers Richie McMahon & Maria Gutierrez to the innovative Edgecase dialogue from Jim Weirich and Joe O'Brien. So here is a my highlight reel.

Friday

Beautiful Code (Keynote) - Michael Koziarski

So this guy is a Rails developer, that is to say he is on the core team developing rails itself. He talked about some of the good and the bad code in Rails and, if I'm being honest, it was slightly out of reach for me. Having only developed one rails app to date my Ruby experience is still limited so when he talked about the good in alias_method I was kinda of confused. I get the idea, I am, by trade, sadly a Java developer and have used AOP so the whole idea of instrumenting a method adding before and/or after code isn't new to me. I did however see and understand the bad stuff. His example opened up ActiveRecord and showed the audience how Rails builds finder SQL, it is nasty. However it works well and is stable, but... it ain't pretty.

The conclusion he arrived at was good. In a nutshell he said that beautiful code is all well and good but ugly stable code that works is also good, because... well... it works and it's stable. He suggested that we, as developers, need to learn when to draw the line. When to say ok I'm done, that does what is supposed to do, now lets get on with some other task. I think that was a great thing to say. As a developers we need to know when to draw the line between beautiful code and code that can be understood, extended and ultimately be refactored to provide more functionality at a future date... but not now.

Pushing Rails onto our Stack: a system integration study. - Richie McMahon & Maria Gutierrez

This was an experience report about introducing Rails into an organisation who's productivity had slowed to a crawl because of, essentially, j2ee bloat. There were a few things about this talk that reminded me of my old pre bank work and I guess that is why it really hit home.

  1. The degree of pride that both Richie and Maria showed at their achievement. I thought that was cool and it made me really buy into the story they were telling. I knew where they were coming from. In the old job I had introduced, after years of banging my fist on the table, some Agile/XP principles; TDD, iterative development and stand up meetings. I felt passionate about that at the time and, I guess, to this day quite proud of what we did in that year.
  2. How Java frameworks slowed productivity. The same project that pioneered Agile methods pioneered the buy vs build approach in my last job. We stopped using home grown frameworks and proprietary code generators and started looking to the open source community. We came up with what had becoming a popular approach of Struts/Spring/Hibernate. Ohhh no!!! I can hear you all say with your convention over configuration hindsight, "that's XML hell". It was and I guess still is. We like Richie and Maria's team had made rapid progress in the early on then slowed under the weight of config... the interesting thing was though this happened over only 12 months.

Edgecase Dialogue - Jim Weirich and Joe O'Brien

So in a nutshell this was about mocking in tests, what should and shouldn't be mocked and what smells that can be identified by using mocks. Not that mocks aren't interesting but, the interesting thing about this was that it was, as the title suggests, a dialogue. You may be thinking OK, I know what you are going to say the dialogue was with the audience, you'd be wrong. The dialogue was between Jim and Joe. They literally acted out a day at work, pairing on some issues that Joe was having with his tests and using flexmock to solve all his problems. So apart from forming the opinion that only Americans would have the balls to pull something like that off and of the existence of flexmock I'm not sure I learned much here, which is surprising because I don't know much and these guys know loads!... we are also jmock crazy at work.

Code Generation: The Safety Scissors of Metaprogramming - Giles Bowkett

This was the highlight of Friday, maybe even the highlight of the whole conference. This guy is funny. Very funny. And clever... the git :) I'm not going to spoil it by giving my own terse summary I'm going to insist you watch it for yourself (or at least a version of it) and, as Giles says, read this book. What I will do is commit myself to a blog entry on code generation. It's a topic which has haunted me for a number of years. I have a love hate relationship with it.

So that was the highlights of Friday, or at least during the day. As expected the next stop after the conference was the pub. The drinking didn't stop till around one and in between the Scotland on Rails guys organised some pizza and a game of werewolf. The pizza was great, werewolf on the other hand... I just don't think it's my bag, saying that I was almost blam'd, and I do tend to be a little self concious when in the presence of uber geeks. Anyway, I did get a chance to be the werewolf and took great pleasure in killing the off Piers Cawley :)

Saturday

So Saturday stared with a greasy roll and a coffee, which I had to pour out in order to get in a Edinburgh taxi. Great start ehh!!

Domain Specific Languages: Molding Ruby - Joe O'Brien

Joe's talk was great and really explained what a DSL was. Interestingly Koz mentioned that he thought that the term DSL was being abused, not in Joe's talk however. He felt that a lot of so called DSL's he was seeing these days were just good OO code that modelled a domain. Piers added to that saying that code has to be in the language of the domain in order for us as developers to be able to clearly communicate with the customers. As a fan of DDD this was really good to hear. You can see an earlier incarnation of his talk here.

JRuby on Rails: Up And Running! - Charles Oliver Nutter, Thomas Enebo

JRuby rocks. It is of course just Ruby... maybe that's what the 'J' should stand for. But running it on the JVM has so many benefits. But this is why I like it:

  • It brings Rails deployment inside my comfort zone. This may sound like a really lazy thing to say and as I have never actually used fastcgi or Mongrel so I really don't have anything concrete to compare it against. But the thought of using a simple gem to produce a war file then dropping it into Tomcat sounds great to me.
  • Netbeans. Ok as a Java IDE it has for a long time been 3rd behind Intellij and Eclipse but as a Ruby IDE it's the best I've seen. Last year I played with a beta release for a few months and I loved it. It even kicks the pants off of the new Intellij 7 plugin, I'm gutted... I love IntelliJ.
  • Ruby gets compiled to bytecode on the fly when running on the JVM. You can even pre-compile it. This contributes to making it faster, almost 3 times faster, than using the CRuby interpreter. Fortunately, for you, this exceeds my geek threshold by a country mile so I can't even guess how this happens.

So that was it. I had a great time and learned loads, many thanks to Alan, Paul, Abdel and Graeme!

When does registration open for next year guys?

Monday 3 March 2008

Recent events at No 53

Maisie:
  • started walking;
  • fell down the stairs;
  • named her teddy "babay".
Tom:
  • is now potty trained;
  • got his hair cut... with clippers, a no 4 (on the sides only);
  • is really getting the hang of his scooter.
Jules:
  • is facebook mad;
  • is going to run the 10k.
Me:

Monday 4 February 2008

The right side of the tracks

Scotland on Rails is on it's way!! Sponsorship looks like it's flooding in and there is a great list of speakers with a diverse range of topics. Big it up to Alan, Paul and the guys.