So the Champions League Final is over now and it was a disastrous success if I do say so myself.
Luckily I was sitting with my nose deep in Visual Studio almost expecting something to go wrong and rightly enough as soon as the clocked turned 20:45 and game started the feed flowed through my webapi service it broke the app somehow. So I quickly got that working and modified the feed cleverly. So that I could mingle the livescores feed with information of my own. Just so that it wasn’t a static feed that you could get anywhere! Of course it was extra work for me, it’s always good to add extra service and as I already had configurable news in the week up to the final it was a simlpe rewrite.
Simply prepending the desciption and I was in business with personalised messages during the game and at half time and of course during the following knucklebiting extra time and penalties. It ended up being a good decision
item.Description = ConfigurationManager.AppSettings["NewsLeft"].ToString().Replace(";", System.Environment.NewLine) + item.Description;
But then I hit extra time and another failing in my live feed. It didn’t give me the penalties!! So I was of course sitting at my computer anyway with code dripping offf my fingers. So a quick reconfiguration of my “NewsLeft” and “NewsRight” and I had my “live” penalties straight from my own bleeding fingers. Which straight after wrote a scathing email to my livescores provider, who said he had to do some configuring of his own to get the penalties in the feed again, but assured me they would be there next time… Configuration is apparently the name of the game! In hindsight I would have liked to be able to configure the refreshable ability as there is no point refreshing a static feed.
So here I was post Champions League Final and had my very own manually configured livescore app with the correct result and all the goal scorers plus the penalty scorers. Maybe I should update it with those who missed penalties aswell? I was really pleased with the response of the users and the amount of users from different countries was overwhelming: 31 countries on the night of the final, but users are still dropping in to see what the result was. So today, 6 days after that count is up to 47! Close to marketplace country saturation.
So I relax Sunday not doing much but psyching myself up to get going on my Euro 2012 app and enjoying the relative success of the app. Monday I get to work and open up the app to show off the result to my colleague who is also a Windows Phone developer and: CRASH! Nothing… Score 0 – 0 and no data for any of the teams. I start pulling my hair out trying to think what went wrong: can’t be configuration or an overwrite of something. I manage to boil it down to a coding exception that I hadn’t seen, which would have to wait till I get home.
Rushing home, quick wave to the wife and over to my computer to open Visual Studio and check out the code. And it was so obvious when I saw it. On the night I had had my nose so deep in the details of the news and penalties that I had failed to see the big picture: I had missed the loop which I was adding my configured news, that only added an item to the list if there was a goal and 24 hours after the match is finished my livescore is no longer live. So a simple move of the logic outside of this got me going again.
The moral of this story is: configuration and control is good and in some cases like here essential, but be wary of the context and remember to take a helicopter view of the code.
See you next week, hopefully with a new app ready for the Marketplace.