Because of the difficulty of working with low-level languages, high-level languages were developed to make it easier to write computer programs. High level programming languages create computer programs using instructions that are much easier to understand than machine or assembly language code because you can use words that more clearly describe the task being performed. Examples of high-level languages include FORTRAN, COBOL, BASIC, PASCAL, C, C++ and JAVA.
C and C++ are two separate, but related programming languages. In the 1970s, at Bell Laboratories, Dennis Ritchie and Brian Kernighan designed the C programming language. In 1985, at Bell Laboratories, Bjarne Stroutrup created C++ based on the C language. C++ is an extension of C that adds object-oriented programming capabilities.
What is Syntax?
A programming language’s syntax is the set of rules for writing grammatically correct language statements. In practice this means a C statement with correct syntax has a proper form specified for the compiler. As such, the compiler accepts the statement and does not generate an error message.
The C Programming Language
C was used exclusively on UNIX and on mini-computers. During the 1980s, C compilers were written for other platforms, including PCs.
To provide a level of standardization for C language, in 1989, ANSI created a standard version of C that is called ANSI C.
One main benefit of the C language is that it is much closer to assembly language other than other types of high-level programming languages.
The programs written in C often run much faster and more efficiently than programs written in other types of high-level programming language.
The C++ Programming Language
C++ is an extension of C that adds object-oriented programming capabilities. C++ is a popular programming language for writing graphical programs that run on Windows and Macintosh.
The standardized version of C++ is commonly referred to as ANSI C++.
The ANSI C and ANSI C++ standards define how C/C++ code can be written.
The ANSI standards also define run-time libraries, which contains useful functions, variables, constants, and other programming items that you can add to your programs.
The ANSI C++ run-time library is also called the Standard Template Library or Standard C++ Library.
Structured Programming and Object Oriented Programming
During the 1960s, many large software development effects encountered severe difficulties. Software schedules were typically late, costs greatly exceeded budgets and finished products were unreliable. People began to realize that software development was a far more complex activity than they had imagined. Research activity in the 1960s resulted in the evolution of structured programming – a discipline approach to writing programs that are clearer than unstructured programs, easier to test and debug and easier to modify. Chapter 5 discusses the principles of structured programming. Chapters 2 through 6 develop many structured programs.
One of the more tangible results of this research was the development of the Pascal programming language by Niklaus Wirth in 1971. Pascal was designed for teaching structured programming in academic environments and rapidly became the preferred programming languages in most universities.
In the 1980s, there is a revolution brewing in the software community: object- oriented programming. Objects are essentially reusable software components that model items in the real world. Software developers are discovering that using a modular, object-oriented design and implementation approach can make software development groups much more productive than with previous popular programming techniques such as structured programming.
Object-oriented programming refers to the creation of reusable software objects that can be easily incorporated into another program. An object is programming code and data that can be treated as an individual unit or component. Data refers to information contained within variables, constants, or other types of storage structures. The procedures associated with an object are referred as functions or methods. Variables that are associated with an object are referred to as properties or attributes. Object-oriented programming allows programmers to use programming objects that they have written themselves or that have been written by others.