




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、1Software development approaches(views and opinions)Bjarne StroustrupAT&T Labs Research2My perspective Researcher Research manager Programmer/designer Teacher Consultant (not on a fee basis) C/C+ community Unix/Windows Systems programming / embedded systems Not primarily IT Production Applicatio
2、ns 3Overview Generalities Tool chains Project-focused discussion Programming techniques C+ based (thats what I know best) Standards Everybody got a few So what can we do to make progress? (provocative horror show its Halloween)4Generalities Our civilization runs on computers More and more of a compu
3、ter is software More and more of our environment contain computers We need More software Built in less time More reliable With more “features” “High tech” v.s. “Cheap labor” Curious trends: lots of “tech” with expensive labor Because software is crucial, money talks (shouts!) Makes it hard to make t
4、echnical decisions5Communities The software development community has fractured Web designers VB programmers Analysts/designers Traditional skilled programmers C/free-software hackers Academic FP-community Licensed company X internals specialists These groups dont understand each others languages, t
5、ools, and work methods Each group has sub-groups who dont understand each others languages, tools, and work methods E.g. C, C+, Java, Ada This is not just specialization Tower of Babel6Modularity and communication “separating things are easy” Its having separate entities communicate thats hard Have
6、“reuse” succeeded or failed? Certainly the hype was wrong (surprise!) Huge components Compilers, operating systems, communications packages Tiny components subroutines Medium-sized components This is where it gets interesting/difficult Plug-ins, some CORBA objects, some COM components, libraries7Buz
7、zwords “Objects” are not everything (I promised you that they wouldnt be ) Are useful in their proper roles IDLs (Interface Definition Languages) Try to become systems development platforms Data definitions, actions, Language independence reduces expressiveness, has binding costs A language independ
8、ent language is an oxymoron Integrated development environments Monoliths, proprietary, try to do everything for everybody8Tool chains I love ascii! (unicode is also ok) Human readable and writeable Key to modularity Hard to make proprietary Examples Unix intermediary formats HTML XML Postscript Sou
9、rce code9A common, simple, problem Simple distributed computing No shared memory No real master Some communication asynchronous Sometimes communications fail Sometimes modules failOnemoduleAnother moduleA third module10A common, simple, problem Pick a module/communication system CORBA, COM, .net, Ja
10、va, Now, have you chosen? Programming language Vendor Performance limits Database system Development platform Hardware supplier Education for your developers Culture 11XTI/XPR Related problems Programming distributed systems Marshalling/unmarshalling Multitude of IDL “standards” Poor C+ bindings Ser
11、ialization XML reading/writing Program manipulation12Distributed programming in ISO C+ “as similar as possible to non-distributed programming, but no more similar”/ use local object:X x;A a;std:string s(abc);/ x.f(a, s);/ use remote object :remote_proxy x;x.connect(my_host);A a;std:string s(abc);/ x
12、.f(a, s);13Program manipulation: XTI/XPRC+ sourceC+compilerSymbol table XPRgeneratorXPR RPCgeneratorObject codeXTIIDLXMLXTI14XPRstruct B int xx;Char* f(const int *);templatestruct D : private virtual B, protected B2 int zz;char* (*f)(int);list vector lst;B : class xx : int publicf : (:*const int) *c
13、harD : class #base : B virtual private#base : B2 protectedzz : int publicf : *(int) *char publiclst : listvector publicC+ sourceXPR15XPR (eXternal Program Representation)Easy/fast to parseEasy/fast to writeCompactRobust: Read/write without using a symbol tableLR(1), strictly prefix declaration synta
14、xHuman readableHuman writeableCan represent almost all of C+ directly No preprocessor directives No multiple declarators in a declaration No , , or MV(m,v2) / operator+(MV(m,v2),v3) - MVV(m,v2,v3) / operator=(v,MVV(m,v2,v3) - mul_add_and_assign(v,m,v2,v3);19Function ObjectsFunction objectsEssential
15、for flexibilityEfficientin practice, more so than inline functionsimportant: sort() vs. qsort()Some find them tedious to writeStandard function objectse.g., less, plus, mem_funCan be automatically written/generatedVector v2 = m*v+k;/ matrix and vector librariesfind_if(b,e, 0 x & x=max);/ lambda
16、libraries20Object-oriented Programming Hide details of many variants of a concepts behind a common interfacevoid draw_all(vector& vs)typedef vector:iterator VI;for (VI p = vs.begin(); p!=vs.end(), +p) p-draw(); Provide implementations of these variants as derived classes21Class Hierarchies One w
17、ay (often flawed):class Shape / define interface and common stateColor c;Point center;/ public:virtual void draw();virtual void rotate(double);/ ;class Circle : public Shape /* */ void rotate(double) /* */ ;class Triangle : public Shape / * */ void rotate(double); /* */ ;22Class HierarchiesShapeCirc
18、leTriangleUsers23Class Hierarchies Fundamental advantage: you can manipulate derived classes through the interface provided by a base:void f(Shape* p)p-rotate(90);p-draw(); You can add new Shapes to a program without changing or recompiling code such as f()24Class Hierarchies Another way (usually be
19、tter):class Shape / abstract class: interface only/ no representationpublic:virtual void draw() = 0;virtual void rotate(double) = 0;virtual Point center() = 0;/ ;class Circle : public Shape Point center; double radius; Color c; /* */ ;class Triangle : public Shape Point a, b, c; Color c; / * */ ;25C
20、lass HierarchiesShapeCircleTriangleUsers26Class Hierarchies One way to handle common state:class Shape / abstract class: interface onlypublic:virtual void draw() = 0;virtual void rotate(double) = 0;virtual Point center() = 0;/ ;class Common Color c; /* */ ;/ common state for Shapesclass Circle : pub
21、lic Shape, protected Common /* */ ;class Triangle : public Shape, protected Common / * */ ;class Logo: public Shape /* */ ;/ Common not needed27Class HierarchiesShapeCircleTriangleUsersCommonLogo28Multiparadigm Programming The most effective programs often involve combinations of techniques from dif
22、ferent “paradigms” The real aims of good design Represent ideas directly Represent independent ideas independently in code29Algorithms on containers of polymorphic objectsvoid draw_all(vector& v)/ for vectorsfor_each(v.begin(), v.end(), mem_fun(&Shape:draw);template void draw_all(C& c)/
23、for all standard containersfor_each(c.begin(), c.end(), mem_fun(&Shape:draw);template void draw_all(For first, For last)/ for all sequencesfor_each(first, last, mem_fun(&Shape:draw);30Vintage 1997 slide1985199019952000AppleObject PascalObject PascalDylanObjective C+C+C+C+BorlandTurbo-PascalP
24、ascal-5C+DelphiC+?C+DECBLISSCC+C+TrellisModula-3?IBMPL/1Objective CSmalltalkJavaSmalltalkC+C+HPCC+C+C+Objective CCHP JavaMSBASICBASICVBVBCCC+J+MS PascalC+SGICCC+C+?AdaSunCCJavaSun JavaCCC+C+Our suppliers prefer us to use their proprietary languages31Standards Formal standards ISO, IEEE Consortia COR
25、BA, W3C Corporate Microsoft, SunUsers are always underrepresented32What can we do to make progress? Computer science Hasnt had a Copernicus, a Galileo, a Tycho Brahe, or a Newton No accepted basic model of our works No accepted standard for what an experiment is No accepted standard for measurement
26、No predictive integration of experimental results and math Hasnt had a Hippocrates No accepted definition of professionalism As a science or an engineering discipline We lack a shared scientific foundation We lack a shared base of established practice We lack a shared culture (history, heroes)33What
27、 can we do to make progress? Huge gaps between “academic” understanding and industrial practice Much effective software development is cottage industry and craft “best practices” are often defeated in fair competition Marketing dominates Non-system builders make crucial technical decisions Without acknowledging that the decisions are technical Huge variation between different groups doing similar projects Tools (incl. Languages) Techniques Sociology (separation of tasks, management style)34What can we do to make progress?We must measure and classify
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 商业领域中智能教室解决方案的商业价值与实施
- 政策分析技术在教育领域的应用前景
- 专题06 读后续写校园生活类话题(讲义)原卷版-2025年高考英语二轮复习
- 情感智力驱动学业成功的关键要素
- 技术推动教育变革的正面伦理视角
- 中职教育自我管理课件
- 2025届河北省沧州盐山中学物理高二下期末检测试题含解析
- 中职教师课件
- 未来职业教育的趋势基于情感智商的培养策略分析
- 教育技术法规实施中的难点与对策研究
- 2024年湖北省普通高中学业水平合格性考试数学试题(原卷版)
- 常州市钟楼区社区专职工作者招聘笔试真题2024
- 2025年中广核招聘笔试参考题库附带答案详解
- 2024年安徽中医药高等专科学校招聘考试真题
- 2025年变电站春季安全生产自查报告
- 充电桩充电服务与充电站安全保障合同
- 个人信息保护合规审计师CCRC-PIPCA含答案
- 2025鄂尔多斯达拉特旗智杰教育投资有限责任公司面向社会招聘10名工作人员笔试参考题库附带答案详解析集合
- 小型引调水工程可行性研究报告
- GB 9706.283-2022医用电气设备第2-83部分:家用光治疗设备的基本安全和基本性能专用要求
- 放弃房产贷款协议书
评论
0/150
提交评论