Archive for the 'Application Development' Category
Why It Doesn’t Work.
Have you ever been in a IT workplace where a deadline is approaching and management come up with the idea that if you work twice as fast, the job can still be bought in on time. You probably know it won’t work, but have a real hard time explaining that fact to them.
Where they are coming from is usually a business background. Say a call center, sales or some people oriented skill area where you can reasonably ask people to make twice as many phone calls a day. Just get them to cut short the chatter and just push a little harder.
In a lot of jobs this works and they don’t understand why it doesn’t work in IT. In fact in this day and age most people in IT are not really IT people either and don’t understand the issue enough to explain to their customers.
The reason is thinking time. You can’t speed up the rate that you think. You can speed up the rate you move your arms, talk, move boxes, answer phones etc. Thinking though occurs at finite rate no matter how much of a rush you are in.
To see this, and perhaps get them to understand the problem, give them a pair of three digit numbers and ask them to multiply them together.
Now ask them to multiply another pair of three digit numbers in half the time.
To do the latter they will probably make a mistake.
It’s just like cutting code. The programmer is making thousands of mental, quite often mathematical decisions per unit time. They also are most likely totally engrossed and already running at maximum speed. Which means they are probably in what some call “coders burn”, it’s a sort of “groove” to misuse a 60′s saying where you just loose time as you convert the picture of the software in your head into code.
The trouble is you can not speed things up unless you reduce the number of decisions the coder is making, and that means bugs.
January 16 2009 | Application Development | No Comments »
For when your generic template, isn’t so generic…
In order to solve the problem of how to handle XML strings which are in a very real sense the containers for integers, doubles and various other data I needed a way of calling a different getter() from the class I am using to abstract the XML.
The first attempt was to derive a specialised stream from std::basic_stringstream that would handle strings in a different way to how stringstream handled them. The problem I bumped into was operator hiding. The modified stream was able to handle the string case, but lost all the floats, doubles, chars, shorts, voids, files, etc etc etc. Doh!!
The solution I came upon was to specialise the template class that I am using to abstract the XML attributes and elements. A more readable description of how to do template specialisation can be found here. The quick summary is below.
continue reading »
January 06 2009 | Application Development | No Comments »
Think First….
Before you do this have a think about why you want to subclass std::stringstream. If like me you want to override the iostream then read no further because as pointed out here, the derived class will hide all the same operators of the base class.
But lets say you want to extend std::basic_stringstream. Then the following should work. It is only a trivial derivation. You will need to add your own methods to extend it.
continue reading »
January 06 2009 | Application Development | No Comments »
Overriding Standard Template Gotcha.
This is one that will bite you one day. You will have a need to override one of the standard template library stream functions. In my case it was to handle strings retrieved from XML differently to how I was handling numeric data stored within the XML string. I wanted to simply pass through strings for XML attributes and elements that contained strings, and I wanted to convert other types appropriately.
The natural way to do this is to think OK lets simply over ride the io operators to call different versions in the case that we have strings.
So you will spend a day working out how to override std::stringstream only to find it doesn’t work…..
The reason is demonstrated in the following code. When you derive one class from another you will find the operators from the base class are hidden.
continue reading »
January 06 2009 | Application Development | No Comments »
The Movable Window
Don’t you hate it when you have been using Visual Studio for so long you can recall Quick C, although at the time Turbo C++ was the sexy cousin.
Then all of a sudden you discover you can move the build error list, watch list etc out of the environment and over to your second screen….
I mean how did I not discover this! StrawberryFields 1.0 is 150,000 lines of code and StrawberryFields 2.0 is making that look small. Do you have any idea how many times I have done the Build->BatchBuild sequence, resized the output window and fiddled around looking for errors…..
Live and learn
January 05 2009 | Application Development | No Comments »