Tuesday, December 22, 2009

How to be a Guru

To be a true master - a Guru - in the art of software development you do not need to know what feature must be added.

Recognise instead what should be left out.

Wednesday, October 07, 2009

Go on, ask.

I think we've all been there, spending a couple of days battling with an SDK to get it to do something slightly different, something slightly leftfield. Something slightly risqué.

We keep battling away, Googling and re-Googling, heading further into the SDK's proverbial dusty corners, not knowing if the classes and methods that we're searching for will even do the job.

And then finally we crack and ask someone for help.

What do we expect to get from asking?

Someone to tell us that we just need to call the Foo::Bar() method?

If we're lucky this is exactly what will happen.

If we're less lucky we'll be told to explore another dusty crevice requiring further Google action.

But most likely, we'll be given some advice that will help us to look at the problem in a different way:
Perhaps we don't need the gui to do that funky trick, and it would actually be far move user friendly if it behaved in another, more standard way.
Perhaps we shouldn't try and make that library function totally generic and rewriting it to solve a specific issue is perfectly acceptable.

Whatever happens, we shouldn't see asking for help as a weakness, but rather as an opportunity to better ourselves by learning from our peers.

Thursday, August 13, 2009

Startup Incubator is Looking for you

Red Gate Software are prepared to help out start-ups by offering good people a desk, money, accommodation and even free food.

All they want in return after the initial 10-week development period is a chunk of equity.

But the point is they're prepared to take a gamble and invest in good developers, giving them everything they need to make great software - but with no risk.

Monday, July 20, 2009

GDP is not very good at Measuring Global Growth

It's time for a new measure of growth because, in a world with globalisation - where much of the money you spend goes to another country - GDP is incompetent.

GDP increasing year on year is supposed to be a good thing, but why do we expect this to happen at all?

Where does all the extra money come from?

It comes from the planets limited supply of raw materials such as its coal, gas, oil, gold, iron and timber.
They're either being mined faster or becoming more precious because of their increased rarity.

It comes from the planets renewable materials, for example making water drinkable or generating electricity from wind and solar power.
(And, by the way it makes sense - if for no other reason than long term financial gain - for governments to invest in renewable power.)

It comes from farmed goods such as wheat, rice, fish, livestock and timber.

And it comes from the fact that, due to population increase, we are slowly using up all of the inhabitable space on the planet and that's driving
up land value. If you own a chunk of planet, its value is likely to be proportional to the global population.

And that's it, everything else is just inflation and national debt.

If I do a service for you, no value is created, dollars are simply exchanged. No new money enters the international mega-pot.

Governments can't just "make" money without inflation or currency devaluation. And devaluation is just another form of inflation when you consider the global economy as a whole.

Please tell me if I'm totally missing the point of GDP here! Because it seems to me to be a pointless measure of a global border-less macro-economy!

Wednesday, July 01, 2009

10 Questions to ask before Changing your Software

It's been said that modern day software engineering is like gardening in that you're not normally creating something new but maintaining an existing system.
So when gardening - when making changes to your existing codebase - there are several questions to ask:

1. Why am I Making the Change?

The best code change is no code change at all - because every code change carries the potential work of a bug fix waiting to happen.
The smaller the code or configuration change, the lower the risk. If it ain't broke, don't fix it.

2. Who is the Customer?

Are you making the change because your boss thinks it would be a cool new feature? In which case he's your internal customer (this is often the easiest case as it matters less when the requirements aren't completely defined up front).
Or is it that there's a real, paying, external customer who wants something added to their bespoke software package?

3. What are the Use Cases?

Once you know who it is you're developing for, you'll need to know exactly how they plan to interact with the system...

4. What are the Detailed Customer Requirements?

...and what those new UI components should do under the hood.

5. How will the Architecture be Affected?

Will the change affect your software's architecture? Are you just adding a new widget to your GUI, or are you going to rewrite half of the existing code?

6. Which Existing Modules need to Change?

You do have a modular codebase right? Yeah? So you'll need to think about which ones need to change, and how.

7. What new Modules are Needed?

Will that new widget require its own module, or does the functionality sit naturally in an existing module?
If new modules are needed, what's their public interface and how do they interact with everything else?

