Marty Andrews

artful code

Wednesday, December 13, 2006

Easy Access Training

Cogent Consulting is trying a new idea next year called Easy Access Training. The idea is simple. Training courses often run over multiple weekdays, and can be quite expensive. That can make them inaccessible to people who either can't get the time off work, or don't have budget support from their boss to pay for it. So Cogent is offering one day courses on a weekend, and the seats are auctioned off, so it is possible to get one reasonably cheap.

Steve Hayes is running the first course in late January, and I'm going to to try and come along as well. Check out the EAT site to see the latest bids if you're interested.

Sunday, November 12, 2006

Creating passionate users

From Creating Passionate Users. I hope someone says this about software I write one day:Thatiscool

Tuesday, October 31, 2006

Carbon Neutral in Australia

There's been a boom in awareness around environmental issues in Australia in the past 18 months or so. In particular, the local water crisis and the refusal of our Prime Minister to agree to the Kyoto Protocol have been big news. This week, I watched An Inconvenient Truth and was fascinated by the clarity and enormity of the global warming issue as presented by Al Gore. It triggered some discussion between my wife and I about going carbon neutral, so I began doing some research into it.

Today I offset the carbon produced by my house and car, effectively making a big chunk of my life carbon neutral. It was surprisingly cheap, costing only about $300 Australian dollars per year. To become carbon neutral, the simplest thing to do is to purchase carbon offset products. You measure the amount of carbon produced by your life using some simple calculators, and the companies that sell the carbon offsets make sure an equivalent amount of carbon is reduced from some other emissions. The David Suzuki Foundation provides a good description of carbon offsets and how they work.

Whilst the issue is a global one, I wanted to purchase carbon offsets locally to help raise local awareness. A quick search of the market found both Men of the Trees, who provide a tree planting program, and Neco, who also plant trees amongst other carbon abatement activities. Whilst tree planting is an important activity, it doesn't conform to the Gold Standard for carbon offset products, which badges them as being compliant with the Kyoto Protocol. Tree planting in particular is not a permanent change, and doesn't address the root cause of our dependance on fossil fuels.

Eventually, I found Climate Friendly, who sell carbon offsets that fund local wind farms in Australia and New Zealand. Wind farm technology does comply with the Gold Standard, so I was was happy that I was both supporting local awareness and offsetting my carbon output as best I could.

Thursday, October 26, 2006

Batch rename refactoring for IntelliJ IDEA

I've recently joined an existing project that has about 200k lines of code already in it, with no consistent coding standard applied. We decided that we wanted to consistently apply an underscore prefix for names of instance variables in classes. A quick grep through the source code told me that there were about 12000 (yep - thats twelve thousand) cases that didn't conform to the standard. I didn't want to do all of them by hand. IntelliJ IDEA has a feature called "Structural Search and Replace", but that will leave me with broken code. I really want a "Structural Search and Refactor". That doesn't exist, so I figured I'd build one.

I used the "Stuctural Find" feature inside IntelliJ to find all instance fields of a class. The template for that exists already. I set the regular expression on the field name to be [a-z][a-zA-Z0-9]* to make sure I didn't pick up things that already had the underscore, and ticked the box saying "This variable is target of the search". After running that, I get my 12000 or so results in the find results window, and I can use a hotkey to navigate back and forth between them. My cursor appears right on the variable I want to rename.

At this stage, I have a sequence of keypresses I can use to refactor each variable name,

apple - alt - down# go to next misnamed variable
shift - F6# rename the variable
home# go to the start of the variable name
_# insert an underscore
enter# complete the refactoring
apple - S# save the file

I tried recording an IntelliJ macro to record the events, but unfortunately the macros don't work across modal dialogs. The rename refactoring pops one up, so that didn't work. Instead, I downloaded an OS keyboard macro tool called Keyboard Maestro. I put that sequence of keys into it and had it repeat every second while IntelliJ was active. I left it running overnight, and when I got up in the morning I had 12000 renamed variables that all conformed to our coding standard. Excellent!

Monday, October 23, 2006

