Am I just super-inteligent, or are the skills required to get into IT not what they where when I was a lad .....
I had a case a couple of months ago where I was writing an app for a client.
The client 'amended' the specs midway though (as is their will !), requesting a 'configuration' option. They wanted to be able to turn various flags on and off to affect the operation. What they did not want was a load of variables in the source code as they felt they would change the parameters reasonably frequently and did not want to recompile code etc. They also did not want config files and the like.
The solution I proposed and implemented was to use a 'spare' field in one of the DB tables that the app interacts with. There was one spare numeric field available 64 bits wide. Nice, 64 config options (even though today they only need 8) - lots of scope for future development.
So, the solution is to assign each bit position as a config option. Then the app looks at the value in the field, and does logical ANDs to determine if a given option is enabled.
How easy can it be ?
But I had 2 (younger) colleagues who just could not understand it !
If OptionA was bit 1, OptionB was bit2 and OptionC was bit3; you would AND the field value with 1, 2 and 4
They could not understand this , and would say things like "if the field value is 4 then OptionC is enabled". Whilst that is true, they just could not understand that OptionC would be enabled if the value was 4, 5, 6 or 7 !!
AND is probably the easiest logical operator to get your head round; and they could not grasp it !
What do they teach them these day ?
I had a case a couple of months ago where I was writing an app for a client.
The client 'amended' the specs midway though (as is their will !), requesting a 'configuration' option. They wanted to be able to turn various flags on and off to affect the operation. What they did not want was a load of variables in the source code as they felt they would change the parameters reasonably frequently and did not want to recompile code etc. They also did not want config files and the like.
The solution I proposed and implemented was to use a 'spare' field in one of the DB tables that the app interacts with. There was one spare numeric field available 64 bits wide. Nice, 64 config options (even though today they only need 8) - lots of scope for future development.
So, the solution is to assign each bit position as a config option. Then the app looks at the value in the field, and does logical ANDs to determine if a given option is enabled.
How easy can it be ?
But I had 2 (younger) colleagues who just could not understand it !
If OptionA was bit 1, OptionB was bit2 and OptionC was bit3; you would AND the field value with 1, 2 and 4
They could not understand this , and would say things like "if the field value is 4 then OptionC is enabled". Whilst that is true, they just could not understand that OptionC would be enabled if the value was 4, 5, 6 or 7 !!
AND is probably the easiest logical operator to get your head round; and they could not grasp it !
What do they teach them these day ?
Comment