8. How will Errors be Handled?

How does the software cope when the inevitable happens and the user does something stupid?
Or the robot that you're driving decides to crash into itself?
What happens when the web service that you query falls over because a pop superstar passes away and there's too much web traffic?

9. How do we test it all?

As this is a change to existing system, you need two types of test:
1. Regression tests to confirm that the existing system still works.
2. New tests to test the new stuff.
If the software already has an automated test suite you've covered 9.1 already and covering 9.2 should be a doddle.

This is also the place to look our for deficiencies and commonly experienced problems, for instance, if you have a highly multithreaded codebase, how do you make sure that the delta hasn't introduced a deadlock?

10. What are the alternatives?

Double check that the change you've decided to make really is the best way before touching any code.

What do you think? Is there anything that you disagree with? Or that should be added to this list of gardeners' questions?

Thursday, June 11, 2009

Clustering keywords for meaning

After a couple of occasions when Google has totally let me down, I've been thinking about the problem of improving search engines. And particularly about the problem of meaning in a search time.

For example, when you Google the term Ultralight you are presented with, amongst others, ultralight outdoor gear and ultralight aircraft as Google has no idea which you are interested in.

Flickr gets around this problem by clustering results together - compare their ultralight cluster.

Perhaps this is more of a problem with using short, relatively meaning less search terms, something we've been conditioned to do because search engines just don't understand natural language. Yet.

Sunday, June 07, 2009

Pair programming with Google Wave??

Google Wave was announced the other week and seems to be making ripples (excuse the pun) amongst technology bloggers. I recommend readers who know nothing about it to watch the video as I'm only going to talk about one aspect:

Pair programming with a Wave Extension

Wave is all about collaboration. Collaboration and extension.

And it won't be long before extensions exist to compile your favourite language. Then, its real power will be presented to developers.

Imagine coding in C++, pair programming with a legend like Herb Sutter or Scott Meyers?

(I'm sure that all they'd require is a convenient way of charging ;)

Sunday, May 10, 2009

How to hit the Front Page of DZone. But why it Doesn't Matter.

I've been lucky enough to hit the front page of DZone on a number of different occasions and I believe that there are several tricks that can be employed to reach the holy grail, the front page.

Captivating or Controversial Title

DZone readers spin through hundreds of new links everyday trying to find something new or interesting to read. As a blogger or link submitter, you have a dozen words or so to captivate their attention and get their valuable click.

The title you choose should give them measurable facts, because what coder can resist indisputable fact? E.g. 6 Free Tools that every Windows Programmer should Install

Or, the title should provoke controversy, such as Should Coders be Allowed to Wear Headphones at Work? Make it a subject that most programmers have an opinion on and they'll click on the link just so that they can add their comment.

Quality Content

You can't find a post on blogging that doesn't mention quality content. So, I shall to!

Seriously though, people will only give it the DZone thumbs up if the article is well written and delivers what the title promises. Obvious really.

When to Submit

I've not yet hit the front page from a Monday submission. I think people must be just too busy on Mondays to promote links. Tuesday to Friday is best.

But why it Doesn't Matter

Chris Guillebeau over at the Art of Nonconformity argues in his excellent manifesto, 279 Days to Overnight Success, that you don't need to hit Digg (or indeed DZone's) front page to make a living from blogging.

He says that if you're trying to make money from Adsense - and he reckons that this is quite a difficult task - then you need that constant stream of visitors that Digg (or indeed DZone) can provide. But if you're trying to build a fan base interested in your compelling story then those sites won't help.

Monday, May 04, 2009

Multi-threaded JavaScript Makes Stream Processing a Reality

The future is finally here:

Multi-threading in a JavaScript app.


Do you realise what this means? It means websites could use a form of stream computing to get your computer to do stuff without you even knowing.

It means that a website sending out processing requests to every browser that hits it - without said browser becoming unresponsive - is now a reality.

And as JavaScript engines become more efficient, this will be even more of an option.

The web-based super computer is amongst us, if a site where users tend to stick around for a while, such as Facebook or Myspace, wants it to be.

