Friday, February 19, 2010

Git gotchas: batch deletes and single reverts.

Git is great and most of the time easy to use but there are some scenarios that I'm finding counter-intuitive.

Staging a group of deletes

if you have a load of files in a repository you want to delete (with some you don't wish to). It can seem a pain in the backside to delete them individually with the
git rm
Fileglobs may not be suitable and the '. -r' flags may delete more than you want.

The easiest way to deal with this is to delete the files from your local copy and call:
git add -update
or
git add -u
This flag does the following:
Update only files that git already knows about, staging modified content for commit and marking deleted files for removal. This is similar to what "git commit -a" does in preparation for making a commit, except that the update is limited to paths specified on the command line. If no paths are specified, all tracked files in the current directory and its subdirectories are updated.

Reverting or resetting an individual file

If you come from the SVN world to restore a file to its original state you would revert it. git revert does not do that. Perhaps you want to reset it? git reset does not do that either.
The command you need to use is
git checkout --filename
This checks out the original file from the repository again.

So remember to delete you add and to revert you checkout.
Intuitive my arse...

Monday, February 15, 2010

Micro Retrospectives for interruptions.

Internal interruptions for me come thick and fast. There are a few ways I deal with them, that help me.
  • Turn off email client,
  • Shutdown web browser.
  • Close all unecessary windows on my desktop down.
But for me they are still inevitable. I'll feel hungry or my mind will wander. Or I'll hear a conversation I want to join in.

When I have have to abandon a pomodoro I conduct a mini-retrospective.
  • Why did I abandon the pomodoro?
  • What can I do to prevent this happening again?
So if you get distracted by email. Turn it off. If you are interested in a conversation put headphones on.
If you ended up surfing the web, shut down your browser.

Thursday, February 11, 2010

Developer recruitment is broken.

When looking for a new job in software there seems to be little choice other than to go through a recruitment agent these days. You may get lucky and someone may approach you or you may find a company you want to work for and they may have an opening but most of the time it seems you are stuck with using these agents.

The Status Quo

Currently the finding a new job lifecycle:
  1. Want new job
  2. Go to your favourite job web site
  3. Add in relevant keywords Click go.
  4. Find several jobs that you may be interested in
  5. Discount ones that you have applied for before.
  6. De-duplicate the ones from the same recruiter that are written slightly differently.
  7. De-duplicate the ones from different recruiters that are for the same role.
  8. Chose one for job with highest salary.
  9. Speak with recruiter who inevitably says that that position is filled. 
  10. Recruiter will try and fit you into any other job that he can possibly can. Enticing you with promises of working with 'SilverLight MVC' or that the company is 'recession proof'. Recruiter will more often than not refuse to give you name of company.
  11. You will pick the most awesome sounding role.
  12. Either your cv will get rejected and you won't hear anything from the recruiter. Start again. Or..
  13. Goto interview. Job is not what you want. They love you though (or are clutching at straws)
  14. Tell recruiter thanks but no thanks. Recruiter uses hard-sales techniques and threats of violence.
  15. Begin to run out of money/will to live.
  16. Accept role.
  17. Start job and work for n months.
  18. become unhappy at work. Start again

What is wrong with that?

There is a huge signal to noise ratio of phantom jobs. You waste time and effort applying so that recruiters can harvest your details. Recruitment agents have a vested interest in keep the name of the company you've applied to work for, from you. So how do you know what you are applying for? There seems to be one common factor.

The Recruitment Agent

I am confident I could have this role filled within 2 weeks for you (From sending the CV’s, interviews taking place to offer being made) -quote from recruitment consultant
Lets look at the purpose of a recruitment agent. A recruiter sits between candidate and employer and will sort the wheat from the chaff. He/She will use their resources to find the right people for the right job. Brilliant but with market forces/greed/targets coming into play something has gone wrong. Most recruiters are target driven they get paid to place developers in roles. Consequently when there are no right people for the job the recruiter goes unpaid. So what do they do? They select the almost right people for interview. When they run out, they select the wrong people. A recruiter must produce candidates to be seen to be effective. This means that the larger the candidate base the better. If a recruiter has N candidates and N is large how can they know all their candidates? They can't. So they rely on playing cv bingo.
  • Employer says he needs asp client has asp.net (Bingo!). 
  • Employer wants JavaScript candidate has Java (Bingo!).
  • Client wants experience, candidate has 5 years Silverlight (Bingo!)
The recruiter doesn't get paid more for knowing the industry better, they get paid more for placing more people in more roles. In fact they get paid more for placing the nearly right people in more jobs that aren't quite right more often. Their ideal candidate is a brilliant interviewer who likes to move on every couple years and has mastered the art of bullshitting in acronyms. This gives the impression to the company that they are doing a great job of finding people in a difficult market. A candidate who is placed 3 times in 5 years is more of an asset from a recruitment point of view than a great developer who stays in a role for 5 years. So even if a recruiter feels that the candidate is not going to stay in the job long there is no financial motivation in dissuading a candidate, the motivation is placing the client.

Changing the model

As a prospective candidate I want a way to find out where the 'good' dev teams are in my area. I want to be able to say 'Hi, I'm interested in working for you.'
As an employer I want to say 'Hi, we do some great stuff and you should come work for us.' The current system does not support that. What can be done? Here are some alternatives:

Remove the middle man

Why do we need these agents in the first place? They create a closed marketplace. Candidates should just apply on spec to companies and tech companies should do a much better job of promoting themselves.

Candidates pay the agent

If the candidate paid the agent to find a job say with a small amount upfront and a satisfaction payment 6 months later. Perhaps the recruiter would take more care that the candidate was a better fit.

Appraise recruiter performance on candidate performance

The model is obviously broken. Why are we paying recruiters just to place. We should be rewarding them to screen candidates too. I'm mean this is why they are here in the first place, isn't it? Employers should be employing these people with a service charge. So you want to recruit someone but don;t want to sift through 1000s of candidates? Pay someone for that, don't pay someone to place as quickly as possible.

Monday, February 01, 2010

DDD8 Round up


I've just arrived back from the DeveloperDeveloperDeveloper 2010 aka DDD8 Conference in Reading and had fantastic time there. The conference was situated on the Microsoft campus but was organised by the .net development community for the development community. There were no major vendors (including Microsoft) shoving their products down you throat and the events chosen were voted in by the public.

Registration

Registration was opened a couple of weeks before the event and the 300 and something places were snapped up in an amazing 12 minutes! This must be frustrating for the many developers who wanted to attend but were not quick enough to register. There seemed to be issues with the emailing system which left some confusion with delegates not knowing they were registered or not. Those people on the waiting list had to wait but many of those on the list eventually got in (I spoke to someone who told me he was over 150 places away). It seemed a little unfair that early birds got all the ticket and I hope the team will introduce some sort of ballot system next time.

The Venue

The sessions were held within 4 rooms Chicago 1 and 2 were separated by thin divider, Memphis upstairs and Everest in another building. All rooms were of a good size and even when sat at the back I was able to enjoy each of the sessions. The main issues I found were that Memphis was a sweltering and stuffy room and that sometimes the sessions in Chicago 1 were so loud they would distract the Chicago 2 talk.
As the venue was in the middle of bloody nowhere we had to set off at 4:30 in the morning! (Note: the centre of the earth is in Manchester and therefore all events should be within a 1 hour drive from there)

The Sessions

Unfortunately I couldn't see everything (I've not been able to master replication - yet) so I can't comment on all the talks but talking to other delegates I got the impression that most of them were pitched at an introductory level. I realise that the community voted the events in but there seemed to be nothing that covered a subject in depth. I mainly went down the testing route as I am looking at that side for my msc dissertation so missed a couple of others I really wanted to go to. I'll go through the ones I attended.

