Anda di halaman 1dari 3

Programs

Nowadays computers are able to perform many different tasks, from simple mathematical operations to sophisticated animated simulations. But the computer does not create these tasks by itself, these are performed following a series of predefined instructions that conform what we call a program. A computer does not have enough creativity to make tasks which it has not been programmed for, so it can only follow the instructions of programs which it has been programmed to run. Those in charge of generating programs so that the computers may perform new tasks are known as programmers or coders, who for that purpose use a programming language.

Programming languages
A programming language is a set of instructions and a series of lexical conventions specifically designed to order computers what to do. When choosing a programming language to make a project, many different considerations can be taken. First, one must decide what is known as the level of the programming language. The level determines how near to the hardware the programming language is. In the lower level languages, instructions are written thinking directly on interfacing with hardware, while in "high level" ones a more abstract or conceptual code is written. Generally, high level code is more portable, that means it can work in more different machines with a smaller number of modifications, whereas a low level language is limited by the peculiarides of the hardware which it was written for. Nevertheless, the advantage of low level code is that it is usually faster due to the fact that it is indeed written taking advantage of the possibilities of a specific machine. A higher or lower level of programming is to be chosen for a specific project depending on the type of program that is being developed. For example, when a hardware driver is developed for an operating system obviously a very low level is used for programming. While when big applications are developed usually a higher level is chosen, or a combination of critic parts written in low level languages and others in higher ones. Although there are languages that are clearly thought to be low level, like Assembly, whose instruction sets are adapted to each machine the code is made for, and other languages are inherently high level, like the Java, that is designed to be totally independent of the platform where is going to run. The C++ language is in a middle position, since it can interact directly with the hardware almost with no limitations, and can as well abstract lower layers and work like one of the most powerful high level languages.

Why C++?
C++ has certain characteristics over other programming languages. The most remarkable are: Object-oriented programming The possibility to orientate programming to objects allows the programmer to design applications from a point of view more like a communication between objects rather than on a structured sequence of code. In addition it allows a greater reusability of code in a more logical and productive way. Portability You can practically compile the same C++ code in almost any type of computer and operating system without making any changes. C++ is the most used and ported programming language in the world. Brevity Code written in C++ is very short in comparison with other languages, since the use of special characters is preferred to key words, saving some effort to the programmer (and prolonging the life of our keyboards!). Modular programming An application's body in C++ can be made up of several source code files that are compiled separately and then linked together. Saving time since it is not necessary to recompile the complete application when making a single change but only the file that contains it. In addition, this characteristic allows to link C++ code with code produced in other languages, such as Assembler or C.

C Compatibility C++ is backwards compatible with the C language. Any code written in C can easily be included in a C++ program without making any change. Speed The resulting code from a C++ compilation is very efficient, due indeed to its duality as high-level and low-level language and to the reduced size of the language itself.

C++ Language FAQ


What is C++? C++ is a programming language. It literally means "increased C", reflecting its nature as an evolution of the C language. Is it necessary to already know another programming language before learning C++? Not necessarily. C++ is a simple and clear language in its expressions. It is true that a piece of code written with C++ may be seen by a stranger of programming a bit more cryptic than some other languages due to the intensive use of special characters ({}[]*&!|...), but once one knows the meaning of such characters it can be even more schematic and clear than other languages that rely more on English words. Also, the simplification of the input/output interface of C++ in comparison to C and the incorporation of the standard template library in the language, makes the communication and manipulation of data in a program written in C++ as simple as in other languages, without losing the power it offers. How can I learn C++? There are many ways. Depending on the time you have and your preferences. The language is taught in many types of academic forms throughout the world, and can also be learnt by oneself with the help of tutorials and books. The documentation section of this Website contains an online tutorial to help you achieve the objective of learning this language. What is OOP: Object-oriented programming? It is a programming model that treats programming from a perspective where each component is considered an object, with its own properties and methods, replacing or complementing structured programming paradigm, where the focus was on procedures and parameters. Is C++ a proprietary language? No. No one owns the C++ language. Anyone can use the language royalty-free. What is ANSI-C++? ANSI-C++ is the name by which the international ANSI/ISO standard for the C++ language is known. But before this standard was published, C++ was already widely used and therefore there is a lot of code out there written in prestandard C++. Referring to ANSI-C++ explicitly differenciates it from pre-standard C++ code, which is incompatible in some ways. How may I know if my compiler supports ANSI-C++? The standard was published in 1998, followed by a revision in 2003. Some compilers older than the standard implement already some of its features, and many newer compilers don't implement all ANSI-C++ features. If you have doubts on whether your compiler will be able to compile ANSI-C++ code, you can try to compile a piece of code with some of the new features introduced mainly after the publication of the

standard. For example, the following code fragment uses the bool type, and uses namespaces and templates.

1 #include <iostream> 2 using namespace std; 3 template <class T> 4 bool ansisupported (T x) { return true; } 5 6 int main() { 7 if (ansisupported(0)) cout << "ANSI OK"; 8 return 0; 9}

ANSI OK

If your compiler is able to compile this program, you will be able to compile most of the existing ANSI-C++ code. How can I make windowed programs? You need a C++ compiler that can link code for your windowing environment (Windows, XWindow, MacOS, ...). Windowed programs do not generally use the console to communicate with the user. They use a set of functions or classes to manipulate windows instead, which are specific to each environment. Anyway the same principles apply both for console and windowed programs, except for communicating with the user. What is Visual C++? And what does "visual programming" mean? Visual C++ is the name of a C++ compiler with an integrated environment from Microsoft. It includes special tools that simplify the development of large applications as well as specific libraries that improve productivity. The use of these tools is generally known as visual programming. Other manufacturers also develop these types of tools and libraries, like Borland C++, Visual Age, etc...

Anda mungkin juga menyukai