Not so remote

Fostering a team feeling when everyone is remote can be extremely difficult. It’s easy to feel like you are working in a total silo, and can be made worse if everyone is spread across distant timezones. Being able to function as a team is a key component to project success. Feeling isolated and alone when problems come up can make work frustrating and stressful at times. Here are a few ways to try and overcome that:

  • Try and arrange core hours where the whole team is available and together on Skype/HipChat/Slack.
  • A weekly call with everyone to update on work, issues and client feedback.
  • A daily call between project managers and members of the team to chat about current progress and the project as a whole.
  • Code sharing sessions. Show code to other members on the team and explain what features are and how you’ve gone about implementing them.

Move fast and break things

I was thinking about the “Move fast and break things” approach to projects this morning. A few projects I’m currently working have been moving at a snails pace and the longer projects go on and the bigger they get before being launched fills me a certain kind of dread. I feel really comfortable launching with a few half baked features rather than everything in one big bang. When there are so many moving parts in a launch, no matter how much you test, real users are going to find problems, and trying to keep on top of them can drive you insane. It’s the difference between trying to steer a small sail boat vs a cruise liner. If you start small you can probably respond quickly to change and get to where you want to go than if you launch big and try and change course later on.

Now I don’t condone breaking things, but I do agree with the idea of moving fast and staying agile. So just “Move fast”, that’s all you have to do. Accept that things will break and things will need improving.

“A good plan violently executed now is better than a perfect plan executed next week.” – George S. Patton

Generate a random email address in TextExpander

Made this short snippet to help generate random email addresses using TextExpander. Set the snippet content type to “Shell Script” and paste in the following. You’ll need Ruby installed which comes with most modern versions of OSX.

The snippet will generate a different address every minute and copy it to your local clipboard incase you want to paste it in again. It also uses YOPMail which you can check for emails too.

Hackintosh phantom wake from sleep

For some reason since updating Mountain Lion on my hackintosh my computer would mysteriously wake up in the middle of the night. As sleeping and waking had never been 100% I figured that it was just down to a quirk of having a hackintosh. But I did some digging and after some searching and log investigation I found the following entries:

Which lead me to believe it was a config issue, and a quick look through the preferences un-earthed the following:

Energy Preferences

Disabling “Wake for ethernet internet access” has solved my problems and there haven’t been any phantom wake from sleeps since.

It’s my data

Recently I’ve been working on migrating an existing e-commerce site from InstanteStore to Spree and have been having a nightmare of a time trying to get the client’s data out so that I can start the job of importing it all. The trouble is a lot of the information is not exportable, and whatever data is available is only half of what you would expect. It’s starting to make me angry because as far as I’m concerned that data belongs to my client, and to add insult to injury, to get access to certain parts of the data they want to charge extra money to “build an interface” to it.

I can understand on free to use sites like Facebook/Instagram/Tumblr/Whatever-Startup that the price of usage might be my data and that I might not be able to take it and go elsewhere with it, but when you’re paying for a service I expect to have full ownership and access to my information.

Adding a custom Spree payment Gateway outside a Rails Engine

Adding a new Payment Gateway to Spree through a Rails Engine is pretty straight forward as you can hook in your new gateway after the initial payment gateway array has been created. This is how the spree_gateway gem does it:

If you want to do the same thing for your own project contained gateway it’s a little different. If you try to just directly edit the payment_methods array in an initializer it will get wiped out when the Spree core engine sets the initial bogus and simple methods. I got around the problem by hooking my gateway in using the after_initialize method. Here I’m hooking in after SpreeGateway:

Vim – Join lines that end with a ^M (DOS carriage return)

Editing a CSV file which split whenever there was a DOS carriage return (^M). Joining up the lines was as simple as using the command below. To get the ^M char you use CTRL+V CTRL+M (don’t let go of CTRL in-between).

Small teams and interruptions

It’s hard for non-programmers to understand just how bad interruptions are when it comes to being a productive coder. While most jobs suffer from the same problems of “getting back into the flow” after being interrupted, programming is especially difficult as normally programmers are trying to hold a number of structures in their head at any one time so as to solve whatever problem it is that they are working on.

In most small companies, the development team is might only consist of three or four people and in such a small team with a large backlog to deliver, it’s not normally the teams size that is the main factor in being able to deliver large amounts of work, but all the small interruptions that happen during daily business. Asking a developer that is sitting close by about when a feature will be ready or whether something can be fixed/changed is all too tempting and easy to do. Why IM or email when you can just shout across the room. It only takes a few 10-20 second interruptions to change a productive three to fours hours into just maybe one or two.

Once a company grows these sorts of problems can be smoothed out by having someone act as a barrier to the developers, shielding them from minor questions/requests and letting them continue with their work until free to discuss them. Small companies don’t have the luxury of assigning someone that role so need to find other means to minimising that contact. It’s important that someone sets some ground rules. It could be as simple as there is a set period of time every day that programmers should not be disturbed or communication should be limited to IM and email if possible. Just removing the constant stream of “Is X ready yet?”, “Did you get a chance to look at Y?” or “Would it be possible to do Z?” would mean a huge productivity boost for your programmers and overall deliverables for your company.

Linux years

Display the full year of a file on Linux with:

Ship It!

“Any fool with a text editor can write code, but only an amazing few can code and make good choices around trade-offs. That’s the most valuable skill a developer can possess: the ability to make hard decisions.” – Ship It!

Shipping is hard. Perhaps even the hardest part when it comes to writing software. Opening yourself to real criticism is the most frightening and liberating thing you can do.

Extra vim real estate

Get a little bit more room in vim by hiding the righthand toolbar. Set this in your .gvimrc

" Don't show right scrollbar
set guioptions-=r

Rspec + Devise user and current_user different

If you follow the Devise Wiki on setting up Rspec and Devise you may end up wanting to set an expecatation on the currently signed in user.

Don’t fall into the trap of setting it on the original user model as your specs will still fail:

user.should_receive(:blah).once # Won't work

Rather, you should set it on the controller’s current_user:

subject.current_user.should_receive(:blah).once # Will work!

OSX Copy/Paste in tmux

One of the big things that took me a while to get right in tmux was copy/pasting. The gripes of trying to get it to work were enough to nearly make me forget using it all together.

Here’s what you need to know.

Install reattach-to-user-namespace

brew install reattach-to-user-namespace

and then in your .tmux.conf

set-option -g default-command "reattach-to-user-namespace -l zsh"

Assign a binding to copy the current buffer

In your .tmux.conf set a binding to copy the buffer

bind-key C-c run-shell "tmux save-buffer - | reattach-to-user-namespace pbcopy"

