Two things about America I never got used to: toilets and taxes.
Taking the former first, to me a toilet filled nearly to the brim is blocked. In America (or Florida at least) the toilets are full to the brim by default and then flushing drains the water away (in a nice whirlpool effect) at which point it refills. Seeing a full toilet is disconcerting. Also I wonder what sort of evaporation occurs: The room I was staying in listed the temperature as 75° F on the wall (which is 23 in UK money and felt a lot less). Surely that body of water with that much surface area must loose quite a bit?
The latter is to do with taxes. Take when I was moving into a new ‘apartment’ (self catering). I ask how much per night. The lady says ’49 dollars’. I say I would like 3 nights and hand over $150 in travellers cheques. She looks at me like I am mad and asks where the rest of it is. Apparently it is $49 plus taxes. And this is not an isolated incident. This happened a lot of times (even for a bottle of water). Why can’t you tell me what the cost is including taxes? I have to pay that amount anyway, and not being from around those parts I haven’t got the foggiest what the tax rate is and therefore have no idea what the final amount would be.
Finally the joke used to be that as soon as an American found out you were British they would immediately say Monty Python and ask if you knew the Queen. Now they mention Monty Python, Will & Kate and finally Jeremy Clarkson. Jeremy Clarkson?! As one of my American friends said: It’s a weird cultural niche that man has carved out for himself.
Back at work now after spending a week in America (should of been two but for work) for the final launch of the Space Shuttle Atlantis. An amazing experience and such a shame that due to a mixture of mismanagement and meddling it will never be seen again.
(And my apologies for not updating for such a long time.)
My suggestions to a client on improving their legacy code.
- Move all source code from VSS into TFS.
- Ensure all code needed to compile is within the workspace.
- Ensure all dependencies are correct so compilation of any one module will automatically compile needed dependencies for that module.
- Add UnitTest++ (or CppUnit – whatever floats your boat) to project.
- Add Log4Cxx to project – more man-hours have gone into writing this than your own system.
As you develop new code or extend older code:
- Move the logical projects into folders. Create another physical project alongside this project. Usually you will call this Test or Tests.
- For each module you are editing in add a c++ source file in the test project. Format for this will be Test.cpp.
- Write the test for the part you are changing, this should be as concise as possible. See Feathers “Working Effectively with Legacy Code” and Kerivsky “Refactoring to Patterns” books for tips.
- Use Msbuild for automated building of source. This will build all code, every time, and warn of errors and can even bundle things into installers, etc.
- Turn on treat warnings as errors and fix.
- Get a static analysis tool and slowly fix the errors (only about 20 are relevant – the rest are pedantic).
- Make everyone use “Convert tabs to spaces” and set to 4. (HICPP)
- All if and else statements must be enclosed in braces, even if a single line. (HICPP)
- Apply SOLID principles to code (Single responsibility, Open/Closed, Liskov Substitution, Interface, Dependency Inversion).
- Evangelise to others in team.
- You should be able to get ~1,500 unit tests per second.
- Some things you can’t test (UI, threading) so try to separate code from logic at test that (DoSomethingUI and DoSomething, and read The Humble Dialog Box).
- It will seem at first you will be writing a lot of extra code with tests and refactoring, but stick with it.
Did I miss anything?
It has been a long time since I posted. Mainly due to work and a lack of excitement to write about.
I am writing this on my HTC Desire phone which less than 24 hours ago deleted all my text messages, some 6,000 in total. Most were boring ‘What time will you be home?’ type messages but some were important (pictures of my cat that passed away earlier this year, addresses, etc.).
This fault has been around since 2009 and if you do a Google search for ‘android deleted all text messages’ the amount of results are frightening. The issue on the Android issues forum has 760 (at the moment) posts complaining about this problem but it has only been given Medium priority. Part of the problem is that people don’t have the sdk installed to get the debug info once it occurs and since it seems entirely random it is nigh impossible to reproduce.
So I now have a backup plan in place (shouldn’t the message system have that to begin with?) but no way of recovering those lost memories.
I think I have been burnt too many times by Android now. Apple have had a few problems but nothing as major as deleting all a users texts and when Apple do have publicized issues the are fixed fairly quickly.
I thought briefly about getting up to watch the F1 but decided that I would record it and watch it a more humane hour. So at 9.30 I got up, made a strong cup of coffee and sat down to watch the F1. Then, thanks to a delayed start the beeb decided to switch channels late in the race. My Sky+ box isn’t intelligent enough to detect this so I missed the end of the race. Never fear – that’s what the BBC iPlayer is for – making the unmissable unmissable. So at the end of the recording I fire up my PC, head over to the iPlayer site and guess what. They have Part1 available and the Forum – the extra hour that analyses the race and gets interviews with the drivers around the paddock – but not Part2. And they didn’t tack it to the end of Part 1 because I checked.
They’ve had 4 hours so far to get part 2 online and even less to get the forum uploaded – yet they managed that. Where is part 2?
Update 15:14: Part 2 is now online but not available to download – and my Sky broadband is appalling at streaming video.
Updates are supposed to bring about improvements but the latest Android updates have been a definite step backwards.
Bizarrely, Christmas Mince Pies are for sale in Sainsbury’s. Best before end 11 Nov.
Would of been Gizmos birthday if she was still with us.
Still miss the little one.
Just looking at where Google would have me walk to get to a local dry cleaners. It’s literally across the bridge an turn right and that isn’t taking into account turning off early and heading across the park. Surely some enterprising Googler could add a feature where pavements and cycle paths could be manually added and voted on for reliability?
Employ me and I would do it for you!
This weekend was the running of the British 24hrs at Teesside Autodrome. For those of you who followed the first 6 hours on Twitter (until my charge ran out) then you know we were way down the rankings at the start of the race. Our break came in the early hours of the morning when I did a couple of 1.5 hr stints and managed to push us above the surrounding competition and to the next level. The final results still haven’t been published on the Teesside Karting website but by my calculations we ended up 50th overall and I managed to set my best lap time of 1.21.508 during my 6am stint. It’s a pity that the overall laps of everyone isn’t recorded.
The past few days have been agony for me. First I was hit by a wave of tiredness (I had very little sleep – mainly a few minutes dozing) then the following day the aches and pains kicked in followed by another wave of tiredness (spent most of the Monday asleep). Yesterday started off painfully but by the end of the day (and several Ibuprofen/Paracetamol later) I wasn’t feeling too bad. Today just my floating ribs hurt.
I would really like to take part in the full championship and have a competitive kart, but the hire karts aren’t too shoddy since some of the teams were putting in sub 1.20 lap times. I guess to get below the 1.21 mark I need to lose a few kilos around my middle and improve my overall fitness.