Mark Needham - Mixing functional and object oriented approaches to programming in C#


Mark Needham's talk was on his experiences using functional aspects of c# (LINQ) as his approaches to master it. He talked about the strength's of functional programming and the strengths of OO and how they should work together to create readable and maintainable code. He then went through the basic LINQ methods and drew parallels with the Functional Programming world. (Map = Select, Filter = Where, Reduce = Sum) and talked about taking things one step at a time. We got then into some code examples from the wild which were interesting to listen too.
  • DRY and LINQ
  • Extract method and LINQ
  • Functions into Maps
  • Patterns as functional language.
This was a great talk. Mark is obviously a great researcher and it was a fantastic run through. A promising start to the day. He has put his slides online.

Andrea Magnorsky - Lessons learned on Unit Testing


Andrea's talk was an all energy affair on unit testing, heavily influenced by Roy Osherove's book The Art of Unit Testing. Andrea's style was engaging as she took us through test naming, mocking, stubs, fakes, dependencies.  Tests should be trustworthy maintainable and readable and being careful is the key.
It was a good run through and one of the sessions I enjoyed the most. If there was any criticism to give I think Andrea got her timing a little wrong (she skipped a few slides) and that 'dupplication' has only one p. :) She has now blogged with links to her code and thoughts.

Andy Gibson - Web Application Testing With Selenium


Andy's talk was a walk around the UI Testing framework Selenium up in the stuffy Memphis room.
The aim was to introduce the novice into Selenium and Andy's talk tried to cover a lot. (perhaps too much). It seemed from his talk that the framework is huge and the he seemed to position himself as an expert in all. It may have been better if he had done the talk in the 'this is how I use Selenium' style rather than the 'this is you to use Selenium'. Still it was a great to see Selenium in action.

A special mention goes to Craig Murphy who read my tweet asking for water and delivered some to me mid-talk :).

Kris Athi -Microsoft Surface


By this stage I was well and truly frazzled so I decided to go and see something pretty to recharge the braincells. Surface looked the the perfect talk. I'd just sit there dribbling and look at all the pretty graphics. Sadly I was disappointed. Kris's talk was on the Surface SDK but he didn't even have a surface. C'mon guys there is a Surface room apparently on the MS Campus so I was sorely disappointed that we didn't see one in the flesh. Kris went through the SDK talked a little about the design issues and showed us some code. The surface looked good but I expected to be wowed by an awesome demo app.

Ben Hall - Testing C# and ASP.Net applications using Ruby


The last session block I could have seen any number of talks but after much deliberation I ended up in Ben's. Ben Hall's talk began unconventionally with Barry Dorran's hijacking the speaker system to wish Ben a happy birthday. After that Ben started to talk about the benefits of Ruby's expressiveness in tests and using BDD style specs to make intent clearer. He talked about all the different levels of testing and where things. This talk really complimented the other talks I went to that day and it was great to see a DSL like WebRat firing Selenium. A very enjoyable talk. Ben's slides are available on his blog.

The Rest

It was a brilliant day. I met a million people who I've spoken with on twitter and missed a million people who were there and I didn't meet. I just want to say a big THANK YOU to the organisers if everyone got as much out the day as I did then you should be proud of yourselves. Can't wait for the next one!