Now it actually took me ages to work out how to use this properly. Once you have created the buffer, either through selecting it with the mouse or by using PREFIX – [ and SPACE/ENTER, press PREFIX – C-c and it will be copied to your system clipboard.

Use the option key

If you hold down the option key while in the terminal, you can create a selection just as if you’re weren’t in tmux.

Switching to tmux

Not being one to jump on bandwagons, I just had to try tmux after hearing so many people talk about it. tmux is a terminal multiplexer allowing you to run a number of terminals within a single screen as well as allowing you to detach and reattach to the same session as you please.

So what? I can just run multiple tabs and get the same effect!

Yes and no. I had been running multiple tabs, with vim in one window, a console session in another and tailing output in another, but the real revelation with tmux came when I tried out the tmuxinator gem. tmuxinator allows you to easily manage tmux sessions. With a simple yaml file you can create and start a tmux session with your editor, console and logging all setup, laid out and ready to go. This is incredibly useful with you work across multiple projects as quite frequently I would find myself in tab hell when having to switch from one project to another. Once you get past having more than four or five tabs open it become increasingly difficult to know which is which. tmux sessions mean I can keep everything related to a single “context” within one terminal session.

Getting up and running wasn’t 100% smooth sailing. Brian P. Hogan’s tmux: Productive Mouse-Free Development was invaluable. Even with less than a full days use, I’m pretty comfortable and have gotten over the initial slowdown that comes with switching to a new tool.

The only thing I miss is that I can no-longer use CMD-S for saving like in MacVim, but to be honest that’s a bad habit I need to break, as well as colour schemes aren’t quite as pretty in command line Vim compared to MacVim.

A few gotchas I encountered:

  • When using Vim and the Command-T plugin, up/down arrows wont work for selecting a file to open, you will have to use CTRL-J/K to move up and down and CTRL-C to close the pane.
  • When adding reattach-to-user-namespace to enable copy/paste to your tmux.conf, you must kill your tmux session for the change to take place, it’s not enough to just quit and restart tmux.
  • If you’re using rvm, opening a new pane/window into a directory with an .rvmrc wont properly load in the selected ruby. If you’re on bash then adding “cmd .” to your .bashrc should work (I haven’t tried it), but for me I had to add “source .rvmrc” to my .zshrc for it load in properly.

A day with Ubuntu Oneiric Ocelot (11.10)

Omgubuntu

I just started a short term contract doing some RoR and was given a PC to work with. While developing on RoR on Windows is possible, it’s not what I’m used to or best at. As there were no Macs I could use, I thought I would give Linux a go. Seeing as I use Vim as my editor of choice, switching over should have been relatively painless.

I’ll just get to the point, that for many years now I’ve always said that I don’t think Linux as a desktop OS really cuts it compared to Windows or OSX, and having used it for a day and a half I still think that’s true. Off the bat the install seemed plagued with things I just wouldn’t expect from a “modern” OS.

The first major blunder came during the installation process. I booted off the CD and was told that a hard drive with Windows had been detected and would I like to install Ubuntu along side it. I chose yes and was shown a screen with a dropdown with HDs and a slider to allow you to resize the partition of the drive. I split it in half and set it going. Then only when half way through did I actually look at what drive had been selected by default, it had chosen an external drive as the one to get to work on. I totally accept that I should have checked it first, but I don’t understand why I was asked if I wanted to install it beside Windows for it to then choose a drive that Windows wasn’t even on as the one to set as the selected on.

The pain didn’t end there. Once finally up and running, my dual monitor setup was being mirrored which was easily remedied in the display settings control panel, but then it was apparent hardware acceleration wasn’t working. You couldn’t move windows without them struggling to keep up with the pointer. Trying to enable the proprietary ATI drivers didn’t work. Do I chose the normal or the post-release drivers offered? The normal drivers installed, but the displays would only mirror each other and the post-release ones wouldn’t even install. So I took a chance with some commands I found on a wiki which involved stripping away all the default ATI stuff and compiling my own drivers from scratch, which eventually got it running with hardware acceleration and with both screens working independently. I had no idea what the collection of commands I had run did to the system, which left me with the un-nerving feeling that the system was sort of hanging together by a thread. I was too scared to restart incase it came back with no display at all.

A few people advised me to ditch the Unity manager in favour of Gnome Shell, but that just made life even worse. I couldn’t even move windows without them crawling across the screen. It just felt like a total disaster and I had absolutely no faith in the install at all.

I remember in 1998 hearing about Linux Mandrake and traveling all the way to some dodgy warehouse in North London to buy a copy. My experience back then was actually a good one. Everything worked as it should of and using it day to day was fine. I don’t remember having any display or driver problems. It was only gaming that made me return to Windows back then. What has actually been achieved in 14 years? Some transparent UI elements? To me Linux still seems plagued by constant lack of driver support. Perhaps someone can explain even why just browsing the net on Linux looks bad? Why are no good fonts distributed? If you know exactly what you’re doing then you can make do. Plenty get by, perhaps I just don’t have the patience for it.

I just want something that works, and after some begging I convinced the place I’m at to let me use a Mac. Setting up took a fraction of the time, admittedly I’m used to it so it’ll be quicker to get up and running, but I didn’t have to worry about any drivers, display issues or whether or not my machine would survive a reboot.

Accessing values in your plist file from your iPhone/iPad app

Recently I’ve been coding some iPhone and iPad apps with multiple targets, all sharing the same codebase. Previously I had been using Preprocessor Macros to get the job done, but that soon turns messy and hard to maintain. I’ve since moved to just storing target specific values in each apps related plist file. Retrieving a value is as simple as:

nginx SSL PEM_read_bio:bad end line

Installing the intermediate certificates on our server gave me the following error while trying to start up nginx again:

The end of the file looked fine, but the problem was half way through it. Somehow the concatenation had joined two lines together:

This just needed a line break to fix:

Ubuntu: Curl development headers with SSL support

Just been trying to install Passenger on a new Ubuntu EC2 instance and passenger is giving me the error:

Took some digging around but turns out I was just missing the libcurl4-openssl-dev package:

SSH Tunnels with Postgres & pgAdmin

One of my previous posts showed how to use an SSH Tunnel to connect to a remote MySQL server. Since moving to Postgres I’ve been wanting to do the same thing with pgAdmin, which sadly isn’t as simple. There’s no way of creating the tunnel automatically in the app so we need to resort to the terminal.

The first step is as before, we create the SSH tunnel to our server:

Here I’m mapping the remote Postgres post 5432 to the local post 5555. Now this is where things start to differ. I had been trying to connect as the local ‘postgres’ user but continually received authentication errors. You need to create a user on the server that relates to your machine’s local user. So if your local username is “foo” you need to create a user in Postgres with the same name. First log into the psql console:

Then issue the commands:

Then in pgAdmin, simply connect with user foo and you’re good to go.

UPDATE: I’ve since discovered this is related to IDENT authentication. Switching to PASSWORD authentication allows you to use any username/password combination.

Tagging in Notational Velocity

Recently I switched from Evernote to Notational Velocity. I was so sick of the Evernote iPhone app and saw that Notational Velocity synced with Simplenote. Since trying them both out I haven’t looked back. Now, Notational Velocity supports tagging but Simplenote doesn’t, and as I like to search by tag, this was a bit of a problem. So taking the Twitter approach, I simply hashtag my notes, which makes them incredibly easy to find in both Notational Velocity and Simplenote. I don’t put the hashtag in the name of the note but just as the first line. I found that putting the tag in the name looked a bit untidy in SimpleNote. A nice side effect is that in Simplenote, the tags appear as the preview line. Problem solved. #notationalvelocity #simplenote

Missing menubar icons in OSX 10.6.2

A whole load of menubar icons disappeared after installing 10.6.2. Seems it’s a problem related to me doing a small hack in the past to disable Spotlight. Steven Seeger’s fix restored the menubar to it’s full glory.

Essential reading for developers

I’ve been meaning to write up a list of what books I think every developer, aspiring or seasoned should read. So let’s cut to the chase, and in no particular order:

Code Complete
If there was ever a bible for coding, this is it. It’s even Bible sized. A nice size to chuck at those annoying developers who just have no clue.

Clean Code
I would consider this book the “Ten Commandments” of coding and compliments Code Complete very very very well. If Code Complete teaches you how to be a Christian, then Clean Code teaches you how to be Jesus.

Refactoring to Patterns
What I love about this book is that it you learn the fundamentals of refactoring at the same time as design patterns. The GoF Design Patterns book is quite heavy going. The examples aren’t well laid out and can be confusing especially if you’re not familiar with SmallTalk The examples in refactoring to patterns all take pretty familiar real world bits of code and walk you through the process of refactoring them into sensible patterns.

Three books? Is that it? Yup. In my mind those are the only three books that are essential reading, no matter what form of development you do. If you even remotely care about coding, then go to Amazon now and buy these books. Read them and take a good long hard look at your own code. If on the other hand you feel “You can’t be bothered” to read, learn and improve, then why are you doing something you don’t love or care about? You’re in the wrong industry if you’re not prepared to take time, all the time, to learn new things. Once you’ve read those, then you’re ready to move onto more specialised books. Here are some of my other favourite development books from over the years:

The Productive Programmer
The Art of Agile Development
Practices of an Agile Developer
Joel on Software
Unix Power Tools
Programming Perl
Essential Java
Well Grounded Rubyist
Design Patterns in Ruby
CSS Mastery
Prioritizing Web Usability

Don’t use PHPMyAdmin. SSH tunnel instead.

If you’re still using phpMyAdmin to admin your remote database, then you’re doing it wrong. Don’t expose your database to the outside world like this, instead use a SSH tunnel. In your terminal simply create the tunnel:

Then in your MySQL interface of choice just connect to 127.0.0.1 port 8888 and voila, you’ll be connected to your remote database.

Apps like Querious even let you setup the connection internally without having to tunnel through in Terminal.

Law of Demeter and the delegate method

The Law of Demeter, or Principle of Least Knowledge is a fairly simple design pattern, which, simply put means that an object should only talk to it’s immediate “friends”

The law states that a method M of and object O may only invoke the methods of the following kind:

1. a method on O itself
2. any parameters passed to M
3. any objects instantiated within M
4. any direct components of O

The classic example coined by David Bock used a Paperboy (one object) delivering a paper, then extracting money from a Customer’s (another object) Wallet (and another):

In the “real world” the Paperboy would ask the customer for the money who would then take it out for them, rather then the Paperboy reaching into the customer’s back pocket and getting it for themself.

Really we want something as follows:

This may all seem trivial and a waste of time, but what happens if some Customers want to pay by cheque? Those decisions should have an impact on the Paperboy, otherwise we end up with:

Where as it makes more sense for the change to be contained within the Customer:

So what does this have to do with Rails and the delegate method? The delegate method adds a quick and simple way of following the Law of Demeter without having to do very much at all.

This setup means to get an Order’s payment we would have to say:

But if we simply change our objects as such:

Now all we have to say is:

So at any time, the details of how a payment  is to be decided can be contained with the Customer. This is of course a simplistic example, but hopefully explains how you chould be using this handy feature.

From TextMate to Vim

I’ve finally done it. After months and months of on-off usage of Vim, I’m now finally using it 100% of the time. It’s been a long and hard road getting here, but let me tell you, it’s been well worth it. I now feel like I absolutely fly through my code. I’ve read many a time, people saying that watching someone using Vim is like watching something mystical, and I can see why. Looking at how I edit code in Vim now, makes me feel clumsy when I think back to using other editors like TextMate. Don’t get me wrong, TextMate is a wonderful editor, but there is just something about the speed and finesse of editing in Vim which I have just fallen in love with.

I wrote about trying MacVim before and how I just felt it lacked the spit and polish that TextMate does. But now, I can’t remember why I originally felt that way. There’s a simple elegance to the Vim, yet with this awesome power available to you. Switching wasn’t easy in the slightest. I would load Vim up for an hour, tinker around, get frustrated and go back to Textmate. Then a month later I’d try again, learn a new command, last two hours and go back to TextMate. A few more months and hours turned into a full day, then the full day turned into a couple of days, and then I never looked back.

One of the keys to hitting the ground running is having a good config. I originally used jferris‘s vimfiles but moved to scrooloose’s files not long ago. It practically has every plugin you could ever need to make life in Vim sublime.

Some other handy references I’ve used along the way have been vimtutor, the Vim Recipies Cookbook, the Vim Tips Wiki. To aid my own memory of useful commands I’ve even started my own Vim tumblr.

Skype on OSX

There’s just something about the way Skype looks on OSX that really bugs me. I can’t tell what it is, but the UI just feels really intrusive. Then again, it’s probably not supposed to be kept visible like I do with my contact list in Adium, which has a brilliant transparent and borderless option.

Vlad 2.0 Not Finding Tasks in deploy.rb

When I restalled all my gems on Snow Leopard, vlad refused to find any of the tasks I had defined in my deploy.rb. I thought this was a SL issue but turned out a week before it’s release Vlad had been updated to version 2 which used a new plugin system. Looking for vlad rake tasks returned an error:

To solve the problem just required an install of the new vlad-git gem.

Now all my tasks were appearing properly. Vlad 2 always brought around a few changes in it’s deploy.rb and use. Here is my deploy.rb for reference:

Now invoking Vlad for my staging environment works as such:

The Code Shall Set You Free

I was recently asked why I don’t comment my code. It’s a fair enough question. There was a time when commenting your code was the done thing. I was once a great believer in commenting code as much as possible and would bash those that didn’t, but now I vary rarely comment my code at all. In my current project of over 1,500 LOC, there are only a handful of comments. Many people will argue this is irresponsible. Well how is anyone supposed to pick up and understand my code, if it’s not commented?

The code should comment itself.

That just sounds silly. It’s like saying a car should drive itself. But it can be done. A lot of this change of heart about comments has come from my commitment to becoming a better developer and spending countless hours reading about the practice of great development, which is something I’ve written about in the past. I’m a big believer that most of the time if you need to comment a piece of code, then it’s either bad code or too complicated. Of course that’s not true 100% of the time, but for the other 99% it really is. There are cases where things need to be explained and especially warned of, but a lot of the time, commenting is just an easy escape from having to do “proper” coding. It took me years and years to get a basic understanding of proper OO and I’ve still got a long way to go to reaching Journeyman levels of understanding, but I would always create large objects with huge and complex methods, when really what I needed were more concise classes with more responsibility for what they should be able to do. It’s not object orientated when you’re focus is on the method and not the class.

A simple example of commented code:

Most comments can be done away with. If we split out functionality into more concise bits, then just reading the code should explain what’s happening better:

This isn’t a great example as once again the validation of whether the food can/will be eaten should move into it’s own method or class ever. If we’re follow Uncle Bob’s SOLID principles, the above examples breaks the OCP (Open Closed Principle) where entities should be open to extension and closed to modification. If more validation rules were needed, then that would require the code to be modified.

Gist

Great find by andhapp.

Getting Productive

I first picked up the Productive Programmer a few months back and after flicking through it I initially thought a lot of it wasn’t relevant and didn’t bother reading it. As I had been playing around with Vim (again!) and thinking about the whole idea of being more productive, I felt compelled to pick it up once more and actually read it. After learning a few new OSX tricks within the first few pages, I was hooked. Admittedly I skipped over any Microsoft related content, but overall the book is full of real productivity gems, and ever since I’ve been on a quest to increase my day to day effectiveness when it comes to using my computer.

My first port of call was sitting down and learning to use LaunchBar properly. I still have a long way to go, but more and more I’m using it to find and open files, as well as small things like quickly playing music and using the extremely handy clipboard history. I’ve stripped my dock of all apps except those that are running. The reason being that there is no need for me to use it as a launcher when I can use LaunchBar to start any app I need, without even having to use the mouse. I’d totally hide it from my screen, but somehow that feels “anti-Mac”.

Secondly I customised my terminal to be more “friendly” and learned some advanced command line techniques courtesy of the Peepcode screencast on the subject. Now I have a load of aliases as well as custom functions which culminate commands I frequently run in conjunction with each other.

I also spent some time learning more general shortcuts as well as trying out some other apps to help in my quest for computing Zen. One is Desktopple, which hides apps which have been in-active for a certain period of time and another is TextExpander, which allows you to create small snippet shortcuts, for example, typing r@ now automatically expands to become richard[at]ur-ban.com. Very nifty.

To try and become more effective overall in my life I’m really trying to knuckle down and keep a track of everything I need to do using Things. As with any todo app, you get out, what you put in. If you don’t really make an effort to use it and dump stuff into it, you’ll never really get anything out and never get anything done. I would have prefered to continue using The Hit List as I have a registration for it, but it would seem the iPhone app is still nowhere in sight. So for now, Things is what it’s going to have to be. I’m also now making more use of Evernote. I regularly email notes to myself and had totally overlooked the fact that I could just email them straight to my Evernote account. So now, any thoughts or ideas I have appear straight in my account thanks to the power of Email. I’ve also installed The Habit Factor on my iPhone to keep a track of my goals. It’s a simple app which lets you set a number of goals and habits, which you can then tick off each day, hopefully leading you to form good habits over time.

If I was Microsoft

Microsoft recently started their new ad campaign where seemingly normal people try to buy a new computer. They’re given a budget and if they find one that fills their requirements, they can keep it.

The first advert follows Lauren with a budget of $1000. She wants a laptop that’s fast, has a comfortable keyboard and a 17” screen. On her quest for a laptop she visits the Apple store and comes out saying they are over her budget and that she’s just not cool enough to be a Mac person. She has no trouble finding a suitable laptop in regular electronics store and ends up purchasing a HP Pavilion. The second advert follows Giampaolo with a slightly bigger budget of $1500. He wants a laptop that’s portable, has good battery life and power. Once again there is a poke at Apple. This time they are more about aesthetics rather then power and that he doesn’t want to be paying for a brand. And once again he ends up with a HP Pavilion (Oh, HP, that’ll be the brand you just paid for then).

My problem with the adverts isn’t the poke at Apple, but rather they are promoting a non-message. If I’m going out to buy a new computer and I don’t want a Mac or want a Mac but don’t want to save for it, I have no choice but to buy a PC. I can’t see them swaying the people who have made the choice to switch and have the money ready to buy a Mac. So who are these adverts aimed at? There’s no competition in the sub $1500-$2000 range, so is it even worth doing at all. Honda make ads to stand out amongst Toyota, Ford etc. They don’t make adverts in the hope that they’ll stop people that are thinking of splashing out on an expensive sports car, and sway them to settle for a Civic instead. This and the previous ”I’m a PC” series of adverts just end up legitimising Apple’s presence. Apple is a tiny dog biting at the heels of a giant, yet Microsoft feel like they need to gear their entire consumer TV advertising campaign to take them on. The campaign may well be just insurance for Microsoft. How many heads would roll if they decided to ignore Apple completely, or not even bother advertising to consumers, and then their market share tanked. Perhaps it’s better to appear to do something, then to not do anything at all. On the other hand though, could all that money be better spent doing something else.

All of which leads me onto what I would do if I was Microsoft. Simply, I would advertise Windows 7 and IE8. I’d give people hope once again in Microsoft products (Hopefully the products would match the hype). But I’d ram it down people’s throats day and night. “Forget what you thought about Vista, Windows 7 is coming”. “Experience the web like you’ve never done before. IE8 has arrived”. That sort of stuff.

Perhaps that’s what I find so alluring about the “Apple way”. When you see them in use, you feel like you’re being taken to a time and place beyond the normal preconceptions of how technology works. Microsoft used to have that. Microsoft used to ask “Where do you want to go today?”, with the promise of taking you there, no matter how far fetched your dreams were. Now they just state “Your potential. Our passion.”, which leaves you with the sinking feeling that really over the years a massive void has grown between us and them.

Another New Facebook

I said it before and I’ll say it again. Don’t like the new Facebook? Tough shit. Suck it up.

So you want to be a developer?

I’m so glad that I’m not just getting started as a web developer these days. Facebook is the main example I give to people when talking to about this. It has set the standard for what and how people think a web app should behave. Move forward or backwards through photos and they are dynamically loaded without refreshing the page. Send someone a message and a modal box appears with autocomplete on the textboxes. You can browse the site, chat to friends and do all sorts of stuff without ever having to experience a page refresh. I even remember when they added AJAX to their photo albums. I mentally flipped as it made the site so much more usable. I showed it to someone going “Look! Look! There’s no page refresh.” while they just shrugged and went “I don’t see what you mean.”, D’oh… exactly! The sort of stuff no one even realises is happening. But I’m sure they’ll feel the difference if they use functionality on your site that’s similar to something Facebook does, but which requires a refresh where as Facebook doesn’t. Even I feel the pain of moving forward and backwards through photos on Flickr. After the third or fourth page refresh, I just give up.

When I got started, web stuff was so new and so simple that in hindsight it was amazing what you could get away with. You could just fly by the seat of your pants. I know I did. The first piece of web development I ever did was back in the mid nineties two days before my first interview. I wrote a Java servlet that simply took a single text parameter and queried a MySQL database using JDBC. I showed it at the interview and got a job as a web developer using Perl. I didn’t even know the Perl but still got the job. All I had to do, day-in, day-out was write HTML and scripts that responded to clicked links or submitted forms. Submit, refresh and display the result, job done, I can go home now. Creating a site wasn’t hard, almost anyone could do it and almost everyone was at the time. Life was simple and it was pretty much a level playing field. Now though, it is a totally different ball game. You’ll need good knowledge of at least a couple of languages, HTML, CSS (Yes we need it to work across all the major browsers), SQL, Javascript + a framework like jQuery + how to use AJAX.

There is just so much that you need to know that if you’re not doing this in your spare time, how are you supposed to ever compete with the kids nearly half your age who can already do this stuff with their eyes closed. Even me, who does this stuff every day as a job has to learn more and more if I even want a chance of staying relevant and employable. I love learning, so it doesn’t bother me. Programming still turns me on and it has to if you ever want to make a go of doing this for a living. Sometimes you can be in the fortunate position of working for a company that really loves this stuff, so you can learn and grow, but I suspect the majority of IT related jobs are done in companies where IT is a second thought to their overall business goal. Where managers prefer to say “no” to your ideas rather then say “ZOMG we could totally awesomely AJAX dis bitch up!!!11!”. And the learning doesn’t just stop at work related subjects. There’s a lot to be said about learning new languages and techniques totally unrelated to your work. Not only for the mental stimulus but also how they can teach you to approach a subject in a new way. I admit this is perhaps one area where I don’t spend enough time, but I’m trying. So go forth and learn. Be totally fucking awesome.

Safari 4

It’s been a day with Safari 4 and I’ve yet to find a reason to switch back to Firefox. With it’s new developer tools, my discovery of FoxMarks for Safari and the Delicious Library bookmarklet I’m pretty much where I was with Firefox. The only thing I am currently missing is adblocking. I’m not sure if PitHelmet currently supports Safari 4, but Glimmer Blocker looks really good. It’s interesting that it works on the network level rather then as a browser plugin.

The Smell of a New Mac

The new mac has arrived! I haven’t had a chance to really use it (that’ll all change next week) but wow is it a nice machine. I don’t need to gush over it as everyone knows how amazing these machines are. All I’ll say is my favourite feature so far is how cool all the available multi finger gestures are, not so cool is how obvious oil from your fingers appears on the black keyboard.

RSpec + Autotest + Growl + Doom Guy

I spent this morning playing around with autotest, but was getting really flaky results with the Growl notifications. I tried about four different autotest configs, but none of them seemed to consistently worked. I remembered that the Growl notifications at Thursday’s Coding Dojo worked pretty well, so after some digging around I found the config on their github. After a tiny tweaking I was even able to get it to work with Przemysław Kowalczyk’s Doom Guy. I’ve packaged it all up and put it on Github. Enjoy.

doomguy-growl-autotest

MBP

Oh yes.

Goodbye Grails

It finally came time to un-subscribe from all the Grails feeds I used to read. As I’ll no longer be doing any Grails it makes little sense to really keep up with what’s going on in the Grails world. Grails has a lot going for it, but even after over a year of doing it, it just never felt as smooth or dreamy as Rails always has. It managed to replicate some of the core that made Rails so wonderful to begin with and did a good job of it most of the time. Perhaps if I had more experience of the Spring and Hibernate core I could have got more out of the Framework, which is fine and that is on my head, but in the end it just got more and more frustrating as features available in Rails were just impossible at the time in Grails. I’m not saying that Grails is lacking, as at the end of the day, there’s nothing you can do in Rails that you can’t replicate in Grails.

In hindsight I was perhaps the wrong audience. Groovy/Grails is the perfect Java answer to Rails. I chose it to stay consistant with our other apps, so that everything ran on the same JVM and was all containted within the same application server. There were no constraints on the technologies that had to be used. Consistancy, perhaps, was the wrong reason to choose it. Maybe I should have chosen it if I had more knowledge of Spring and Hibernate. Maybe I should have chosen it if I had to to run in the same server and on the JVM. Who knows. I wish the Grails team all the best. Who knows, I may end up coming back to it one day. Stranger things have happened.

Java Security Stupidity

No matter how many times you click cancel, this dialog won’t go away. You’re left with no choice but to click run. Can someone explain the point? If I click cancel, don’t run the embeded Java application, simple, don’t spawn the dialog endlessly.

LittleSnapper

Normally when I come across something “beautiful” on the interwebs, I’d bookmark it in Delicious. The only problem is doing so isn’t entirely practical when looking for ideas or inspiration. Opening each site in a new tab and then browsing through them. No thanks. An alternative is to take screenshots of everything, but it’s just hassle keeping them organised and available somewhere. Problems be gone! LittleSnapper handles all your snapshots and makes it extremely easy to browse through past snapshots. It even knows what site each snapshot is from, so you can choose to visit if you wish to explore some more. It makes all your snapshots uniform and allows you to snap a whole page (even when it scrolls off the bottom), just a portion of a page and also the regular full screen and window variants. This is just another one example of an application that I wish existed on Windows.

IE6

Yes. Please fuck off and die.

Exodus to Emacs

Recently it would seem that everyone is jumping ship from Textmate and making a move to Emacs. Seeing as Peepcode just released their Emacs screencast, I thought I might as well have a look. I’ve used Emacs quite a bit as it’s my preferred *nix editor over Vim, but I’ve never bothered really learning any commands beyond Open/Save/Quit, which is surprising, as my first job as a Java developer was spent coding in Emacs. Looking back, I don’t know how I ever survived (Heck, I even remember not having syntax highlighting).

I’m not one for bandwagons, but, I’m very quick to move/try new technologies to see if they are better. It’s hard to ignore droves of developers saying they are moving to Emacs and to not wonder if it really has more to offer. On the surface, it’s not all that different to Textmate. At the end of the day they are both just text editors. Textmate, being Mac only, has more of a polished feel, but on the other hand becoming a master of Emacs would mean you could code away on nearly any platform, (then again, how much time do I really spend coding away from my main machine?). One thing that is funny though is that a lot of people making the move are installing commands that make Emacs more Textmate like, which seems to defeat the purpose of taking the time to actually learn Emacs.

I’m very 50/50 about the whole thing. People say you should stick to an editor and really master it and that’s what makes me so in-decisive about the whole subject of IDEs and editors. I never really take the time to get really deep enough into mastering them.

My head says Emacs but my heart says Textmate.

So much to learn

I could tell you how I still continually fight the demons that encourage me to rush instead of following a disciplined course. I could tell you about all the tests I don’t write. I could tell you about the constant allure of shortcuts and my imperfection at avoiding them. I could tell you how often I look at that green band on my wrist and shudder at how imperfectly I follow it’s urgings.

Robert Martin – Glory and success are not a destination, they are a point of origin.

Reading that even the masters feel the same way that I do about developing sometimes, must mean I’m on the right track?

TDD is Hard

TDD is hard, seriously hard. Perhaps that’s a bit of an overstatement, but for me, after years of “skill neglect”, it’s been a real struggle to pick up and get right.

The problem isn’t writing the tests, it’s writing code that’s testable. I’ve dabbled a bit with unit testing in the past but never really got the “unit” part of it. My tests would dive into a class that relied upon other classes and I would assert some value passed all the way through the call stack. In hindsight this is totally wrong (unless we’re talking functional testing) but at the time, my only concern was getting a passing test, which I was successfully achieving. It was testing, but not as I now know it.

So now I know better. Now I know that a unit test should only really concern itself with the class at hand. The results returned should be a direct product of the method called and should not have been meddled with by a third party class/library/what-have-you. Before really taking some time to learn the subject of testing, I would have looked at my testee, thought “Well this class relies upon this other class here, what can I do but let the call happen.” and as such my unit tests turned into functional tests. But now I know I can substitute those called classes out for fakes, dummies, stubs or mocks.

I started out by writing tests for some existing legacy code (TDD arse about face really) and really struggled with working out how to use my mocks as callees for my target testee. I was instantiating classes inside methods and then making calls out to it. There was no way of substituting the concrete class out for my mock. But now I know I can substitute classes using dependency injection.

The nice thing about mocks and dependency injection, is that you’re not just able to verify the result of your testee, you can also verify it’s interaction with the mock. If your testee is only supposed to call getAmazingValue() once, you can fail if the method is called more times than that, or perhaps even called with the wrong parameters. I would have taken it on almost blind faith that the interactions I had been creating were correct. But now I know I can record, replay and verify these interactions. *

The hardest part for me was writing code I could test. TDD forced me to think about the design of my classes all the time, every time. When doing TDD I start with the test. I think about how I would like the call to work and then I code up something just to make the test pass. Then I’ll think about how my class relies upon a call out to some other class. So I’ll create a small mock for the testee, go about injecting it to get the test working again and then make sure the interaction between the testee and mock happened exactly as it should of. TDD is a beautiful thing, but it has its thorns. Just like everything in computing, on the surface the concept is deceptively simple. But when you really start to look into it and try and do it properly, what seemed like just a piece of floating ice is really the tip of a huge iceberg. The pain of doing it right is well worth it with the reward of less bugs and easier changes. It’s a hard concept to keep going and feel like it’s worth it, as the benefits sometimes might not be seen for some time. It’s only in that moment of changing something that you see straight away that it’s broken other pieces of implementation, do you really feel glad that you made the effort.

* While mocks allow for the testing of the interaction between the testee and the mock, this doesn’t always mean the relationship is correct. If I mock a class and expect a call to getAss() but the real concrete class expects a call to getArse(), then the whole thing falls apart when run in the wild. This might not be such a problem when the mock is derived from a common interface, but in dynamic languages, there is that margin for error.

It’s an Improvement Adventure

It’s amazing how easy it is to be a programmer/developer/code monkey without having to do it properly. I got my first programming job when I was 17, a whole ten years ago, and now after recently reading Clean Code and Refactoring to Patterns, I can’t help but wonder what the hell I’ve been doing all this time. I’ve been writing code, but I sure as hell haven’t been programming. Looking at the code I’ve written as recently as only a few weeks ago now makes me cringe. “Why am I calling this method here?”, “What the hell is this comment?”, “Is this a joke?!?”.

I took a job as a developer for a mobile phone voicemail to email provider four years ago. I was only there for a few months but I still feel like I learnt more about programming while there then I had previously and ever have done since. I’m a firm believer in the notion that you’re only ever as good as the people around you. If you come in at a lower level you’ll soon pick up the pace, and if you come in over those around you, you’ll soon slow down to match your co-workers. As always there are exceptional circumstances. Sometimes if you’re too low, you’ll never be able to perform to the same standard, and if you’re too high, you probably won’t stick around long enough to get bogged down. I’m in a bit of a unique situation in my present role, because I work in pretty much complete isolation from other developers. Which means I have to set my own benchmark. I remember when I started, I was still so full of energy from my previous job (the one mentioned above) that I wrote some pretty cool code, which even impresses me when I look at it four years on. But as time went by I became more and more rusty and the quality of my code decreased dramatically. I stopped reading computing books altogether and took more of an interest in general business subjects. I took an interest again when Rails came on the scene, but none of the coolness or wow factor of doing Ruby could be applied to my day job doing Java, so that area of my life still continued to dwindle. The discovery of Grails changed that to a large degree, but by then I had lost the sparkle for Rails and my code became the same mess, just in a different language. I constantly think to myself that there has to be a better way. Rails and Grails felt like an answer to a certain degree, but the same underlying issues of design and brittleness remained. While features were quick to implement, changes were slow and painful to make. Simple requests became complicated hacks built upon other hacks to fill in holes left by other feature requests. Rails and Grails, while eye openers and moral boosters, didn’t solve my problems.

I was naive and blamed the language, the framework or the previous developer for my issues. I felt that my designs were sound and the code of a high standard. It “felt” tidy and the functionality all there, neatly sectioned off into different places. But Clean Code and Refactoring to Patterns showed me how wrong I had been. Regardless of the language or the framework, without well designed, robust and agile coding practices, you eventually hit a very hard brick wall. To say they were an eye opener is an understatement. It felt more like a programming re-birth. In hindsight, all the signs of bad code were there, I had just become totally blind to it.

Not very long after reading both books, I tasked with making some changes to an old legacy Java system. In the past I had absolutely detested working on it. Everything felt like a mess and that the slightest change would bring the whole system to its knees. But I felt confident this time. I started writing tests, which I had never done before, and started using the absolutely brilliant refactoring capabilities of IntelliJ. I spent a lot of time refactoring code so that the new functionality existed, wrapped up, in a state that it should, rather then in a shoehorned/hacked state. No doubt it too me longer then if I’d just shoved it in, but the system became better as a whole for it. The long reach of the masses of refactorings I performed have left parts in a greatly improved state. Perhaps in some cases, with added complexity – a small price to pay for better testability, design and extensibility. I would rather have an added degree of complexity over a brittle design any time

Anyone can knock out code, anyone can cut-and-paste a system together if they tried hard enough, but writing code alone is a solution to a small fraction of the overall problem. Anyone can churn out new features for a v1 release, but what about v1.1 or v2 or v3. As developers we dig our own graves. Clients don’t understand why things used to happen so fast, but now it’s sometimes weeks before anything new is ever shown. Fast – Slow – Slower.

This is where good, clean code starts to come into it’s own. Code that’s light on it’s feet. Code that’s easy to move in and out. Code that isn’t a brick wall and requires you to code around. Good design and good coding practices are at the heart of delivering a robust solution. If you are a developer you need to read the books I mentioned above, or at least just Clean Code. Heck, as a developer you need to read books. FULL STOP. I know many developers who don’t read at all, which to me is just unthinkable. You maybe one of the few that shrugs their shoulders after reading something like Clean Code and says “Yeah, I know all this already.”, and if so, good for you, but even you will probably know someone who could do with reading it, probably more then once ;)

