2.2 Programming Paradigms
Objectoriented programming is a technique for programming – a paradigm for writing ‘‘good’’
programs for a set of problems. If the term ‘‘objectoriented programming language’’ means anything, it must mean a programming language that provides mechanisms that support the objectoriented style of programming well.
    There is an important distinction here. A language is said to support a style of programming if
it provides facilities that make it convenient (reasonably easy, safe, and efficient) to use that style.
A language does not support a technique if it takes exceptional effort or skill to write such programs;
it merely enables the technique to be used. For example, you can write structured programs
in Fortran77 and object-oriented programs in C, but it is unnecessarily hard to do so because these
languages do not directly support those techniques.(说一种语言支持一种编程风格是直接的支持,就是语言中有专门的机制可以很方便的实现,C语言虽然不直接支持Class,但是不代表不可以用C去实现这个机制,但是这属于间接地支持。而c++中是直接支持)

    Support for a paradigm comes not only in the obvious form of language facilities that allow
direct use of the paradigm, but also in the more subtle form of compiletime and/or runtime
checks against unintentional deviation from the paradigm. Type checking is the most obvious example of this; ambiguity detection and runtime checks are also used to extend linguistic support for paradigms. Extralinguistic facilities such as libraries and programming environments can provide further
support for paradigms.

    One language is not necessarily better than another because it possesses a feature the other does
not. There are many examples to the contrary. The important issue is not so much what features a
language possesses, but that the features it does possess are sufficient to support the desired programming styles in the desired application areas:
    [1] All features must be cleanly and elegantly integrated into the language.
    [2] It must be possible to use features in combination to achieve solutions that would otherwise
        require extra, separate features.(有些问题需要使用多个特性结合解决)
    [3] There should be as few spurious and ‘‘specialpurpose’’features as possible. (特性应该是通用的)
    [4] A feature’s implementation should not impose significant overheads on programs that do                                                
        not require it.
    [5] A user should need to know only about the subset of the language explicitly used to write a
        program.
    The first principle is an appeal to aesthetics and logic. The next two are expressions of the ideal of
minimalism. The last two can be summarized as ‘‘what you don’t know won’t hurt you.’’

    C++ was designed to support data abstraction, object-oriented programming, and generic programming in addition to traditional C programming techniques under these constraints. It was not
meant to force one particular programming style upon all users.
    The following sections consider some programming styles and the key language mechanisms
supporting them. The presentation progresses through a series of techniques starting with procedural-programming and leading up to the use of class hierarchies in object-oriented
programming and generic programming using templates. Each paradigm builds on its predecessors, each adds something new to the C++ programmer’s toolbox, and each reflects a proven design approach.
    The presentation of language features is not exhaustive. The emphasis is on design approaches
and ways of organizing programs rather than on language details. At this stage, it is far more
important to gain an idea of what can be done using C++ than to understand exactly how it can be
achieved.

Programming Paradigms相关推荐

  1. 代写python作业费用标准_代做159.272作业、代写Programming Paradigms作业、代做Python实验作业、代写Java/c++编程作业代写Database|代做R...

    代做159.272作业.代写Programming Paradigms作业.代做Python实验作业.代写Java/c++编程作业代写Database|代做RComputational Thinkin ...

  2. Programming Paradigms 编程范式-笔记

    Stephen Covey的<The 7 Habits of Highly Effective People>一书中,有一个关于paradigm shift(范式转移)的小故事: 军舰在雾 ...

  3. Stanford CS107 Programming Paradigms 编程范式

    Directory Resource :https://see.stanford.edu/Course/CS107 Lower-level C constructs High-level C++ Co ...

  4. Stanford CS107 Programming Paradigms 编程范式 课程笔记

    1.c/c++类型的一般大小 bool char short int  long float double   1 byte 2 bytes 4 bytes 4 bytes 4bytes 8bytes ...

  5. C++的4种编程范型 programming paradigms

    基于过程 :procedural-based 基于对象 :object-based 面向对象 :object-oriented 泛型编程 :generics

  6. Scala函数式编程设计原理 第一课 编程范式(Programming Paradigms)

    我使用Scala有一两年的时间了,这门语言仿佛有一种魔力,让人用过就不想放手.Scala给我的整个程序生涯带来了非常深刻的影响,让我学会了函数式编程,让我知道了世界上居然还有这么一种优雅.高效.强大的 ...

  7. Paradigm Shifts in Kernel Programming 内核编程的范式转移

    Paradigm Shift in Kernel Programming 内核编程的范式转移 Raymond Kwan 这篇小文章主要分析了操作系统内核编程中主要使用C和命令式范式的原因,同时讨论了其 ...

  8. 一切从FP(Functional Programming)开始

    一切从Functional Programming开始 1. 一切从FP开始 2. 什么是FP? 2.1. 命令式 / 函数式 2.2. 函数式特性 2.2.1. 闭包 2.2.2. 高阶函数 2.2 ...

  9. javascript功能_功能性JavaScript简介

    javascript功能 Hey everybody! I've written a book called Discover Functional JavaScript, and it's now ...

最新文章

  1. 人工智能基础-概率分布与函数的基础定义
  2. Cesium中级教程9 - Advanced Particle System Effects 高级粒子系统效应
  3. mysql约束条件整型_MySQL 数据类型(整型,浮点型,字符类型,日期类型,枚举和集合) 约束条件 自增...
  4. Taro+react开发(86):资源文件处理
  5. 【框架学习分享】HttpRunner
  6. transformer 中的注意力机制和胶囊网络中的动态路由:它们在本质上或许具有相似性
  7. Windows 2008 R2 SP1部署Lync2010企业版(一)
  8. 七阶拉丁方阵_【C语言】输出N阶拉丁方阵并统计个数
  9. JS删除数组中某一项或几项的方法汇总
  10. Raspberry Pi 构建一个飞机观察器
  11. 4k hidpi 黑苹果_黑苹果 篇四:开启mac下的2k hidpi选项,同时开启144hz
  12. 千梦网创108计第三十六计:当地人才招聘网,一个年入50W的战友实操案例
  13. Android 动态分区详解(六) 动态分区的底层机制
  14. 数据结构-动态数组(ArrayList)
  15. 免费的视频转换软件。包括qlv全可以转
  16. HttpWebRequest的GetResponse或GetRequestStream 超时决办法
  17. vue 所见即所得_Vue html5编辑器:Vue的html5所见即所得编辑器
  18. Python 超简单爬取微博热搜榜数据
  19. 网络安全工具使用集锦手册
  20. 挠性电路板和刚性电路板的区别,以及柔性电路板焊接方法操作步骤

热门文章

  1. heartbleed漏洞小记
  2. Symbian操作系统历史简介
  3. STM32学习笔记-SMT32使用HAL库UART中断方式使用
  4. 基于Xlinx的时序分析、约束和收敛(7)----非理想时钟的特性约束
  5. 云闪付小程序开发环境搭建
  6. 安卓厨房linux汉化,【Madrigal 原创】一键制作ROM包,和安卓厨房完整版优化精简...
  7. eclipse调出左边栏
  8. 反渗透设备:反渗透设备应用范围
  9. bitbucket创建代码_了解有关Bitbucket Cloud中的代码审查的信息
  10. java开发工程师面试经历