您的位置:首页 > 编程语言 > C语言/C++

Effective C++阅读笔记(2)Item 1: View C++ as a federation of languages

2012-11-01 09:27 495 查看

Item 1: View C++ as a federation of languages

Today's C++ is amultiparadigm
programming language, one supporting a combination ofprocedural,

object-oriented,functional,
generic, andmetaprogramming
features. This power and flexibility make C++ a tool without equal, but can also cause some confusion. All the "proper usage" rules seem to have exceptions.

The easiest way is to view C++ not as a single language but asa federation of related languages.To make sense of C++,
you have to recognize its primary sublanguages. Fortunately, there are only four:

C Way down deep, C++ is still based on C
Object-Oriented This part of C++ is what C with Classes was all about: classes (including constructors and destructors),
encapsulation, inheritance, polymorphism, virtual functions (dynamic binding), etc.
Template C++ This is the generic programming part of C++.
The STL The STL is a template library

Keep these four sublanguages in mind

C++, then, isn't a unified language with a single set of rules; it's afederation
of four sublanguages, each with its own conventions. Keep these sublanguages in mind, and you'll find that C++ is a lot easier to understand.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