Slicehost Migration

The migration over to Slicehost is now complete and I’m extremely happy so far. It wasn’t as easy as I thought it would be, but the feeling of impending doom I got when presented with a fresh install of Gentoo was quickly overcome. Apache + PHP + MySQL took virtual no time to install (once you discount the time it took to compile them up) and the installation of WordPress along with importing my old posts worked pretty much like a charm. Installing and migrating over my Gallery2 install proved a bit tricky but nothing that some time didn’t set right. One thing I’m not prepared to do is setup Email so I’ve entrusted that to MailTrust which is working well. I’m finding things like no FTP server or even VIM amusing after coming from Dreamhost where all of this stuff is there already for you, but the sense of freedom and also ‘leaness’ of the server more than makes up for all that.

Orange border on Flex Candlestick Charts

One thing not mentioned in the Flex CandlestickSeries documentation is how to change the border colour of each candlestick. So you end up with a horrible orange border by default. This can be removed with the boxStroke tag.

Objective-C FizzBuzz

We have lift off!

Guideline for iPhone UI design

Figure out the absolute least you need to do to implement the idea, do just that, and then polish the hell out of the experience.

Not only does John Gruber nail it when it comes to the essence of what being ‘iPhone like’ is about, he echoes the essence of what good piece of software is about. At it’s furthest abstraction, in my opinion, the above is really a mantra for reaching the pinnacle of one’s own life.

