home Next view contents in a pop up window
Few things about C++
Many people get scared when they hear about programming. They view it as something that is beyond their abilities. "Oh he is smart he is a computer programmer!". I used to say the same thing until I actually sat in front of my computer and did some programming.
Who is the dumbest? Its you and the computer having a one on one talk. The biggest virtue that a computer has is that it is dumb. It can only do what you have told it to do. No more no less. It can not guess what you want. You have to tell it what you want. A computer does not have the ability to be subjective. There is only white and black for it. When it will encounter a "color" other than white or black, it will tell you about it. When a computer does not understand you, its not its fault but yours. Remember the computer is the dumb one and you are the smart one. As you possess the higher IQ you must learn how to talk on the computer level. Being that you possess the higher IQ it should not be difficult to learn the language of your dumb companion (the computer). Remember, its either black or white.
Baby-steps: Lets say for example that you want to instruct your computer to go from point A to point E. You can't simply say to it "Ok here are your variables go to point E". In order for it to reach point E, you must first instruct it to pass through points B then C then D and then finally the computer will be able to reach point E. BABY-STEPS.
The rule of KISS: I am taking the phrasing of this rule from a book of which I cannot remember the title. KISS stands for KEEP IT SIMPLE STUPID. You may have the urge to impress your self or your boss or your instructor by writing complex code. Always try to write your code with as much simplicity as possible.
The reasons?
a) Easier (for you and others) to read the source code after its completion.
b) Easier to return back to correct errors, maintain it, or add more lines of code.
c) The simpler the code is the fewer chances for an error to occur.
d) If you are forcing the computer to be going back and forth within your complex source code, you are forcing it to use more resources (CPU time and RAM space). Thus creating what we call a "Hug resource program" which means it runs slow and uses too much of the computers resources with no good reason. ALWAYS USE WHAT IS NEEDED. NO MORE NO LESS.
PRACTICE PRACTICE PRACTICE PRACTICE: Did I mention that you should practice? Well then you should PRACTICE. You may have understood how a set of commands work, or the syntax of a new set of commands. This does NOT mean that you will be able to apply it in a program one hour after you understood it. You might find your self having a blank stare on your monitor saying to your self " Well damn! I know how it works but HOW and WHERE can I apply it? Oh crap I cant remember the syntax". Trust me it has happened to me during midterm exam and the grade was not pretty. You have been warned.
That is all the advice I can give you. Fallow these simple rules and you will find your self mastering what you thought to be a beast --C++--.