Softwaredevelopmentapproaches(viewsandopinions)

上传人:xx****x 文档编号:240563442 上传时间:2024-04-15 格式:PPT 页数:35 大小:197.50KB
返回 下载 相关 举报
Softwaredevelopmentapproaches(viewsandopinions)_第1页
第1页 / 共35页
Softwaredevelopmentapproaches(viewsandopinions)_第2页
第2页 / 共35页
Softwaredevelopmentapproaches(viewsandopinions)_第3页
第3页 / 共35页
点击查看更多>>
资源描述
Software development approaches(views and opinions)Bjarne StroustrupAT&T Labs Research1My perspectiveResearcherResearch managerProgrammer/designerTeacherConsultant(not on a fee basis)C/C+communityUnix/WindowsSystems programming/embedded systemsNot primarilyITProductionApplications 2OverviewGeneralitiesTool chainsProject-focused discussionProgramming techniquesC+based(thats what I know best)StandardsEverybody got a fewSo what can we do to make progress?(provocative horror show its Halloween)3GeneralitiesOur civilization runs on computersMore and more of a computer is softwareMore and more of our environment contain computersWe needMore softwareBuilt in less timeMore reliableWith more“features”“High tech”v.s.“Cheap labor”Curious trends:lots of“tech”with expensive laborBecause software is crucial,money talks(shouts!)Makes it hard to make technical decisions4CommunitiesThe software development community has fracturedWeb designersVB programmersAnalysts/designersTraditional skilled programmersC/free-software hackersAcademic FP-communityLicensed company X internals specialistsThese groups dont understand each others languages,tools,and work methodsEach group has sub-groups who dont understand each others languages,tools,and work methodsE.g.C,C+,Java,AdaThis is not just specializationTower of Babel5Modularity and communication“separating things are easy”Its having separate entities communicate thats hardHave“reuse”succeeded or failed?Certainly the hype was wrong(surprise!)Huge componentsCompilers,operating systems,communications packagesTiny componentssubroutinesMedium-sized componentsThis is where it gets interesting/difficultPlug-ins,some CORBA objects,some COM components,libraries6Buzzwords“Objects”are not everything(I promised you that they wouldnt be)Are useful in their proper rolesIDLs(Interface Definition Languages)Try to become systems development platformsData definitions,actions,Language independencereduces expressiveness,has binding costsA language independent language is an oxymoronIntegrated development environmentsMonoliths,proprietary,try to do everything for everybody7Tool chainsI love ascii!(unicode is also ok)Human readable and writeableKey to modularityHard to make proprietaryExamplesUnix intermediary formatsHTMLXMLPostscriptSource code8A common,simple,problemSimple distributed computingNo shared memoryNo real masterSome communication asynchronousSometimes communications failSometimes modules failOnemoduleAnother moduleA third module9A common,simple,problemPick a module/communication systemCORBA,COM,.net,Java,Now,have you chosen?Programming languageVendorPerformance limitsDatabase systemDevelopment platformHardware supplierEducation for your developersCulture10XTI/XPRRelated problemsProgramming distributed systemsMarshalling/unmarshallingMultitude of IDL“standards”Poor C+bindingsSerializationXML reading/writingProgram manipulation11Distributed 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.f(a,s);12Program manipulation:XTI/XPRC+sourceC+compilerSymbol table XPRgeneratorXPR RPCgeneratorObject codeXTIIDLXMLXTI13XPRstruct 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)*charD:class#base:B virtual private#base:B2 protectedzz:int publicf:*(int)*char publiclst:listvector publicC+sourceXPR14XPR(eXternal Program Representation)Easy/fast to parseEasy/fast to writeCompactRobust:Read/write without using a symbol tableLR(1),strictly prefix declaration syntaxHuman readableHuman writeableCan represent almost all of C+directlyNo preprocessor directivesNo multiple declarators in a declarationNo,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);18Function ObjectsFunction objectsEssential 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 libraries19Object-oriented ProgrammingHide 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 classes20Class HierarchiesOne way(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);/*/;21Class HierarchiesShapeCircleTriangleUsers22Class HierarchiesFundamental 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()23Class HierarchiesAnother way(usually better):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;/*/;24Class HierarchiesShapeCircleTriangleUsers25Class HierarchiesOne 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:public Shape,protected Common/*/;class Triangle:public Shape,protected Common /*/;class Logo:public Shape /*/;/Common not needed26Class HierarchiesShapeCircleTriangleUsersCommonLogo27Multiparadigm ProgrammingThe most effective programs often involve combinations of techniques from different“paradigms”The real aims of good designRepresent ideas directlyRepresent independent ideas independently in code28Algorithms 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)/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);29Vintage 1997 slideOur suppliers prefer us to use their proprietary languages30StandardsFormal standardsISO,IEEEConsortiaCORBA,W3CCorporateMicrosoft,SunUsers are always underrepresented31What can we do to make progress?Computer scienceHasnt had a Copernicus,a Galileo,a Tycho Brahe,or a NewtonNo accepted basic model of our worksNo accepted standard for what an experiment isNo accepted standard for measurementNo predictive integration of experimental results and mathHasnt had a HippocratesNo accepted definition of professionalismAs a science or an engineering disciplineWe lack a shared scientific foundationWe lack a shared base of established practiceWe lack a shared culture(history,heroes)32What can we do to make progress?Huge gaps between“academic”understanding and industrial practiceMuch effective software development is cottage industry and craft“best practices”are often defeated in fair competitionMarketing dominatesNon-system builders make crucial technical decisionsWithout acknowledging that the decisions are technicalHuge variation between different groups doing similar projectsTools(incl.Languages)TechniquesSociology(separation of tasks,management style)33What can we do to make progress?We must measure and classifyMeasure things that are meaningful and usefulDevelop the ability to predictWe must develop tools for measurementPerformanceComplexityReliabilityEffectiveness of techniquesWho might be able to do this?Academia:no(doesnt have the right problems)Industry:no(doesnt have the freedom to experiment)Industry and academia:maybeGenius needed(methodologists cannot be primary)Its going to take far longer than we would like34What can we do to make progress?Actually,Im mostly an optimistBecause we are making progressBut Im less of an optimist than I used to beEducationBetter educated people drowned by the half-educatedMarketing dominance of much educationTrainingAcademic disengagement from real-world problemsProgramming languagesMuch code in“Pidgin-C”Much emphasis on the half-educatedDesignStill lack of feedbackProcess obsessionToolsOften drown us in incidental complexityScienceIm still waiting35
展开阅读全文
相关资源
相关搜索

最新文档


当前位置:首页 > 图纸专区 > 大学资料


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!