[Via Daring Fireball]

RescueTime

So in October I spent a grand total of 327 hours infront of a computer. 43% of the whole month or the equivalent of nearly two straight weeks. The dip on Oct 13th was when I installed Ubuntu ;)

Don’t be a DSL (a.k.a When Developers Go Stale)

I’m not talking about being a Domain Specific Language, I’m talking about being a Domain Specific Loser. These are they people who don’t go to the trouble, and it is trouble, of broadening their skills and learning new things. They are the people who don’t care about anything that doesn’t have anything to do with what they are working on.

Hey, I didn’t sign up for this!

Technology is such a fast changing industry, that if you don’t keep up, you’re going to get left behind pretty fucking quickly. I had a load of things listed as points that every developer should be doing and then came across a post by Jay Fields which summed it all up perfectly:

  • Have you tried Test Driven Development? Can you name something you liked and something you disliked?
  • What language(s) that are gaining popularity, but not yet mainstream, have you written Hello World in?
  • Do you read books or blogs looking for new ideas at least (on average) once every two weeks?
  • Do you at least attempt to learn a new language every year?
  • If you don’t understand a requirement, do you IM, phone, or go talk to the business?
  • Have you ever run a code coverage or cyclomatic complexity tool against your codebase?
  • and so on…

On average, 50% of the people I’ve worked with cannot answer those questions correctly. If you can’t answer them correctly

  • You’re junior and could use a good mentor.
  • Or, it’s time to find a new profession.

