How to start as a computer programmer
By a_vaha1978
Computer programming is a very diverse and fascinating field to study. There are many concepts to learn and master. Learning how to be a good programmer takes time, patience and a willingness to sit behind a computer for long periods of time. If you find that you are not willing to sit behind a computer for hours at a time or if you find that your patience is short or if you find that you don’t have the time to dedicate to programming, then this field is clearly not for you. If on the other hand, you are patient and you can dedicate the time that it takes to become a good programmer, then you are ready to start the learning process of becoming a good or great programmer. You can even become a master at computer programming if your mind is sharp. But there are other people that for whatever reason are not good at programming and they have problems and difficulty. As I said earlier, there are lots of concepts to learn and some of these concepts are tough. I speak from my own experience because I am currently a computer science student at the community college near the area that I live. I am not even close to being a master programmer. I am pretty good at Java and I am just starting to learn C++. Computer programming and Information Technology is not for everyone. I think programming is technical and sometimes frustrating but it does have its benefits too. One of those benefits is the ability to create your own programs just like an artist has the ability to paint his or her own works.
If you have read this far, then I am assuming that you are ready to get started on the path to being a better programmer. This article will focus on C++. The first thing that you will need is to install a software program known as an IDE or integrated development environment. This article will talk about how to write a simple program in the C++ language. I use an IDE called Dev C++ because it is a simple one to use to write, compile and test programs to see if they produce the correct output on the screen. You can also use Microsoft Visual Studio 2010 although with that program, the files you will create will be much bigger and they will take up more space on your hard drive. Whatever IDE that you choose to use, that is your choice. But for a professional programming job at a company, employers use the Microsoft Visual Studio.
Having said that, let’s proceed to the next step. Once you get on the main screen, you have got to have 2 main pieces of information to start with. One of them is the include statement with the word iostream after it. And then on the next line, you can type the words include followed by cstdlib. This one is optional. You must also type the words using namespace std followed by a semicolon. The next thing that every program in C++ must have is a main method preceded by the word int. The main method or function is the only method or function that is automatically called when a program begins. It is not created by the programmer. Here is a sample of a simple program in C++ that you can start with as an example:
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
cout << "Good Morning.”;
system ("pause");
return 0;
}
The next concept to remember is that C++ just like any programming language must have opening and closing curly braces. These are the symbols { and }. If you want to type a single line of text as in the example above, you then need to type cout followed by the symbols <<. The cout stands for console output. This tells the compiler that it has to print output. Next, I would like to mention that since I am using the IDE Dev C++, I have to type in the word system followed by the word pause in parentheses and in quotation marks. Then I have to end the line with a semicolon. Typing the words system and pause in that manner makes it so that the program does not stop executing what it has to do. If you have the Microsoft Visual Studio Professional Edition, you do not need to do this.
Every programming statement requires a semicolon at the end. This is one of the most basic rules that any programmer should take the time to remember. If a statement lacks a semicolon at the end of the statement, the compiler will produce what is known as a syntax error. A syntax error is an error that violates the rules of a programming language.
The last part of a program has a return statement followed by the number 0. This is the standard for any program that you write in C++. There are no exceptions to this rule. At the end of the main method or function, you must have a closing curly brace so that the program knows that it is the end of the main function.
When you compile and test the program, the output on the screen will be the words good morning. This is just a simple program that will help get you started with C++.
Comments
Hello,
What kind of projects are you looking for? Because I'm in the process of designing tutorials which will be posted online.
I would like first to write a simple project to see just how they work, I have books on java, cafe, c++. As you state in your article it is tedious and calls for long hours at the computer. I don't have a problem with this. However I don't want to just read how to code book with out giving some examples of what can be done with the code other than that silly Hello program.
Sure. What I can do is come up with other examples. Thanks for your interest.
I would like to make a project that has a graphical interface. I'm more familiar with JAVA(like you) than C++. In JAVA I made some projects using SWING, but in C++, I don't know what is the "best" library ... Do you recommend any ?
platinumOwl4 11 months ago
Okay, thanks for this bit of information. However, what I am looking for is small and medium programming projects. I know the languages are tedious. Can you help or lead me to those who can? Looking forward to hearing from you.