Computer-programming

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

ComputerprogrammingComputerprogramming(oftenshortenedtoprogrammingorcoding)istheprocessofdesigning.writing,anddebuggingthesourcecodeofcomputerprograms.Thissourcecodeiswritteninaprogramminglanguage.Thepurposeofprogrammingistocreateaprogramthatexhibitsacertaindesiredbehavior.Theprocessofwritingsourcecodeoftenrequiresexpertiseinmanydifferentsubjects.includingknowledgeoftheapplicationdomain,specializedalgorithmsandformallogic.计算机编程(通常缩短编程或编码)设计的过程。编写和调试计算机程序的源代码。这个源代码是用编程语言编写的。编程的目的是创建一个程序,展示一定的预期行为。编写源代码的过程通常需要专业知识在很多不同的科目。包括应用程序域的知识,专门的算法和形式逻辑。Withinsoftwareengineering.programming(theimplementation)isregardedasonephaseinasoftwaredevelopmentprocess.Whatevertheapproachtosoftwaredevelopmentmaybe,thefinalprogrammustsatisfysomefundamentalproperties.Thefollowingpropertiesareamongthemostrelevant:在软件工程。编程(实现)被认为是软件开发过程中的一个阶段。无论软件开发方法也许,最后程序必须满足一些基本性质。以下属性是最相关的:•Efficiency/performance:theamountofsystemresourcesaprogramconsumes(processortime.memoryspace.slowdevicessuchasdisks.networkbandwidthandtosomeextentevenuserinteraction):theless.thebetter.Thisalsoincludescorrectdisposalofsomeresources,suchascleaninguptemporaryfilesandlackofmemoryleaks.•效率/性能:程序消耗的系统资源(处理器时间。内存空间。缓慢的设备(如磁盘。网络带宽和在某种程度上甚至用户交互):。越好。这也包括一些资源的正确处理,如清理临时文件和内存泄漏的缺乏。•Reliability:howoftentheresultsofaprogramarecorrect.Thisdependsonconceptualcorrectnessofalgorithms.andminimizationofprogrammingmistakes.suchasmistakesinresourcemanagement(e.g.,bufferoverflowsandraceconditions)andlogicerrors(suchasdivisionbyzerooroff-by-oneerrors).可靠性:多长时间程序的结果是正确的。这取决于概念算法的正确性。和最小化的编程错误。在资源管理(e.g等错误。、缓冲区溢出和竞争条件)和逻辑错误(如“从一开始”除零个或错误)。•Robustness:howwellaprogramanticipatesproblemsnotduetoprogrammererror.Thisincludessituationssuchasincorrect.inappropriateorcorruptdata.unavailabilityofneededresourcessuchasmemory.operatingsystemservicesandnetworkconnections,andusererror.•鲁棒性:程序如何预测问题不是由于程序员的错误。这包括情况如不正确的。不恰当的或腐败的数据。不可用所需的资源,如内存。操作系统服务和网络连接和用户错误。•usability:theergonomicsofaprogram:theeasewithwhichapersoncanusetheprogramforitsintendedpurpose.orinsomecasesevenunanticipatedpurposes.Suchissuescanmakeorbreakitssuccessevenregardlessofotherissues.Thisinvolvesawiderangeoftextual,graphicalandsometimeshardwareelementsthatimprovetheclarity,intuitiveness,cohesivenessandcompletenessofaprogram'suserinterface.•可用性:程序的人体工程学的一个人可以使用程序的目的。甚至在某些情况下意外的目的。这类问题可以使或打破它的成功甚至不管其他问题。这涉及到广泛的文本、图形和有时硬件元素,提高清晰度,直觉,凝聚力和完整性的程序的用户界面。portability:therangeofcomputerhardwareandoperatingsystemplatformsonwhichthesourcecodeofaprogramcanbecompiledinterpretedandrun.thisdependsondifferencesintheprogrammingfacilitiesprovidedbythedifferentplatforms,includinghardwareandoperatingsystemresources.expectedbehaviorofthehardwareandoperatingsystem.andavailabilityofplatformspecificcompilers{andsometimeslibraries)forthelanguageofthesourcecode.可移植性:计算机硬件和操作系统平台的范围,程序可以被编译的源代码解释和运行。这取决于不同的编程设施所提供的不同的平台,包括硬件和操作系统资源。硬件和操作系统的预期行为。和可用性的特定于平台的编译器{有时库)的语言源代码。Maintainability:theeasewithwhichaprogramcanbemodifiedbyitspresentorfuturedevelopersinordertomakeimprovementsorcustomizations.fixbugsandsecurityholes.oradaptittonewenvironments.Goodpracticesduringinitialdevelopmentmakethedifferenceinthisregard.Thisqualitymaynotbedirectlyapparenttotheenduserbutitcansignificantlyaffecttheauofaprogramoverthelongterm.可维护性:可以修改的程序由其现在或将来的开发人员为了改进或定制。修复bug和安全漏洞。或者它适应新的环境。在初始开发最佳实践在这方面的差异。这个质量可能没有直接明显的给最终用户,但可以显著影响非盟的长期计划。Incomputerprogramming.readabilityofthesourcecodereferstotheeasewithwhichIhumanreadercancomprehendthepurpose.controlflow.andoperationofsourcecode.Itaffectstheaspectsofqualityabove.includingportability.usabilityandmostimportantlymaintainability.Readabilityisimportantbecauseprogrammersspendthemajorityoftheirtimereading.tryingtounderstandandmodifyingexistingsourcecode.ratherthanwritingnewsourcecode.Unreadablecodeoftenleadstobugs.inefficiencies.andduplicatedcode.Astudyfoundthatafewsimplereadabilitytransformationsmadecodeshorteranddra51icallyreducedthetimetounderstandit.在计算机编程。源代码的可读性是指的我人类读者可以理解的目的。控制流。和操作的源代码。它会影响上述方面的质量。包括可移植性。可用性和最重要的可维护性。可读性很重要,因为程序员把大多数时间花在阅读上。试着理解和修改现有的源代码。而不是编写新的源代码。不可读的代码通常会导致错误。低效率。和重复代码。一项研究发现,一些简单的转换使代码可读性较短和dra51ically减少时间去理解它。Followingaconsistentprogrammingstyleoftenhelpsreadability.However.Readabilityismorethanjustprogrammingstyle.Manyfactorscontributetoreadability.Someofthesefactorsinclude:遵循一个一致的编程风格经常帮助可读性。然而。可读性不仅仅是编程风格。许多因素导致可读性。这些因素包括:Differentindentationstyles(whitespace)不同的缩进风格(空白)Comments评论Decomposition分解Namingconventionsforobjects(suchasvariables,.Procedures,etc)对象的命名约定(如变量。程序等)Theacademicfieldandtheengineeringpracticeofcomputerprogrammingarebothlargelyconcernedwithdiscoveringandimplementingthemostefficientalgorithmsforagivenclassofproblem.Forthispurpose,algorithmsareclassifiedintoordersusingso-calledBig0notation.0(0).whichexpressesresourceuse,suchasexecutiontimeormemoryconsumption.intermsofthesizeofaninput.Expertprogrammersarefamiliarwithavarietyofwell-establishedalgorithmsandtheirrespectivecomplexitiesandUSE'thisknowledgetochoosealgorithmsthatarebestsuitedtothecircumstances.学术领域和计算机编程的工程实践都是主要关心的发现和实现最有效的算法对于一个

1 / 5
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功