Thursday, March 3, 2011

About planning and emergency

The title was inspired by Davide Bianchi, that posted out of his office a sign that reads "Pianificazione schifosa dalla tua parte non è emergenza dalla mia parte", which more or less means "if you don't know what planning is about, don't come here complaining, because I have my own priorities". Or, to quote something a little farther on the timeline, "frankly, my dear, I don't give a damn".


It is true that no plan survives the contact with the enemy, but planning is essential. It is one of the core practices of risk management, which, as Tom DeMarco and Timothy Lister write in Waltzing with Bears, is "Project Management for Adults". What are the risks? You have to look ahead, and decide how you want to deal with them. Of course hoping for luck is an option... but how good is it? Sometimes you can count on it, maybe because even if your luck abandons you it'll affect but a small portion of the whole project. But, honestly, do you really think that none of those twenty or thirty bad events is actually going to happen? Do you know what the odds are for a chance like this? I was pretty good at statistics, and as far as I can remember the answer is "very, very, very low".

And this is when emergency comes into play. And, obviously, as there were no risk mitigation plans, there are no contingency plans, and your luck is having a holiday, there is a problem. As strange as it may seem, this comes as a complete surprise to many.

When planning fails (if ever there was any) the hunting season for scapegoats open. Little matters the fact that the scapegoats themselves have spent a good part of the previous months asking for a plan, or at least for directions, and trying to raise alarms of all kinds. Don't think scapegoating is something you can ad-lib, it is an art: there is also an article about the art of scapegoating in IT projects. Wikipedia reports that "Scapegoating is a known practice in management where a lower staff employee is blamed for the mistakes of senior executives. This is often due to lack of accountability in upper management."

Unlike as in Davide's office, in my experience bad planning by someone else does transform into an emergency happily hopping and bouncing on your desk. At this point, at least in the eyes of the stakeholder, quality becomes absolutely tradable, because the deadline has stopped soaring and is swooping down on them. Too bad, as what seems a saving today will cost blood and sweat tomorrow (not in a month, but within a week). Ok, maybe not blood. But I can guarantee for sweat - and money. Moreover

poor Martin Fowler
will feel so sad for all that
which is way too bad

featuring both a haiku and a link to an interesting article at the same time.

Saturday, February 5, 2011

About the (health) insurance model

This week we started a new project which purpose is to provide with a brand new system a company that deals with group health insurance. The new software will be a powerful management tool that will help our customers to boost their operational efficiency, which is already improving thanks to some non-software interventions.

While trawling for requirements during the first interview I realized that the business model on which insurance companies are based is just the opposite of the so called freemium model, in which a few paying customers (tipically about 10% of the whole population of users) subsidize many non-paying users. Paying customers are not just giving their money away though (if anybody is seriously interested in that, they can immediatly contact me and I'll be glad to help them right away), as in return for their money they get premium features not available to normal users.

Insurance is just the opposite: many customers (actually every customer) regularly pay premiums that subsidize a small fraction of users. The premium feature in this case is the (possibly partial) payment of potentially very expensive health-related bills that maybe would not be affordable by a single person: when someone claims for damages which are included in their coverage policy, the company pays.

Health insurance is then a form of risk reduction for policy holders, even if unluckily it does not reduce the risk of getting ill; on the other hand, it is a sort of a gamble for insurance companies, that bet they will collect more money than they will have to pay. Naturally it is just like gambling in every casino: it is virtually impossible to break the bank, as the premiums are based on all the odds that we could possibly think of and even more. Plus a considerable profit margin, of course :-)

Friday, January 21, 2011

FTP in Java to an IFS folder

A couple of years ago I wrote about uploading files via FTP to a remote server, ending the post reminding about the Commons Net library. Well, the time has come for me to use it, having to upload a file to an IFS folder.

