I again had the opportunity to chat with one of the speakers we've got lined up for July. This time, it was Dr Nic Williams - iPhone and Rails expert at Mocra, open source developer and blogger:
MC:I think I should point out to readers that its outrageously early in the morning over there! Thank you for taking the time to answer a few questions!
Dr Nic: I am awake before my two children. I think I get a prize for this. Talking to you is a pleasure.
MC: Can you tell us a bit about yourself and your ruby work?
Dr Nic: I'm one of the world's best looking Ruby developers. I come from a small island nation filled to the brim with outrageously good looking people, called Australia. We've learnt to harness our aesthetic awesomeness into our craft of writing Ruby code.
For me personally, I think I've written 50+ ruby projects - rails apps, rubygems, textmate bundles (that use Ruby inside) since I first went to RailsConf in 2006. The whole "Ruby" thing has unleashed a wave of creativity in me which I am loving.
MC: And what is it about rails that you like so much? What would you say are its best features?
Dr Nic: You do less thinking about non-application code. No thinking about where to put your next file. No thinking about how to write SQL. No thinking about if/how/when to write tests. And I like the Ruby part of Rails a lot. Its a programming language that demands that you write awesome code. Oh and these days you've got Passenger to love about Rails too.
Dr Nic, one of the world's best looking Ruby developers, strikes a pose.
MC:
A big message since the early days of rails has been about standardisation. Where the files are, what code to write, etc, and the rails environment is still really good at guiding developers into good development practises. Rails 3 seems to have a shift towards modularisation, and making lots more components replaceable. Do you think that will change things?
Dr Nic: To be able to easily replace chunks of the Rails stack with alternates - either performance improvements or new DSLs (e.g. haml over erb for templates) - will be a tremendous boon for advance rails developers. It won't affect the lives of new rails developers. They'll install rails, run "rails my_project" and have a happy life with the defaults.
With Rails 3 promising to have clean internal APIs it will offer a new era of plugins that can confidently extend rails today without fearing those plugins will break in rails 3.1 or 3.2. Nonetheless, plugin creators should test their plugins against multiple versions of rails, say with the garlic project.
MC:
Yes, there are lots of things to look forward to in Rails 3 - what is your most anticipated new feature? And is there anything you'd like to see in rails that hasn't made the shortlist yet?
Dr Nic:
I'd like RJS removed as a plugin. I don't think this should be the default way to add JavaScript/Ajax to an app.
Its not that the RJS helpers are bad; rather, after you use them, and you then want to write some more powerful/different javascript, what do you do? You either write nasty amounts of Ruby-cum-Javascript in a RJS template, or you break out a javascript file and write javascript yourself.
The latter is more preferable - you are writing javascript in its own language, you can unit test it with frameworks like http://jsunittest.com or Screw.Unit, and you know that the rest of your app can function without javascript. If you are using RJS then its very hard to unit test. I don't think anyone has ever bothered to write some RJS in a TDD fashion. That is, write a JavaScript test that says "this DOM element should disappear" and then write some RJS to do it. You just can't because you need the rails stack to render the RJS.
Its much cleaner and more powerful to start and finish with pure JavaScript, write unit tests for it, and do it in a purely unobtrusive way rather than RJS.
The bestest new thing in recent rails versions is Rack. Rack gives the Rails stack more power. Stackable middleware, low-latency metal endpoints. Its great stuff.
MC:
On a JavaScript related note, are you a prototype or a jQuery guy? Do you have a favourite set of plugins/gems that you use when setting up a new project?
Dr Nic:
jQuery. I just like the API: an object representing a bunch of target DOMs, and you do things to that group. Or you filter it to get a smaller group, that you do things to. It just seems to work cleaning.
Oooh, rails templates are a very nice addition in rails too. My set of default plugins/gems includes cucumber, rspec, machinist, some jquery assets, will_paginate, state_machine, rails-footnotes, faker and fakeweb.
I think they're documented inside our Mocra rails template at http://github.com/drnic/rails-templates/tree/master file mocra.rb
its still a work in progress, but I love that I can "document" my list of plugins and it becomes a live "new project script"
MC:
I imagine you've submitted patches to most of those? You seem to delve really deep into the components you use, and do a lot of open sourced coding.
Dr Nic:
There's a pretty low barrier to patching other people's stuff these days. GitHub is an open source community's wet dream
I like reading through other people's code. Since most of my Rails career has been as a solo developer/consultant, until about 6 months ago when I started hiring, I've read open source code to learn style, tips, tricks etc.
So I'm motivated to patch other people's projects - it gives me an excuse to crack open their code and have a stickybeak inside.
MC:
And your team at Mocra seem to be like-minded - how have you found growing your business?
Dr Nic:
Unlike open source projects, customers needs/desires aren't publicly visible on a website. I'm relatively new at building relationships with clients a level above the code. It helps that I'm outgoing, but I do forget to do some of the business-building activities that pure business-focused leader would do.
Instead I still get lost in code for days or weeks at a time. Since all the mocranites are open source, hacking junkies like me that means that we all suffer from the incurable disease of "this can be fixed with code". I think, tragically, some things can't be fixed with code. So I'm still learning the softer sides of business Mocra has had some great successes in its short 6-month life.
Oakley's Surf Report has been a very well received iPhone application that is featured on all demo iPhones and is being included in an Apple TV commercial. And recently we went live on http://orchestrateapp.com. Finishing projects like this as a team makes being a software hacker a very justifiable career.
MC:
I'm just going to sneak in one last question before we run out of time....
Dr Nic:
My wife tells me we ran out of time a while ago, but let's not worry about that for the moment.
MC:
In the current economic climate, do you think rails has advantages over other frameworks?
Dr Nic:
Oh shit yes.
Tough times are when start asking the big questions: what tools and processes can be use to get this job done with less (staff, time, resources)? Agile development means you get the core 80% done with 20% of the "normal" belated effort of a traditional, over-running project. Rails is still the best web dev toolset for efficient, rapid web development.
Rails developers and agile development thought leaders need to be shouting this stuff from the roof tops. Or rather, from the boardrooms and sales calls. Similarly, developers in all fields should take the time now to learn Rails and learn the basics of agile development now so they make themselves more valuable. Its exciting times, really.
MC: That's brilliant! Thank you (and your wife) very much for your time, it was a real pleasure chatting to you!
Dr Nic:
Thanks for asking questions that I had answers to.
I'll see you in London.
If you found this interesting, I came across another great interview with Dr Nic at Ruby Learning, and, of course, you can meet him at the conference! Other interviews with speakers, including last week's with Geoffrey Grosenbach, will be posted in the interviews section.