Developers go stale. It’s just a fact. I was stale and then I discovered Ruby on Rails and I was born again. I don’t mean that to say that Ruby on Rails is the light, but rather that Rails opened my eyes to doing things ‘better’. It got me excited about technology and programming again. It got me constantly thinking “How can I improve?”. And since then it’s been a long steady stream of new ideas, new techniques and new tools. Groovy, Grails, Git, Proper CSS, TDD, Agile, Scrum and of course OSX, etc. I am spending increasing amounts of time buried in blogs or books. Clean Code was a complete eye opener and my current read, Refactoring to Patterns, has me feeling like I am attaining programming Zen.

I think a lot of developers kid themselves into thinking they are developers. Even after working as one for nearly ten years I still feel like I’m a scraping off the bottom of a very deep barrel. Being a shit programmer is easy, anyone can cut and paste some code together, but where is that going to get you? When you hit 30+ are you really going to have the skills necessary to start jumping into to the £50k+, £75k+, £100k+ salary bracket? No, you’re not. Sorry. At that point, we’re playing for high stakes, and they don’t hand those jobs out to just anyone. If you’re a developer and reading this post, take a look at those Jay Fields’ questions again and be honest with yourself. If you can’t answer them correctly, you should seriously take a long hard think about what you’re doing with your career. You should be doing something you care enough about, that you want to be as good as, if not better than, the people at the top of the game.