Consulting independence

I've recently left ThoughtWorks to take up the life of an independent consultant. After nearly a decade working for medium sized consulting organisations as an employee, its a new adventure for me. In my first role, I'm working with my good friends at RedHill Consulting. Pairing full time with them makes my brain hurt, but thats the way I like it. I'm also maintaining a close relationship with Cogent Consulting, and will be collaborating with them in an ongoing basis. If you think any of us can help you out, let me know :-)

Tuesday, September 26, 2006

Defining software architecture roles.

As a member of the software development community, I run into a lot of people who claim to be software architects. Its a heavily overloaded term in the industry, and is a source of confusion even for others experienced in dealing with them. Sometimes I've even claimed to be one myself, even though I know it can cause confusion. There are a few consistencies that I see filter through though, at least in the industry in Australia.

A System Architect, sometimes also known as an Application Architect is someone who typically designs and builds a single system. They care about the internals of the software system at least at a coarse grained level. So they might describe what internal components a system has for example. In addition, they probably will influence what frameworks or 3rd party API's are used to build those internal components. They may or may not be interested in finer grained details like the classes or patterns used by developers on a dail basis (if they're any good, they will, but I'll talk more about that later). Finally, they will probably care about a deployment environment for the system as well. The application server, database, operating system, firewalls etc are all in their scope of concern.

A Solution Architect is someone who designs and builds interactions between multiple systems to provide a solution to some business problem. They care about the edge points of systems so they can figure out how to wire them together. This might be databases, queues, web services, or other programming API's that can be used. The internals of individal systems aren't so much of interest to them. Deployment environments are often even more of concern to Solution Architects, as they need to get multiple systems to play nice together in the same environment.

An Enterprise Architect is someone who designs and builds interactions between multiple solutions in an organisation. They typically exist in organisations that have been around for decades, so therefore have built up literally dozens of legacy systems. They don't really care so much about technology, except at a very high level. Solutions will often be identified by Enterprise Architects, so they may allocate a Solution Architect to drive further detail on the problem.

Almost all developers in the industry will come across System or Solution architects in their time. In Australia, architects sometimes get a bad name because of the increasing number of ivory tower architects around. This results in poor alignment of authority and responsibility. The architects have the authority to make decisions on the project, whilst the developers are responsible for implementing them. If things don't work, the developers get blamed, even if it was a result of a poor decision.

Wednesday, September 20, 2006

What do you need to be agile?

Diana Larsen has commented about the building blocks she thinks are fundamental to Agile. I have held a theory for a while now that iterations and retrospectives are all that is required for an agile process to evolve. I can imagine that first retrospective discussing items like "Hey - our communication isn't so good. Lets try having stand-ups next iteration." Similar conversations could occur for any practice discussed by the agile community. Bootstrapping practices in a team can accelerate the evolution of the process, but it also means imposing more decisions on the team rather than having them manage themselves. Mileage will vary widely depending on your people.

Sunday, August 27, 2006

Visualizing complex software with yFiles

I've spent the last 15 months working on a project that was particularly complex. One of the techniques I used in recent times to try to understand and manage that complexity was to use yFiles to draw dagrams that visually represent the system.

The first diagram I created was one that described the dependencies between modules in our system. We've been using Ivy to manage our module dependencies, so I wrote a script to parse the Ivy files and generate a graphml file that Ivy knows how to parse. Here's the result:

This diagram shows over 100 inter-dependant components that developers work with every day. The Ant build file controls every one of them in a single build. Its definitely complex. I won't go into why it should or shouldn't be this way right now. The important things to nore is that it is that way, and its extremely hard to understand the impacts of a change to any single component. Visualizing the dependencies just helps a bit.

The second diagram I created was one that I drew by hand. It shows all of the runtime components in the system and how they depend on each other whilst they are running. This diagram shows about 30 portlets, 60 EJBs, 15 JMS queues and a few 3rd party legacy systems.

This again was something that was very hard for most of the development team to visualise in their heads without some help. The nice thing about drawing it in yFiles is that it will lay out the diagram so that all of the components are clearly visible.

