May 30th, 2002, 09:07 PM
Newbie Programmer's tips
Those who have recently started programming should keep these tips in mind. It is specially useful for those newbie programmers who have recently started learning a C like programming language.
1) Whenever you start learning a programming language first of all learn the reserved words of that language. Reserved words are those words that have special meanings for the compiler. Ex. int, char, if, else, for, while etc. are used in C.
2) Learn the syntax of the statements or functions like printf, scanf etc. The syntax is a correct usage of the statements and functions like those mentioned above.
3) When you see a complete program then each and everything has a meaning. Try to understand all the meanings of the statements and functions. Ex. printf (My name is John); printf function has a purpose; to print everything enclosed within the quotes . i.e. My name is John.
4) Most of the structured programs have the format: Input Processing Output.
scanf ( ) function is an input function that accepts a value ( integer, float or character). Eg. scanf(%d %d,&a,&b); here scanf( ) accepts the values of a and b. & (ampersand) before each variable is important for each variable to be accepted (inputted) correctly.
Processing part involves calculations like c = a + b;
Output part uses the printf( ) function to display the result on the screen. E.g. printf(%d,c); this statement simply prints the value of c. %d is called a format specifier and %d represents an integer to be printed if it is used in printf.
5) When you are making your own program logic, think like a computer. H The way a computer is going to evaluate your logic. A computer would execute your program statement by statement. The normal sequence of execution changes when you use a goto statement or any other transfer of control statement like if, if-else, for, while, do-while, switch statements. Learn the syntax and use of each one of these and try to use these in your programs to practice more.
6) Try to make your own programs as often as you can, that will enrich you with the correct use of the statements. When you compile (and debug) a program, you might get some errors. Learn from these error messages. These error messages are very helpful. Read them carefully. This will help you in your future programming in C or any other programming language. A long time investment.
7) Functions are segments of a program. These parts can be used in your programs. Functions can be either made by you or can be picked up from the library. The library is included in the program with the #include statement. printf and scanf are functions pre-defined in stdio.h file. Extension h stands for a header file.
A long one isn't it?
With great power comes great responsibility.
May 31st, 2002, 03:17 AM
Thanks alot man! Thanks for your time! I'll that in mind! Thank you! I'm happy!
Got any books to reccomend?
[gloworange]Die, or surrender, either way won\'t work.[/gloworange]
May 31st, 2002, 05:41 AM
Nice post! Comes in handy that's for sure.
May 31st, 2002, 12:28 PM
A lot of this is fairly obvious though, you don't have any choice as to learning the syntax of programming languages so it's not a tip to tell people to do so. If you use a reserved word or incorrectly call an unnamed function then the compiler will generate an error message.
Some good tips for absolute newbies though I suppose...
June 2nd, 2002, 06:35 AM
I learnt all this the hard way, so it's nice to see someone helping newbies out.
June 2nd, 2002, 02:11 PM
Hmm, this was posted a while ago, but in the form of a song...
I prefer this version though, well done.
June 2nd, 2002, 03:31 PM
this should help me out a bit, thanks.
June 2nd, 2002, 03:38 PM
Attitude is a small thing that makes a BIG difference.
June 8th, 2002, 01:32 PM
Hey huntx! Out of all the c/c++ books I liked books from Robert Lafore. Waite Group's Object oriented programming in Turbo c++ is excellent for c++ programming. You will also find c programming books from the same publisher. Turbo c is also well written, in a simple yet elegant manner.
With great power comes great responsibility.
June 8th, 2002, 07:51 PM
And a quick note to add:
It's good to always always always (it's habit forming if you don't) //comment nearly everything that it makes sense to comment. Otherwise you might make a program, and a month later spend way too much time trying to figure out how you did it and what a certain function was for.
[HvC]Terr: L33T Technical Proficiency