How do you build a house?
How do you make a clay pot?
How do you write an essay?
What is the common most basic way to answer those questions?
You get the right materials, and tools to construct the object.
Materials
house = bricks / wood / mortar / nails
clay pot = clay / water / glaze
essay = paper / ink / idea(Topic) / vocabulary / research
Tools
house = spades / hammer / saw /
clay pot = potters wheel / hands
essay = pen / command of the language used to write it / structure (introduction, conclusion, body)
It always amazes me to see how all house are built with the same things, but some are better then others. The are works of art while others you would not feel safe in and should be torn down. It comes down to the skill of the workers in using the materials and tools together and solve problems of building a house. Some houses are works of art, and that comes down to how well they can express their creativity with those components.
I would break down you problem into to areas. One is understanding the tools and materials you need to build a solution to a problem. In programing the material we use
at the simplest form is down to these things SSI (sequence, selection, iteration):
sequence = what order do you execute you instructions. Example from maths is (BODMAS) Brackets of Division multiplication, addition subtraction. You have to do some things before others.
selection = if statements, functions, methods how do you move around in your code
iteration = loops how do you repeat some thing.
Those are the building blocks, of a solution to any problem that can be expressed as code. Know you material, its strengths and weaknesses. How it works. This is the basics of all programing. It changes names from language to language but the essence remains the same.
The tools your computer, key board, monitor, compiler, text editor(IDE), API(application, programmers interface) and most importantly creativity / problem solving.
The place where a lot of new students struggle is with the problem solving. They have all these materials they just learnt about in sequence selection and iteration. They just don't see how to build the house or write the essay with them. The solution to that problem is to stop thinking about the material, ie do I use a loop
or an if statement
. You need to think much more abstractly about the problem. Break it down into the pieces.
- I need to print the contents of the file
- I need to get the name of file
- I need to get the file from the hard drive
- display the contents
- Ask the user to make a chose (delete, save, change)
- I need a menu to display the choices
- perform the action( delete, save, change)
It is too easy for new students to get bogged down in details and they do not clearly see how to solve a more complex problem that is longer then a few lines. Problems that require you to think about the over all structure of you code. It becomes difficult to see how you solve the problem(creatively) and with what you solve it with(code SSI). You don't solve the problem with the materials (SSI). You solve it with the right tools together with the materials.
When your start writing an essay you don't think about how long a sentence should be, what words to use. You think about the topic how you want to cover it, what sections you will break up the content into. Only after that do you sit down and think about the first sentence, the introduction paragraph, the conclusion paragraph. What words you are going to use. You know how to do this because you have practiced, you have been taught the components of an essay. Programing is no different.
On a different note. One of the best things you can do is learn to type faster, get a typing tutor. There are a number of free ones on the internet. This will help with every aspect of your problem solving, and using materials and experimenting with them. http://steve-yegge.blogspot.com/2008/09/programmings-dirtiest-little-secret.html