Let me just explain that last point - Facebook et al (or, indeed any web site) could send packets of data to your machine for it to process in the JavaScript enabled web page without you even knowing it. The answer to the processor-intensive question would then be sent back, and the web site gets its result.

It could even sell this processing power!

Is it legal, I think so.

Is it ethical, well, that's for another debate.

Motivating Geeks... And non-Geeks Part II

In How to motivate Geeks... And non-Geeks I talked about not de-motivating by getting the basics wrong.

So, time has passed and you've got the basics nailed, your hygiene factors are suitably hygienic, where do you go now?

Well, now comes the motivators: Respect, Truth, Openness, Trust, Responsibility, Recognition, Achievement and Growth.

I learnt some of these the hard way, like the time when I used to make computer games and I was technical lead on a new PS3 development, I told a developer who'd been programming since the ZX Spectrum days how he should go about finding and fixing a bug.

He sturnly replied, "Yes, I know!"

My comment - at the very least - broke the Resposibility and Recognition rules. And probably the Respect rule too.

There's a common misconception that salary is a motivator. This is wrong. A decent salary is required to stop people worrying, and you won't be motivated unless you have enough money to pay the bills, but an increase in salary is not equal to an increase in motivation.

Be honest with your staff, give them responsibility and then trust in them to do a good job. Share with them how the company is doing, ask them how they're doing. Tell them the truth.

Then, and only then, will they really excel.

Monday, April 27, 2009

Motivating Geeks... And non-Geeks

Maslow's hierarchy of needs and Herzberg's two factor theory both say the same thing:

You need to get the basics right before you can expect your staff to be motivated.

If workers are scared of losing their job or frightened of not being able to buy food for their children, they aren't going to be motivated.

When people get annoyed at their unresponsive PC and tediously slow compile times they aren't going to be motivated.

It won't help if they're in pain because their desk or seating area is wrong. Or if the temperature is sweaty-forehead-hot or freezing-nose-cold.

When there is excessive noise they won't concentrate, and won't care.

If bullying occurs or workers feel undervalued they'll just not bother.

Pay attention to the little things. Ask your staff what they need and what they want, and you'll be well on your way to a motivated workforce.

Motivating Geeks... And non-Geeks Part II

Wednesday, April 22, 2009

Is Programming a Creative Pasttime? Discuss.

Martin Amis missed a trick when he called his book The War against Cliché. The War on Cliché would have been far more apt.
"What has a book on literary criticism got to do with software development?" I hear you question.

Well, programming is often said to be a creative pasttime. And when I was developing video games I would have totally agreed with that statement.

But now, with some years of professional development in non-entertainment-software circles, I'm not so sure that it is.

Beautiful software is built from well structured reusable components that adhere to design patterns.

The design pattern is the programmer's cliché, in that the world has seen it all before.

So when you're thinking about being creative and coming up with some fancy new algorithm, just remember that good ol' design pattern clichés are good.

What do you think? Is programming creative?

Wednesday, April 15, 2009

Business Balls for Leadership and Management

I just quickly need to mention BusinessBalls.com as it's an excellent repository of business and management articles, reference sheets and explanations.

If you're wondering why that staff member might not be motivated, what it takes to be a fantastic leader, how you should conduct that interview, or even if you're looking for some team building day icebreakers, this site has it. And some.

Thursday, April 09, 2009

Risk in Software Development.

I've been listening to some talks on financial markets and it's got me thinking about risk in software development.

Risk is everywhere in the software creation process.

For example, should you invest resource in writing formal user requirements specifications, functional specifications and acceptance test plans. Or do you risk the project overrunning when it doesn't quite do what the customer expects and you have to make a number of late changes?

Should you take time at the start of a small project to write unit tests before any other code. Or do you risk a drawn out testing phase later on?

In financial markets risk is measured using a number of statistical methods but how would you go about measuring the risk in the examples mentioned above?

If you know the customer that you are delivering the product to, you may know how forgiving (or not!) that they are. If you have a good relationship with the client you may be able to get away with a number of severity 3 or 4 bugs.

When dealing with an unknown customer assume the risk is high. And the larger the development, the larger the risk. With a high risk project you should aim to employ as many good software development practices as possible.

