Студопедия Главная Случайная страница Обратная связь

Разделы: Автомобили Астрономия Биология География Дом и сад Другие языки Другое Информатика История Культура Литература Логика Математика Медицина Металлургия Механика Образование Охрана труда Педагогика Политика Право Психология Религия Риторика Социология Спорт Строительство Технология Туризм Физика Философия Финансы Химия Черчение Экология Экономика Электроника

Find the answers to these questions in the text below.





 

1) Since when has C++ become the most popular commercial programming language?

2) What was it designed for? What rules were used to create it?

C++ PROGRAMMING LANGUAGE

C++ (pronounced "see plus plus", IPA: /si plʌs plʌs/) is a general-purpose computer programming language. It is a statically typed free-form multi-paradigm language supporting procedural programming, data abstraction, object-oriented programming, and generic programming. Since the 1990s, C++ has been one of the most popular commercial programming languages.

In The Design and Evolution of C++, Bjarne Stroustrup describes some rules that he uses for the design of C++. Knowing the rules helps to understand why C++ is the way it is. The following is a summary of the rules.

C++ is designed to be a statically typed, general-purpose language that is as efficient and portable as C

C++ is designed to directly and comprehensively support multiple programming styles (procedural programming, data abstraction, object-oriented programming, and generic programming)

C++ is designed to give the programmer choice, even if this makes it possible for the programmer to choose incorrectly

C++ is designed to be as compatible with C as possible, therefore providing a smooth transition from C

C++ avoids features that are platform specific or not general purpose

C++ does not incur overhead for features that are not used

C++ is designed to function without a sophisticated programming environment

 

12. Study the text below and complete the table

 

THE DIFFERENCES BETWEEN C & C ++

  C C ++
     
     
3, 4..    

The C++ programming language was originally derived from C. However, not every C program is a valid C++ program. As C and C++ have evolved independently, there has been an increase in the number of incompatibilities between the two languages. The latest revision of C, created a number of additional conflicting features. The differences make it hard to write programs and libraries that are compiled and function correctly as either C or C++ code, and confuse those who program in both languages. The disparity also makes it hard for either language to adopt features from the other one.

Bjarne Stroustrup, the creator of C++, has repeatedly suggested that the incompatibilities between C and C++ should be reduced as much as possible in order to maximize inter-operability between the two languages. Others have argued that since C and C++ are two different languages, compatibility between them is useful but not vital; according to this camp, efforts to reduce incompatibility should not hinder attempts to improve each language in isolation.

Today, the primary differences (as opposed to the additions of C++, such as classes, templates, namespaces, overloading) between the two languages are:

inline — inline functions are in the global scope in C++, and in the file (so-called "static") scope in C. In simple terms, this means that in C++, any definition of any inline function (but irrespective of C++ function overloading) must conform to C++'s "One Definition Rule" or ODR, requiring that either there be a single definition of any inline function or that all definitions be semantically equivalent; but that in C, the same inline function could be defined differently in different translation units (translation unit typically refers to a file). (Note that Microsoft C++ compilers define inline functions as C99 ones)

The bool type in C99 is in its own header, <stdbool.h>;. Previous C standards did not define a boolean type, and various (incompatible) methods were used to simulate a boolean type.

Single character constants (enclosed in single quotes) have the size of an int in C and a char in C++. So in C sizeof 'a' == sizeof(int) whereas in C++ sizeof 'a' == sizeof(char). Nevertheless, even in C they will never exceed the values that a char can store, so (char)'a' is a safe conversion that will only change the type of the expression (here it is changed from int to char), but not its value (which on systems using ASCII-encoded characters is 97).

Additional keywords were introduced in C++, and thus they cannot be used as identifiers as they could in C. (for example, try, catch, template, new, delete,...)

In C++, the compiler automatically creates a "tag" for every struct, union or enum, so struct S {}; in C++ is equivalent to typedef struct S {} S; in C.

C99 adopted some features that first appeared in C++. Among them are:

Mandatory prototype declarations for functions

The inline keyword

The removal of the "implicit int" return value

13. Read the texts to find out the answers to these questions

 

1) What derivative is Java of?

2) What was Java targeted first? Why was it retargeted for the Web?

3) What primary goals were there in creation of Java language?

4) Is Java still as popular as it was before? Where is it mostly used nowadays?

 







Дата добавления: 2015-10-15; просмотров: 829. Нарушение авторских прав; Мы поможем в написании вашей работы!




Картограммы и картодиаграммы Картограммы и картодиаграммы применяются для изображения географической характеристики изучаемых явлений...


Практические расчеты на срез и смятие При изучении темы обратите внимание на основные расчетные предпосылки и условности расчета...


Функция спроса населения на данный товар Функция спроса населения на данный товар: Qd=7-Р. Функция предложения: Qs= -5+2Р,где...


Аальтернативная стоимость. Кривая производственных возможностей В экономике Буридании есть 100 ед. труда с производительностью 4 м ткани или 2 кг мяса...

Мотивационная сфера личности, ее структура. Потребности и мотивы. Потребности и мотивы, их роль в организации деятельности...

Классификация ИС по признаку структурированности задач Так как основное назначение ИС – автоматизировать информационные процессы для решения определенных задач, то одна из основных классификаций – это классификация ИС по степени структурированности задач...

Внешняя политика России 1894- 1917 гг. Внешнюю политику Николая II и первый период его царствования определяли, по меньшей мере три важных фактора...

Именные части речи, их общие и отличительные признаки Именные части речи в русском языке — это имя существительное, имя прилагательное, имя числительное, местоимение...

Интуитивное мышление Мышление — это пси­хический процесс, обеспечивающий познание сущности предме­тов и явлений и самого субъекта...

Объект, субъект, предмет, цели и задачи управления персоналом Социальная система организации делится на две основные подсистемы: управляющую и управляемую...

Studopedia.info - Студопедия - 2014-2025 год . (0.013 сек.) русская версия | украинская версия