Being shit is easy, being good is hard. We live in a world where no one wants to do anything for themselves, but that’s not how the world works. So do the right thing. Step outside the comfort of your regular language, read some books, read some blogs, try some new techniques. That’s all you need to do. Don’t allow yourself to become stale by working within the confines of your 9-5 job, its codebase and the developers around you. You need to step out of that mentally to really see what’s going on in the world of technology. I’ve probably learnt more from developers I’ve never met, then those that I’ve sat next to for years! If I hadn’t stepped out of such a silo, I’d still be developing applications in Struts, forever re-compiling and restarting the server, wishing there was an easier way. Now that I’m using Grails, I don’t know how I ever got by before. And with all the lessons and techniques I’ve learnt over the past six months, going back to those old Java/Struts applications is a joy, as it’s a chance to flex my muscles and do some fun refactoring and sprinkle some syntactic sugar around (Nothing is more satisfying then sweetening some smelly code).

It’s hard for some people to swallow. Being a developer today is not what being a developer was 5 or 10 years ago. A lot of people don’t want to adapt, and that’s fair enough, but that’s how species become extinct. They don’t adapt. Being a developer today is about so much more then just developing code. It’s about delivering solutions. From soup to fucking nuts. We should be able to interact with customers, spec out pieces of work and participate in groups to ultimately deliver on a customers’ need. It’s a bitter pill to take but that’s what the job is. It’s a far cry from what it was before, where writing software was like a holy quest, and the crusaders could never be questioned for fear of ever increasing budget and timing overruns. These days there are companies delivering software of such high quality and at such a high pace that customers become understandably agitated when their developers fail to do the same. There used to be a time where you could deliver a piece of shit and get away with it because people still didn’t really understand the web and what it was capable of. But you’re damned these days as clients want the same small features that make sites like Facebook, Gmail or Yahoo a pleasure to use. “What do you mean you can’t do it? XXX does! How hard can it be?”. *Ouch* I hope you’re up-to-date on your skills when that question comes around.

Investing in Your Own IT – The Ultimate No Brainer Pt. 2

This is a follow up to my previous post about investing in your own IT. The more I think about the more I keep coming back to the thought that it’s not about investing in IT, it’s really about investing in your people. After all, without your people you’re nothing. Yes, without your people you are nothing. Zilch, nada, zero, nil, null.

You’re not spending money on new computers so that tasks are done faster or made easy to achieve. To claim that is to say that the key to success lies within the tools. It doesn’t. It lies within the people. “Well”, you may say, “then it doesn’t matter what equipment I give them then!”, and with that you would join the many number of managers I’ve heard say the exact same thing and who I believe had no a clue as to what their people actually did. Good tools do not create good developers, but bad tools do create bad ones. And I don’t mean bad in the sense that all of a sudden they start writing bad code, but that they become de-motivated, uncaring and uninterested in their work, to the point where it has a significant impact on their deliverables.

Now you could say that a developer worth a dime will rise above and make best with what they’ve got, but we’re a proud bunch of people and of course want nothing more than to do good. But if you begin to even start to feel like you’re being set-up to fail or that you are not important, then it’s lights out and that is going to have a major impact on your motivation and which will affect anything that you are supposed to deliver. A motivated developer will always create something faster, better and stronger then one that isn’t. A motivated developer is a productive developer.

“Hey, I’m paying these monkeys! So they can just lump it or get the hell out.”

Well at least you are brave enough to admit that you’re paying people to put up with your shit. But why? Why be shit? Isn’t there some part of you, deep down, that just wants to blow the fuck off the roof and do extraordinary things? It all comes down to self-development, whether that be the self as an individual or the self as an entity, like a company. I touched very briefly on the subject in my post about typing, the short of it being, if you have the opportunity to improve, why would you not do it? There are, of course, reasons not to. Perhaps it’s fear. There is the fear that if you make the effort to try, that you will fail and others will laugh at you, or there is the fear that the actual process of trying to improve will only expose your flaws, and no one one wants to be exposed as being a complete moron (You know who you are). Perhaps it’s monetary. To get better, you may need to buy new equipment, new materials, go on courses, whatever. It’s easier to steer the course then it is to make waves. There are always reasons not to do something, but does that mean we shouldn’t do anything? Of course not. Let’s give our developers a moral boost. Let’s motivate them. Let’s make them feel important. Don’t stick them on shitty machines with small monitor/s.

Fuck it, where’s my new machine?

[Flowchart modified from the Panflute Flowchart]

Ubuntu… Be Gone!

Dear Ubuntu 8.04,

Please don’t be mad. It’s not you, it’s me. Maybe I’m just too fussy. While other’s can live with your rough edges, it’s just too painful for me to deal with. Maybe it’s just the ugly fonts, maybe it’s the fact that links sent to me in Pigdin won’t open when clicked and need to be manually copied and pasted into Firefox.

While I understand you probably thought our game of “lets make one or the other monitor work but never both at the same time” was fun, the two hours of pain it took to get “working”, followed by another two hours of fiddling when they both failed to work after a reset was just too soul wrenching.

But I tried to look past these failings and for a while things worked out really well. I was overjoyed when you compiled my code faster then the servers did, but really, that was all you had going for you. When you failed to run Selenium IDE, I winced a bit, but thought I’d manage, but when you failed to run Firebug, I couldn’t bear to go on. I know others out there are willing to put the time and effort into making a relationship with you work and I know that you’ll find someone else who’s right for you.

The last thing I ever want to do is change you. But why can’t you be more… I dunno… OSX like?

Richard

“It works 60% of the time, all the time!”

You can’t get a little bit pregnant. – Lou Mannheim

There’s a story about a manager that said his team was doing scrum/xp. When pressed as to the details of what that meant, the manager replied that they were doing ‘no documentation’. Scrum is the in project management methodology of the moment. Quality? Scrum! Clear deliverables? Scrum! Happy developers? Scrum! Pole dancing midgets covered in maple syrup? Scru… Hey wait a minute!

So yes, Scrum and what does it have to do with getting a little pregnant. My point is, if you’re going to do it, you need to go the whole way. It’s not enough to just dip your toes in the water. You may refer to your current load of work as a sprint, refer to units of work as stories and may even refer to your working capacity as your velocity. But, scrum is not about giving names to concepts, or about having a backlog, or having a burndown chart etc. Even if you did all of theses things together, you would still not be doing Scrum, because it is more then the sum of its parts. And I can guarantee you that if you start going down this path of faux Scrum, when things start to move slightly off course and panic starts to creep in, you’ll dip into your old ways to “fix” the immediate problems and then when the shit really starts to hit the fan, you’ll give up on it completely and deem the whole exercise a failure. That’s why you can’t get a little bit pregnant. You’ve got to go all the way and get to fourth base.