The naive approach didn't work:
@Test
public void basicTest() throws Exception {
URL url = new URL("ftp://user:pass@remoteserver/path/to/remote/folder/" + "outputFile.txt");
URLConnection urlc = url.openConnection();
OutputStream outputStream = urlc.getOutputStream();

String text = "oooooo sooooleee miiiiiiiooooooo.....";
InputStreamReader reader = new InputStreamReader(IOUtils.toInputStream(text));

int mychar = reader.read();
while (mychar != -1) {
outputStream.write(mychar);
mychar = reader.read();
}
reader.close();
outputStream.close();
}
as it returned the "550-Specified library does not exist or cannot be accessed." error. Too bad. After some investigations we found that before we could access the folder we were interested in we had to issue the "cd /" command. All right, I went for the commons:
@Test
public void commonsTest() throws Exception {

FTPClient ftp = new FTPClient();
ftp.connect("remoteserver");
ftp.login("user", "pass");

ftp.changeWorkingDirectory("/");
ftp.changeWorkingDirectory("path/to/remote/folder");

OutputStream outputStream = ftp.storeFileStream("outputFile.txt");

String text = "oooooo sooooleee miiiiiiiooooooo.....";
InputStreamReader reader = new InputStreamReader(IOUtils.toInputStream(text));

int mychar = reader.read();
while (mychar != -1) {
outputStream.write(mychar);
mychar = reader.read();
}

reader.close();
outputStream.close();

ftp.logout();
ftp.disconnect();
}
Obviously this code is simplistic and pretends that errors cannot happen, but it's just to grab the sense of it. We create an instance of the FTPClient class and connect to our remote server (after all we are dealing with sockets... does that ring a bell?), then we use the normal FTP commands to reach the folder we need. After getting an OutputStream, obtained with the storeFileStream(String filename) method, we do everything like in the previous example, then log out and disconnect from the server.

Saturday, January 8, 2011

What should we write about next?

While following a tweet I found an interesting article with links to some post-mortems (the title reads 25 but there are actually 32).

After a little a small form opened up on my screen:


I must admit I wouldn't know what to answer, this being the first time I ever landed onto this site. Yet, I think it is a very good idea, as it can give the authors interesting insights beyond analytics. I mean, numbers can give you hints (you can stop blogging about foo and bar as nobody ever reads that stuff) but nothing is as worth as an advice by someone that invests her time to follow your rants AND to give you feedback.

If someone is thinking "hey that's my blog, I know what to write next" that's ok. If someone is thinking "hey that's my blog, I know what to write next, I need no hints"... well, they don't need my advice :-)

So... what should we write about next?

Friday, January 7, 2011

Toto's Africa? They need no instruments!

Listen to Perpetuum Jazzile perform Africa!

Where does good code come from?

It is a good question, and apparently several people keep asking it. I found a a visual representation of the problem:


You can find the original here, with many other interesting comics.

The interesting thing is that it seems that coding right and coding fast are like oil and water (or, to quote from the Godfather part three, like money and friendship). But is it true?

At the beginning, it surely is. But, after applying - and applying, and applying, and repeating and repeating all over again - you will actually be able to code right AND fast. That's where katas come in handy. Who knows, you might also be able to exit the "are you done yet" switch before requirements change...

Monday, January 3, 2011

The Best Way to Use the Last Five Minutes of Your Day

The title refers to this very interesting article by Peter Bregman. The core of the post is clear, and it is the importance of retrospectives, which is well known by agile pratictioners.

The sentence that struck me the most is the following one:

I was once asked: if an organization could teach only one thing to its employees, what single thing would have the most impact? My answer was immediate and clear: teach people how to learn.


It was not the first time I read something like this, yet it was more evident to me because it perfectly agrees with what the Buzans say in How to Mind Map, which I've just finished studying (I should actually say "which I've just begun studying").

This also goes hand in hand with Tom Peters, that says that each organization should work to better the condition of its employees rather than trying to gain success, which is bound to come anyway if they followed this simple rule. He also presents a certain body of evidence, so he cannot possibly have gone nuts. All the contrary.

Is your organization teaching its employees how to learn? If it is, you're a lucky guy. If it's not, you can start looking for another company, or start working on the issue yourself. Or both.

In any case, that's not an excuse: the ultimate responsible for your education is you.