There are two types of programmers – the inside-out and the outside-in.
Let me illustrate using an example. Consider the game of bulls-and-cows. For those not aware of this problem see here.
Assume that the program that needs to be written is a version where the player tries to guess what the computer has randomly generated. At the core of the problem is the evaluator that compares two numbers, the generated number with the guessed number. Then there are other components, the interface, the random number generator, the user input and so on.
How do you begin? The inside-outer writes the core first and then does the rest. The outside-inner prepares the scaffolding and then writes the core. While there is no wrong or a right answer, the approach does indicate the thinking process going on within the programmer.
The inside-outer revels in the actual problem solving aspect of the code. Often having achieved the core the scaffolding does not get built and he may just lose interest in the problem. He programs for the thrill of solving a problem.
The outside-inner on the other hand builds the scaffolding, creates the super structure and the foundation and then attempts the core. He can show evidences of creationism as he goes along. The proof of the pudding takes a while to eat. There are possibilities that he may lose interest purely because of lethargy.
In both cases there is a distinct danger of non-completion. Which then is better? In the former case if the problem being solved is relatively difficult one, then even if the programmer disappears and program remains, there is a chance of salvage. At least the core is ready and can be used with some make-do.
In the latter case, this is not so. One has to get another fertile mind to complete the problem. So who is lurking inside you?
Some interesting problems, ye solvers can attempt.
- Bulls and cows
- Solving the Sudoku
- Automatic jig saw solver – CSI like where the lab puts together torn pieces of a note.