(Thanks to Esko for the excellent photo)

Tuesday, April 07, 2009

6 Free Tools that every Windows Programmer should Install

1. Unlocker

I've talked about unlocker before, it's basically a fabulous little utility that tells you which app is locking your file (and it normally says it's the TortoiseSVN cache which brings me neatly onto my next utility...)

2. TortoiseSVN

The code you produce at work is version controlled, so why isn't the code your make at home? TortoiseSVN is the best way of managing a home version control system as it's a really easy Windows Explorer plugin.

3. Dependency Walker

So you're developing a large application - and by large I'm talking tens or even hundreds of dlls.

You change the public interface on one of the non-dynmically loaded ones and, because you're in a hurry to get a build finished, only rebuild that dll.

Suddenly you can't start you app up any longer.

Dependency walker can tell you which other dlls need to be rebuilt so that they can interface with the changed dll.

4. Notepad++

You're not still using notepad to open .txt files are you?

Notepad++ is far better as it supports custom plugins and has macro recording, yet it still starts up in an acceptable time.

Of all of the freeware editors out there, this is my favourite as it behaves the most like Visual Studio when the Ctrl key is held down and your flicking from word to word.

Other alternatives to the Big Bad Pad are: PSPad or Programmer's file editor, but I've tried them both all I'm sticking with Notepad++.

5. Process Explorer

Want to know what's eating all your processor time? Download Microsoft's pimped-up task manager, Process Explorer.

6. AutoHotkey

There is generally thought to be a 10 fold difference in productivity between poor programmers and expert ones. I believe that this is in no small part down to the experts' use of keyboard shortcuts. Auto Hotkey allows you to set up hotkey scripts to control virtually anything.

Sunday, March 29, 2009

Gold Code

I'd previously written that working code is worth it's weight it gold. That is true, but it's only partially true.

Excellent code doesn't just work - proven through unit tests and structured manual testing - it is also written in an obvious way. Any old code monkey can take ownership of the code and quickly understand what it's meant to do and how it's meant to do it.

If they can't just pick it up and run with it then it's not gold standard software, It's probably tin, maybe bronze. Silver at a push. But certainly not gold.

Gold standard code uses no magic numbers, instead named constants are used. If magic number just have to be used, comments are mandatory.

Gold code is consistantly formatted throughout, commented where appropriate and has variable names that follow the 5 golden rules.

Golden code works and can easily be changed by anyone.

Wednesday, March 18, 2009

Gedanken Experiment - Removing Debt

This is the first post in a series of off-topic thought experiments inspired by the credit crunch.

Imagine a world with no debt.

I'm not talking about elimination of third world debt and Make Poverty History that Bono and his pals quite rightly support. I'm talking about the removal of debt as a concept. That is, no person or company ever owing any other any money.

But would it work?

How could it work?

The banks

Would banks be able pay interest on your deposits if they couldn't invest them?
Would banks even be allowed to take deposits off you, as one man's deposit is another man's debt - the banks will be in debt to you after taking your money!

So if banks can't take or lend any money, why would they even exist?

Bricks and Mortar

How would people buy houses if mortgages don't exist? Would people have to save until they can afford that first home? And how long would that take - 10 years? 20? It will certainly be less than the normal 25 years because no interest will be paid.

So where do they live for those 10 years? In rented accommodation, government provided accommodation, or in the family home. And, if they do rent, how does their landlord go about buying the property to then let it out again?

And where are all these savings kept until the house is bought? Without banks the only option would be to buy real objects: gold, oil, commodities that appreciate in price and can be sold on.


Company shares aren't really real are they? They're just a way of a company borrowing money off a bunch of investors. And by borrowing off a number of different investors they mitigate against the risk of one investor suddenly wanting all their money back. But there's that word again, "borrowing", so shares are out and so is the FTSE.

So what do you think? Here are just a couple of the problems with this radical idea, but could it really work?

Thursday, February 12, 2009

Gone Phising?

Clever Phising Scam?

I had a text earlier from a company claiming to be O2, it says,
Just to let you know, it's almost time to renew your contract. To hear your options please call free on 0800 902 0205

I immediately googled the number and found it on a website www.o2upgrade.co.uk. They've been quite clever with the website, linking to the main www.O2.co.uk domain and using the O2 logo whilst saying that the page is under construction. But they don't forget to mention that if you want to upgrade call the number 0800 902 0205.

Googling o2upgrade.co.uk led me to discover this page, a Digital Spy forum thread where it seems that the domain name isn't owned by O2, but in fact by a chap called Jeremy Gough. The Digital Spy forum users go on to contact O2's helpdesk who say that the site is not a fake.

Let me explain why they O2 it's not a fake.

How the industry works

There must be 30 million mobile phones in Britain now. If just half are on 12 or 18 month contracts (as opposed to pay as you go) then there could be as many as 10 million phones upgraded every year.

There are 5 major networks so, roughly speaking, they would have about 2 million phones to upgrade per year, per network. So, O2 could be upgrading as many as 10,000 users per working day.

It is simply not feasible for one company to upgrade that many phones per day without multiple warehouses and logistical-nightmare-stress-headaches. So they encourage other companies to do their distribution for them, by giving them cash-per-contact incentives.

I believe o2upgrade.co.uk is one of those companies.

So the good customer service people at O2 are saying it's not a fake because they know that o2upgrade.co.uk are convincing people to stay with O2 for another 18 months and O2 are reaping the benefit.

That said, I'm still not going to upgrade my phone with them.

Update: It seems that www.o2upgrade.co.uk now redirects to the O2 upgrade page. I don't know if that's because O2 now own the www.o2upgrade.co.uk site, or whether the owner has set up a redirector to make their page look more genuine. Interestingly, the O2 upgrade page doesn't feature the 0800 number they ask you to ring...

Sunday, February 08, 2009

Working with large data sets is hard

It seems that the most difficult problems in programming today are due to massive data sets and/or a relative lack of processing speed.

Memory is free so we've decided to store everything that we possibly can. And then we have problems analysing these massive data sets.

Google have attempted to solve the problem with their brilliant Map Reduce technique. This relies on having a number of cheap PCs on your network, and because of this, it scales well.

Anyone other than Google are a slave to the Big O.

If your algorithms aren't linear or nearly linear you're going to struggle when you want to run them over large data sets, and there's not a lot you can do about it other than throw processors at it.

Should you study Maths and Physics instead of Computer Science?

I completed my degree in Computer Science with Image and Multimedia in 2001. It seems that 2001 was quite a popular time for new computer science graduates.

However, it looks as though people are starting to move away from computer science degrees and I can only speculate that it's in favour of maths or physics instead.

Jobs requiring a good deal of maths knowledge are considered to be some of the best jobs that a human being can do.

So why do a computer science degree when you could get most coding jobs with a maths degree and have all these other options available as well?

Sunday, January 25, 2009

Web Development Supported by C++

I've just been working on an update for the Spring of Hope website. They are a charity that work with disabled children in Uganda, Africa.

I'd originally written the website in vanilla HTML and simply uploaded it, but I had to rethink my strategy after the charity's owner wanted to add a few pages to the site.

Simply adding a few new pages would have meant changing every existing page to link with the new pages - something that I didn't want to keep having to do. Instead I've written a small C++ application that loads the basic text required on each page, applies a standard header and footer to it, builds a menu, and outputs the HTML page.

A couple of hours work to make future updates simple.

Thursday, January 22, 2009

Unintentional Leadership

I was flying back from Philadelphia and just before take off I looked across to see a tall chap asking the the air hostess for a seat with more leg room. She told him there were none left.

Once the seat belt sign went out, a fella got up from his extra-legroom seat and went over to the tall chap to ask him if he wanted to swap. Of course the tall chap agreed, and the exchange happened.

I know this generous fella was a team leader as I'd seen him and his new team on the shuttle bus on the way out. They were heading out for a training session.

His team weren't sat next to him on the plane, but they were close enough to realise that their new boss would give up his precious extra-legroom seat for a stranger in need.

If he would do that for a complete stranger, what would he do for one of his colleagues, one of his team mates?

Now that's leadership, unintentional leadership.