“Woah, Joe, all theses companies are succeeding with Scrum, we should do it too!”, “Yeah lets!” – High five! The product backlog gets written up, the burndown chart gets drawn and every morning there’s a stand up meeting with some people to discuss ‘work’. A week or two goes by and it really starts to feel like the wheels are greased and progress is being made. Then an urgent client request pops up, a massive bug has been found, or that feature they asked for two months ago and which they’ve just seen (Hey, we’re retrofitting Scrum to primarily waterfall driven project), isn’t what they wanted. Well the request is fine, we’ll go through the current sprint’s backlog with them and they can decide what they would like pushed back. Oh, they don’t even know what a sprint is, “What did you say? Spinelog?”. Well the bug is not a big deal, we’ll just run our tests, make the amends and get it sorted real quick. Oh there aren’t any tests. Ok well at least the incorrect functionality we can handle, we’ll just plan it into the current or next sprint and continuous integration means they can monitor the progress as we go a long. Spontaneous combustion? Fuck me. It’s not good enough to pretend, or for the development team to do it in isolation from the stakeholders or customers. To succeed you need buy-in across all the people involved with bringing the project to fruition. Everyone needs to understand the process and understand the role that they play. Pretending to do it ends up giving the team (mostly management) a false sense of security and that can really come round to bite you in the arse.

Don’t get me wrong, I’m not saying that doing Scrum in the above fashion is always wrong, because sometimes your circumstances leave you with little choice. But, what I am saying is that proclaiming to be doing Scrum without understanding it all the while living in blissful ignorance of the flaws of your own processes, is bad and harmful. I don’t mind mistakes or doing things the wrong way when you start out, because really you need to start walking the path before you can get to where want to be. I just can’t stand people saying their walking the path when really their just sitting on their fat arse, biding their time.

Man looks into the Abyss, and there’s nothin’ staring back at him. At that moment, man finds his character, and that’s what keeps him out of the Abyss. – Lou Mannheim

Groovy gotcha

This stupidly caught me out and a proper D’oh moment followed. I had bad been converting a couple of parameter calls as such:

To something more Groovy (I hate it when people say it like that). But:

I was expecting it to return the boolean value of someBoolean if it wasn’t null, but instead it was tripping the elvis operator and returning the default value when the result was false. Cue slap on the forehead after realising why I wasn’t getting my expected value back.

Git Revert? Reset? No, Checkout!

It took me longer then I expected it to, to find out how to revert a single file using git. Git revert is not it, that’s for creating a commit to undo the changes of another commit. Maybe git reset? No, that resets the current HEAD, not a specific file, it would seem. Turns out it’s just a simple re-checkout of the offending file. D’oh.

Investing in Your Own IT – The Ultimate No Brainer

I’ve been cursing my work computer all morning and am once again considering either bringing in my computer from home or just buying one outright (It wouldn’t be a first. I paid for my own monitor here at work. Go figure). Kris Kemper wrote a good post on the subject a few days ago.

I’ve seen this on every project I’ve been on. We are given slow machines, and time is lost. It may be lost because I’m running grep over a lot of files, it may be because when I have my all my development tools open and the machine slows down.

To me, when you’re in the business of developing software, investing in your own companies IT is a complete no brainer. Companies are normally extremely quick to spend on server hardware, but when it comes to development machines, spending is often few and far between. My machine here at work isn’t a “horrible” machine, but the agony it puts me through makes me feel that it’s perhaps not best suited to the task of developing on. But then even simple tasks seem to thwart it with constant disk grinding. I tried deleting an old repository checkout, no more then 200mb on the disk, and stopped it after it had only reached 14% done in 10 minutes. Virus checking my update of DirectoryOpus took nearly 3 minutes. Maybe it’s just a build issue and not so much a hardware one. Vista complains that all off the Office 2007 apps are not valid Win32 applications or the Snipping tool politely tells me it’s not working “right now”. Yes, I can see that. Whatever it is, it’s not the sort of shit that you need when you’re in the middle of something. Whatever, they should have got me a Mac.

I can understand that sometimes you just can’t afford whizzy machines or the latest version of software. Just don’t let me catch you running a .NET stack and complaining about not being able to afford machines fast enough to run it.

A Developer’s Regret

Via LispCast

Learnnning tuo Ty4peer… ARGH!

I can type, I just can’t type super duper fast. For years now I’ve been managing to get around 60wpm (70wpm if I really really push) without the use of my little fingers, which is fine for most things, but me being me, I want more.

Thinking about all the extra things I could get done if that went up to a comfortable and sustainable 80-90wpm gives me that warm and fuzzy feeling. So a week ago I purchased a copy of MasterKey and began the long road to proper form. I have to admit it was extremely hard and painful for the first day or two and I came very close to giving up, but six days later, I’m not that much slower then I was to begin with. At first I was down to about 25wpm but at least now I’m hovering just below 50 wpm which is fine for most day to day stuff and not slow enough that I feel the urge to revert back to my old style (sans little fingers). I still have some bad habits I’m struggling to get rid of, namely still using my ring finger for the backspace key and occasionally for the U key, but some habits die hard, real hard.

As a background, Steve Yegge wrote an interesting article on the subject of typing a couple of weeks ago, saying that programmers who type slow make up for it through a lack of commenting and refactoring. By not possessing the ability to type fast, you’re just building up technical debt. While I don’t know if I whole heartedly agree, I can certainly see where he is coming from. I don’t think it’s a critical skill to have, but I think it can, to some degree, display a programmer’s level of mastery of computers. Certainly, someone may have had a job that required them to know how to type, but for those that didn’t, typing is one indicator of time spent infront of a computer/interest in computers/willingness to learn the tools of your trade.

To expand on the last point a bit, I think learning the tools (not tricks, there is no magic here) of the trade is extremely important. Why would you not choose the path that offered a 10%, 20%, 50% or maybe even a 100% (!) increase in productivity. To not make that choice is beyond belief and deserves a shunning. Whether you wanted to take that gained time to make project improvements, read a book or even just kick back, why would you not do it. I don’t want to get into the subject too much now as it deserves another post in itself, but this is why I have chosen to improve my typing skills. To move that one step closer to mastery and not feel impeeded by the tools that I use (Not counting the ones I have to use, blegh Windows).

Rescue Time

For just over a week now I’ve been tracking all my time spent infront of a computer with RescueTime. It’s a great little tool which sits and just logs everything you do. You tag any captured applications and devide them up using tags. As you can see from the graph above I spent 69 hours and 56 mins (Damn, just missed 70 hours, must try harder this week) in front of a computer. The chart is broken down into work, web and everything else. As a lot of my work tasks include the “web” tag, the divide in the chart isn’t a split between work and mindless browsing. So really there is a lot of overlap between the two categories (Well I think that’s how it works). All-in-all, excluding my 9-5 job, I’m still spending an almost mighty 30+ hours infront of my computer at home. How awesome is that! :P

iCal Magic

I only just noticed that the iCal icon actually updates to show the current day’s date! No more bringing up my calendar widget. The 3rd is my birthday by the way :D

Google Chrome

All my news feeds today have been filled with nothing but talk of Google Chrome. As there is no OSX version (it can be built if you’re really that desperate), I fired up my Vista VM and installed it and I’m quietly impressed. Does the world need a new browser? Maybe, maybe not. While it’s nice that each tab runs in seperate processes, does that really make Chrome a browser for what the web has become or becoming? The Google “Reasons Behind Chrome” video talks about playing games in one tab, checking mail in another, but I do this already with no problem in Firefox. Maybe it’s betting too much on the web and I certainly don’t agree with Michael Arrington‘s idea that “Chrome is nothing less than a full on desktop operating system that will compete head on with Windows”. I think he’s mis-understood what an OS actually does. The suggestion that desktop apps will be replaced by “webified” versions is just too out there. I can’t wait to start using my scanner through my browser. Oh, and this post was of course written in Google Chrome ;)

CSS Mastery