Update: I was contacted by someone from yWorks to ask if they could use these graphsas examples on their site. I've created some sanitised versions of the graphs for them. So you can download dependencies.graphml or architecture.graphml if you want to see more detail.

Sunday, August 6, 2006

Missing team selection

Last year I managed to make selection for the Victorian 8-Ball team in the state titles. I managed to make the final selection squad of 20 again this year, but didn't qualify for team selection. The team is picked over two days of play, with the bottom four players cut after the first day. Unfortunately, that included me after my worst performance ever in a final squad playoff day. I'm dissapointed, but strangely less so than I have been in the past when I've just missed out. Still, I'll be back next year to give it another go.

Thursday, July 27, 2006

talkr

I've tried adding links to talkr on my blog, so if you're really keen, you can podcast the content as well. I think it only works for new entries though.

Update: Nope - it works for anything thats been listed in my rss feed.

Sunday, July 23, 2006

handyman

My wife used to think I was only good at playing pool and programming. Since we built our house late last year though, I've been doing lots of stuff around the house. We bought a water feature recently, and I've been building lattice fence extensions and putting up brushwood reeds on the fence to create a different feel in the backyard. I think she's slowly being convinced that I'm a bit of a handyman too.

Before:before

After:after

Thursday, June 22, 2006

ant build speed with ivy

I work on a project with a *big* build. It has over 100 inter-dependant components, each with their own Ant build file. Developers need to build them all on their local machines as part of their normal build process. I won't go into why its like that for now. Needless to say, I think its way to big and would love to get the opportunity to simplify it.

We use Ivy to manage the build and make sure everything gets built in an order that satisfies the dependencies. Up until a week ago, a full build took about 45 minutes. Then I happened to stumble across a thread on the ant-user mailing list discussing performance of various ant tasks. It basically says that using the subant task or the antcall task is expensive, because it constructs a new ant project under the covers. Using subant is the way Ivy calls all of the sub-builds, so we had some usage of it in our main build.

I re-factored our build to minimise the use of subant, and also cleaned up a few antcall's that we had. Our build went down from 45 minutes to 35 minutes. Thats an enormous gain for the project when you have over 30 developers running it every day.

Friday, May 12, 2006

legendary service

I'm currently spending some time consulting at a big corporate in Melbourne, where we've been trialling the use of Confluence as a new wiki. Part of my work in that trial has been to install it onto WebSphere. I did that, and got it up and running, but then started having some issues a couple of days later following some minor environment tweaks. Searching the forums and online docs found no answers, so I decided to try some more direct contact.

At this stage, we are running on an evaluation license only. No money has been handed to Atlassian at all so far. I expected a response, but probably via email a couple of days later. I headed to the support site they have set up to see where I could post my problem. Right there in the middle of the screen is a big button saying "Live Help. Click Here". Ok - I'll give it a go.

Up pops a litlle web-based chat client. It tells me I'm 1of 1 people in the queue, and someone will be with me in 60 seconds. Sure enough, about a minute later, I see this:

atlassian_dave has joined the conversation.atlassian_dave: hi, how can i help you?

Over about the next 2 hours, atlassian_dave stayed with me on that live chat and patiently helped me work through a bunch of possible technical problems. We systematically eliminated potential issues until the end of the day. The problem still wasn't solved by the time we were done, but I was well down the track. I was impressed both with the initial reponsiveness and the overall length of support. Especially considering I wasn't yet representing a paying customer. The 'legendary service" tag is a pretty big claim to make, but in my short experiences so far, they've been impressive.

Silent letters in domain names

I've been using wrytradesman.com for a couple of years now as my primary domain. At the time I registered it, I thought it was cool to have a domain that was an anagram of your name. Pretty soon though, I discovered the pain of having silent letters in your domain name. Every time I told someone what my website or email address was, I had to spell it for them.Recently, I registered martyandrews.net, and I'm in the process of changing across to it as my primary domain. My blog has moved across, as well as my email address. The old domain and email address will continue to work for a while. My old rss feed is now pointing to the new blog location as well. If you've got any links though, please move them across. Mum - that probably only means you...