I have always hated CSS simply because anything I ever did would break in either Firefox or IE. I would spend countless hours tweaking and experimenting to get things consistent, and even then it felt like things where hanging together by a thread. Once things worked, I prayed I never need to “change” it. I have to confess that up until recently I still believed that tables were the solution to most web UI problems. A table here or there never hurt anyone. Really though, tables are sooooo Altavista. Thus, I’ve been making a conscious effort to move towards styled divs without tables full of spaced out cells containing transparant spacer gifs. I have been pretty much fudging my way through it so I thought I should read up on the subject and saw that CSS Mastery had gotten some really good reviews. I stole the office copy, made my way through it and can honestly say, with hand on heart, that it is an absolute must read for anyone involved in any sort of web development. My CSS ability has developed by leaps and bounds. I recently put together our new site which gave me a chance to flex some of my new found CSS skills and it made such a difference. Everything came together quickly and painlessly. For the first time ever I had a site that worked in both Firefox and IE pretty much off the bat and I had a tidy HTML and CSS file. Will this book make you a CSS Master? Probably not, I’m not one yet, that’s for sure, but it will get you on the right track to eventually getting there.

To go off on a bit of a tangent. Some work places have a specific team that do all the styling and formatting of whatever the developers give them. Maybe on huge projects, it makes sense, but in small teams I see no benefit apart from massaging the developers own egos and beliefs that HTML/CSS is beneath them or something. This divided approach really bugs me, simply because I believe that it causes developers to not give the asthetic or functional side of what they produce any consideration. Un-usable? Hey, it works and that’s all that matters, it’s not my job to make it look pretty! The process is circular. Good design begets good functionality begets good design begets… You get the point. Design is not just about making things pretty, and that’s the trap that people fall into. It is about communication; giving the user an experience they understand and can relate to. I’m not a UI guru or claim to have all the answers, but I’m a big believer in at least trying. The curse of knowledge from the book Made To Stick plays a big factor in this. People find it extremely hard, if not impossible to imagine not knowing what they know, and that is what stifles communication. I once argued with a company director about an existing system’s poor UI. They claimed that it was sooooo easy and quick to use and I pointed out that’s because had been walked through it so many times and used it nearly every day. So eat your own dog food and do your own HTML/CSS. Use your own system and pretend like you’ve never used it before. Do a hallway test and ask someone to perform a task without telling them how to do it. You might be surprised by the results.

Not cool enough

Saw this on Digg and thought I’d take a look myself. At least they aren’t afraid to admit it.

A month with the mac

It’s been pretty much exactly one month since I got the iMac and still when I sit at work I day dream of getting home using it. Since then, Apple fanboy level has reached factor 11 for sure. The main factor for switching when I did was the release of the 3.06Ghz iMac. I really didn’t want to “downgrade” from my PC to a slower machine. So with the release of the latest iMac there was no excuse not to. I ummed and arrrred for quite a while before just sucking it up and getting the thing, but from the moment I heared the startup chime, I haven’t looked back once, not even for a nanosecond. Ok, that’s a bit of a lie, because I did look back… I looked back and laughed.

When I initially made the decision to switch I was prepared to put up with niggles or annoyances to see if OSX was really that good and without hesitation, I believe it really is. There was a time when I would mock Apple advocates. I mean come on, Apple mice have one button! I remember the first time I used one back in ’97 and having to maintain a few of them in the office. Yeah they looked great, but back then I wasn’t interested in the atheistic side of stuff so much. They seemed to cause more problems then it was worth back then. Windows 95 and Mandrake Linux were enough to satisfy me. Fast forward to a few years ago when I started taking an interest in conceptual and coding elegance, clean and simple UIs and above all else usability being the core of any product. After years of make doing with the clunkiness of MS interfaces, I longed to feel good about the tools I was using. Using a computer shouldn’t be a chore, it should be a delight.

So it all began with those pesky Rails videos…

I don’t care what anyone says about scalability or whether it’s “enterprise” ready, but Rails rocks, if not simply for the fact that it opened my eyes to how coding should be. After years of living the code -> compile -> test endless loop, Rails was like a fresh of breath air. I’m a neat freak and Rails was the cure to my itch for a cleanly defined standard to creating a webapp. These bits go here, those bits go there and here’s your finished web app. Tasks took a fraction of the time to achieve in Rails compared to Java and Struts. It was earth shattering. And that’s where the videos came in; I would watch videocasts and everyone was using Macs, and the more I watched the more I’d get a glimpse into the life of a Mac user. It felt like everyone doing all the cool stuff was at an Apple party and I wasn’t invited. Then the more I looked into OSX and its applications the more I saw that the people developing on it and for it really cared about the stuff that mattered, the kind of stuff taken for granted on other platforms. Apple people are the sort of people who care if the corner of a bevel isn’t rendered properly. Anal? Yeah of course, but it’s that attention to detail that makes OSX such a pleasure to use.

I know I annoy people with my fanboyism and I feel the urge to defend Apple at every opportunity, but the same people who like to point they can get a better spec machine for the amount I paid are the same who like to poke jibes at Rails but don’t have the guts to try either. I just smile and day dream of getting home to my iMac.

Switching to Mac

After months and months and months of talking about Macs and OSX, I finally switched. Up until now I’ve held back as the thought of moving to a slower machine never sat right, but now with 3ghz iMacs with 8800gs cards, there is no excuse not to switch. It’s been a week now and I am totally convinced that OSX is far far far far superior to Vista. Using OSX is an experience. It’s like a breath of fresh air in comparison to Vista. The OS feels more polished and applications feel like a lot more care has gone into producing them. One of the features I was looking forward to using was Spaces, but with dual 24″ monitors there is really no need. I have Vista running as a VM incase I need any apps but I haven’t needed it once so far.

Vista + POP3 = Fail

My windows install became b0rked a few days ago (from now on, I’m imaging my drive every couple of weeks) and now on my fresh install POP3 doesn’t work. I know I had exactly the same problem before but can’t for the life of me remember what I did to fix it. Ball ache…

UPDATE: Turns out it’s not a Vista problem at all. I should have been logging into my mailbox with the full domain on my username rather then just my username. D’oh.

Beautiful Cables

Beautiful cable installations here.

Vista Error

I don’t think you wanted to do that.

Vista and the new Beast.

After three years of good hard use my computer finally started to die. What first started as random crashes, soon became BIOS checksum errors and then finally memory and disk access errors. So I ordered some new parts consisting of a dual core 3ghz, 8800gts 640mb, 4gb of 8500+ ram, and to top it off Vista Ultimate 32. Assembly went well, getting Vista up and running didn’t. To cut a long story short:

1st Install: Crushing realisation that Vista32 only supports up to around 3gigs of ram and then finding that the Windows update stops Vista from booting when restarted. Let’s try again.

2nd Install: Installs fine and then previously working network drivers crash the machine when added. After some digging around on the net, it turns out the windows update I did previously corrupts the firmware if you let it update the LAN driver. Fix is to leave it unplugged for 10 minutes. Computer boots now. Let’s try again for good luck.

3rd Install: So each time up until now I have been deleting my primary partition and reinstalling to it. Each time this has been the first partition in the list of available drives. Only this time its not. I blindly delete the wrong partition containing all my work! Nooooooo. Partition Table Doctor manages to re-write the partition table. Crisis adverted. Install goes okay and LAN drivers now work. A friend then informs me he has a Vista64 disc if I wish to use it so I nip round and pick it up.

4th Install: Now rocking Vista64 which can address all the available memory and lovin’ Aero.

It was a long 24 hours getting that machine running but boy does it fly. Oh btw, Vista rocks ;)

Winamp

Winamp Screenshot

Winamp since the dawn of time and never bothered to upgrade, thinking what’s the point when there is a free version available. Well that’s all ended and now after what must be nearly 12 or so years of use, I’ve upgraded to the full “pro” version. Time to give something back for all those years of heavy, heavy, heavy use. Rock on Winamp… Rock on…

Ruby Gem Mysql on Suse 10

If you get the error below while trying to install the ruby mysql gem on Suse 10 then follow the instuctions below to get it going:

incei273:~ # gem install mysql
Building native extensions. This could take a while…
ERROR: While executing gem…
(Gem::Installer::ExtensionBuildError)
ERROR: Failed to build gem native extension.

ruby extconf.rb install mysql
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lm… yes
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lz… yes
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lsocket… no
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lnsl… yes
checking for mysql_query() in -lmysqlclient… no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

Checking the mkmf.log in:

{ruby-dir}/gems/1.8/gems/mysql-2.7/mkmf.log

… shows libmysql is missing. But looking in /usr/lib/mysql shows some libmysqlclient*.so files but GCC actually needs the .a files.

So fire up yast and install the mysql-devel package.

Then install the Ruby Mysql Gem using:

gem install mysql — –with-mysql-lib=/usr/lib/mysql/

WordPress

I’ve finally moved over to using wordpress on my own server (If you’re reading this on livejournal I’m using a cross-posting plugin). It’s been nagging me the thought of one day losing all my entries on LJ, so the only way to be sure of keeping my few years of blog postings was to import them all onto my own machine.

Using the LJ export and WordPress import feature I’ve already managed to get a few years worth of postings sorted. Only a few years more to go…