Wednesday, May 10, 2006

Would you trust this man?

This is my best mate Josh. Yep - thats a nail gun in one hand and a beer in another. I'd trust him with my life. In fact, given that he's drinking beer whilst pointing a nail gun in my general direction, I probably am. This pic got taken along with a bunch of others whilst building a deck at my place. Josh was so pleased to get his picture on the internet that I thought I'd give him his very own blog entry. Thanks for your help mate!

Tuesday, May 2, 2006

First

New blog setup. First post.

Wednesday, March 22, 2006

Do you want to work for Thoughtworks?

Thoughtworks is currently going through a big recruitment drive in Australia (and indeed worldwide) at the moment. We're turning away work because we don't have enough staff. One of the things we're trying to do to spread the message is share some experiences through some staff blogs. You might see a few around from various people describing what they do and don't like about working for the company. Here's my contribution.

First of all, there's a few facts that I can reel off without needing to give my spin on it. These are all true for Australian employees, but mileage may vary slightly in other countries.

  • Laptops are supplied. All staff are given a laptop to be able to do there work on. We're consultants after all, so we need to be mobile.
  • Mobile phones are paid for. That consultant thing again. We need to be contactable and mobile.
  • Home broadband internet access is paid for. Most of our staff like to keep up with the latest and greatest things happening in the world of technology. The company benefits greatly from that.
  • Everyone gets a variable pay bonus of at least 5% (subject to profit). This is paid in quarterly instalments. I've been with the company 3 years now, and we've hit the profit targets at least 50% of the time. Its nice to share in those profits.
  • Internal conferences run every 6 months.. This is run over a weekend, and rotated between Queensland, NSW and Victoria. All Australian employees come. Partners and families are invited. Saturday is run exactly like a software conference. Sunday is set aside purely for fun.
  • Annual training budget of $2k+ is provided. Time is provided too. Go to conferences, training courses etc. Budget for books is supplied in addition to this.
  • Referal bonuses of $3k are paid.. Join us and refer someone else. If we hire them, we'll pay you $3k.
  • Additional leave for long term employees. Been working for the company for 3 years? You get 23 days leave rather than 20. Four years? Take 24 days off. Maxes out at 25.

That's not an exhaustive list. Its just a few things that spring to mind.

I joined Thoughtworks for two reasons. Firstly, the people. Thoughtworks has a gruelling interview process, but the result is that our staff are very high quality. We don't hire contractors either. That means you can be confident that anyone representing Thoughtworks as gone through the same tough interview process. Secondly, the agile philosophy. Thoughtworks is probably the worlds largest systems integrator with agile processes at its core. Obviously, Martin Fowler is one of the public advocates in the agile community, but there's hundreds more agile savvy staff working for Thoughtworks.

Since I've joined Thoughtworks, I've been pleasantly surprised by the internal culture. Communication is actively encouraged at, and across, every level in the company. The CEO probably knows 500+ staff on a first name basis. I've had many chats with him ranging from geek techno talks to philosophies about running the company. The same is true for every other manager between he and I, and other staff throughout the organisation.

Its not all rosy though. The most oft complained about feature of working for Thoughtworks is the travel policy. The downside of not hiring contractors (and therefore maintaining the high quality of staff) is that we need to fill projects with internal staff. When you join, you get told "we expect you to be able to travel if we need you". I personally joined the Melbourne office, and in under a month was sent to a project in Sydney. I was there for 15 months. Thoughtworks did do everything they could to make that comfortable, so we found local accomodation and my wife moved up with me for the year. The other major issue is one that is true of most consulting companies. Sometimes the work isn't what you want. The technology might not be what you're interested in. The process might be mandated by the client and not agile at all. Hopefully though, that project won't last forever and you'll move onto something better soon. Still, some people aren't suited to that.

That was a whole lot longer than I though it was going to be. The summary is: Thoughtworks is very cool. We're up front about the downsides of working for us. If you want to work for us too, send me an email or check out our website.