搜档网
当前位置:搜档网 › Computer programming

Computer programming

Computer programming
Computer programming

Computer programming

Computer programming (often shortened to programming or coding) is the process of designing. writing, and debugging the source code of computer programs. This source code is written in a programming language. The purpose of programming is to create a program that exhibits a certain desired behavior. The process of writing source code often requires expertise in many different subjects. including knowledge of the application domain, specialized algorithms and formal logic.

计算机编程(通常缩短编程或编码)设计的过程。编写和调试计算机程序的源代码。这个源代码是用编程语言编写的。编程的目的是创建一个程序,展示一定的预期行为。编写源代码的过程通常需要专业知识在很多不同的科目。包括应用程序域的知识,专门的算法和形式逻辑。

Within software engineering. programming (the implementation) is regarded as one phase in a software development process. Whatever the approach to software development maybe, the final program must satisfy some fundamental properties. The following properties are among the most relevant:

在软件工程。编程(实现)被认为是软件开发过程中的一个阶段。无论软件开发方法也许,最后程序必须满足一些基本性质。以下属性是最相关的:

?Efficiency/performance: the amount of system resources a program consumes (processor time. memory space. slow devices such as disks. network bandwidth and to some extent even user interaction): the less. the better. This also includes correct disposal of some resources, such as cleaning up temporary files and lack of memory leaks.

?效率/性能:程序消耗的系统资源(处理器时间。内存空间。缓慢的设备(如磁盘。网络带宽和在某种程度上甚至用户交互):。越好。这也包括一些资源的正确处理,如清理临时文件和内存泄漏的缺乏。

? Reliability: how often the results of a program are correct. This depends on conceptual correctness of algorithms. and minimization of programming mistakes. such as mistakes in resource management (e. g., buffer overflows and race conditions) and logic errors (such as division by zero or off-by-one errors).

可靠性:多长时间程序的结果是正确的。这取决于概念算法的正确性。和最小化的编程错误。在资源管理(e . g等错误。、缓冲区溢出和竞争条件)和逻辑错误(如“从一开始”除零个或错误)。

?Robustness: how well a program anticipates problems not due to programmer error. This includes situations such as incorrect. inappropriate or corrupt data. unavailability of needed resources such as memory. operating system services and network connections, and user error.

?鲁棒性:程序如何预测问题不是由于程序员的错误。这包括情况如不正确的。不恰当的或腐败的数据。不可用所需的资源,如内存。操作系统服务和网络连接和用户错误。

? usability: the ergonomics of a program: the ease with which a person can use the program for its intended purpose. or in some cases even unanticipated purposes. Such issues can make or break its success even regardless of other issues. This involves a wide range of textual, graphical and sometimes hardware elements that improve the clarity, intuitiveness, cohesiveness and completeness of a program's user interface.

?可用性:程序的人体工程学的一个人可以使用程序的目的。甚至在某些情况下意外的目的。这类问题可以使或打破它的成功甚至不管其他问题。这涉及到广泛的文本、图形和有时硬件元素,提高清晰度,直觉,凝聚力和完整性的程序的用户界面。

portability: the range of computer hardware and operating system platforms on which the source code of a program can be compiled interpreted and run. this depends on differences in the programming facilities provided by the different platforms, including hardware and operating system resources. expected behavior of the hardware and operating system. and availability of platform specific compilers {and sometimes libraries) for the language of the source code.

可移植性:计算机硬件和操作系统平台的范围,程序可以被编译的源代码解释和运行。这取决于不同的编程设施所提供的不同的平台,包括硬件和操作系统资源。硬件和操作系统的预期行为。和可用性的特定于平台的编译器{有时库)的语言源代码。

Maintainability: the ease with which a program can be modified by its present or future developers in order to make improvements or customizations. fix bugs and security holes. or adapt it to new environments. Good practices during initial development make the difference in this regard. This quality may not be directly apparent to the end user but it can significantly affect the au of a program over the long term.

可维护性:可以修改的程序由其现在或将来的开发人员为了改进或定制。修复bug和安全漏洞。或者它适应新的环境。在初始开发最佳实践在这方面的差异。这个质量可能没有直接明显的给最终用户,但可以显著影响非盟的长期计划。

In computer programming. readability of the source code refers to the ease with which I human reader can comprehend the purpose. control flow. and operation of source code. It affects the aspects of quality above. including portability. usability and most importantly maintainability. Readability is important because programmers spend the majority of their time reading. trying to understand and modifying existing source code. rather than writing new source code. Unreadable code often leads to bugs. inefficiencies. and duplicated code. A study found that a few simple

readability transformations made code shorter and dra51ically reduced the time to understand it.

在计算机编程。源代码的可读性是指的我人类读者可以理解的目的。控制流。和操作的源代码。它会影响上述方面的质量。包括可移植性。可用性和最重要的可维护性。可读性很重要,因为程序员把大多数时间花在阅读上。试着理解和修改现有的源代码。而不是编写新的源代码。不可读的代码通常会导致错误。低效率。和重复代码。一项研究发现,一些简单的转换使代码可读性较短和dra51ically减少

时间去理解它。

Following a consistent programming style often helps readability. However. Readability is more than just programming style. Many factors contribute to readability. Some of these factors include: 遵循一个一致的编程风格经常帮助可读性。然而。可读性不仅仅是编程风格。许多因素导致可读性。这些因素包括:

Different indentation styles (whitespace)不同的缩进风格(空白) Comments评论

Decomposition分解

Naming conventions for objects (such as variables,. Procedures, etc) 对象的命名约定(如变量。程序等)

The academic field and the engineering practice of computer programming are both largely concerned with discovering and implementing the most efficient algorithms for a given class of problem. For this purpose, algorithms are classified into orders using so-called Big 0 notation.

0 ( 0). which expresses resource use, such as execution time or memory consumption. in terms of the size of an input. Expert programmers are familiar with a variety of well-established algorithms and their respective complexities and USE' this knowledge to choose algorithms that are best suited to the circumstances.

学术领域和计算机编程的工程实践都是主要关心的发现和实现最有效的算法对于一个给定的类的问题。为了这个目的,算法分为订单使用所谓的大0符号。0(0)表达资源的使用,如执行时间和内存消耗。一个输入的大小。专家程序员熟悉各种行之有效的算法和各自的复杂性和使用这些知识来选择算法最适合的环境。Different programming languages support different styles of programming ( called programming paradigms). The choice of language used is subject to many considerations. Ideally, the programming language best suited for the task at hand will be selected.

不同的编程语言支持不同风格的编程(称为编程范例)。语言的选择是受许多因素。理想情况下,编程语言最适合手头的任务将被选中。

It is very difficult to determine what are the most popular of modern programming languages. Some languages are very popular for particular kinds of applications (e. g., COBOL is still strong in the corporate data center. often on large mainframe, FORTRAN in engineering applications. Scripting languages in web development. and C in embedded applications). while some languages are regularly used to write many different kinds

of applications. Also many applications use a mix of several languages in their construction and use.

很难确定哪些是最受欢迎的现代编程语言。有些语言是非常流行的对于特定类型的应用程序(e . g。COBOL依然强劲的企业数据中心。经常在大型主机,FORTRAN在工程应用中。web开发的脚本语言。在嵌入式应用程序和C)。虽然有些语言经常写许多不同种类的应用程序使用。也许多应用程序使用一个混合的几种语言建设和使用。

Many computer languages provide a mechanism to call functions provided by libraries such as in. dlls. Provided the functions in a library follow the appropriate run time conventions (e.g., method of passing arguments), then these functions may be written in any other language.

许多计算机语言提供一个机制来调用库提供的功能等。dll。提供的功能在图书馆遵循相应的运行时约定(如。这些函数,方法的参数),那么可以用其他语言编写。

Debugging is a very important task in the software development process, because an incorrect program can have significant consequences for its users. Some languages are more prone to some kinds of faults because their specification does not require compilers to perform as much checking as other languages. Use of a static analysis tool can help detect some possible problems.

调试是一个非常重要的任务在软件开发过程中,因为一个不正确的程序可以对用户产生重大影响。有些语言更倾向于某些类型的错误,因为他们的规范不需要编译器执行检查和其他语言一样多。使用静态分析工具可以帮助发现一些可能的问题。

计算机编程(通常缩短编程或编码)设计的过程。编写和调试计算机程序的源代码。这个源代码是用编程语言编写的。编程的目的是创建一个程序,展示一定的预期行为。编写源代码的过程通常需要专业知识在很多不同的科目。包括应用程序域的知识,专门的算法和形式逻辑。

在软件工程。编程(实现)被认为是软件开发过程中的一个阶段。无论软件开发方法也许,最后程序必须满足一些基本性质。以下属性是最相关的:

?效率/性能:程序消耗的系统资源(处理器时间。内存空间。缓慢的设备(如磁盘。网络带宽和在某种程度上甚至用户交互):。越好。这也包括一些资源的正确处理,如清理临时文件和内存泄漏的缺乏

可靠性:多长时间程序的结果是正确的。这取决于概念算法的正确性。和最小化的编程错误。在资源管理(e . g等错误。、缓冲区溢出和竞争条件)和逻辑错误(如“从一开始”除零个或错误)。

?鲁棒性:程序如何预测问题不是由于程序员的错误。这包括情况如不正确的。不恰当的或腐败的数据。不可用所需的资源,如内存。操作系统服务和网络连接和用户错误。

?可用性:程序的人体工程学的一个人可以使用程序的目的。甚至在某些情况下

意外的目的。这类问题可以使或打破它的成功甚至不管其他问题。这涉及到广泛的文本、图形和有时硬件元素,提高清晰度,直觉,凝聚力和完整性的程序的用户

界面。

可移植性:计算机硬件和操作系统平台的范围,程序可以被编译的源代码解释和运行。这取决于不同的编程设施所提供的不同的平台,包括硬件和操作系统资源。硬件和操作系统的预期行为。和可用性的特定于平台的编译器{有时库)的语言源代码。

可维护性:可以修改的程序由其现在或将来的开发人员为了改进或定制。修复bug和安全漏洞。或者它适应新的环境。在初始开发最佳实践在这方面的差异。这个质量可能没有直接明显的给最终用户,但可以显著影响非盟的长期计划。

在计算机编程。源代码的可读性是指的我人类读者可以理解的目的。控制流。和操作的源代码。它会影响上述方面的质量。包括可移植性。可用性和最重要的可维护性。可读性很重要,因为程序员把大多数时间花在阅读上。试着理解和修改现有的源代码。而不是编写新的源代码。不可读的代码通常会导致错误。低效率。和重复代码。一项研究发现,一些简单的转换使代码可读性较短和dra51ically减少

时间去理解它。

遵循一个一致的编程风格经常帮助可读性。然而。可读性不仅仅是编程风格。许多因素导致可读性。这些因素包括:

不同的缩进风格(空白)

评论

分解

对象的命名约定(如变量。程序等)

学术领域和计算机编程的工程实践都是主要关心的发现和实现最有效的算法对于一个给定的类的问题。为了这个目的,算法分为订单使用所谓的大0符号。0(0)表达资源的使用,如执行时间和内存消耗。一个输入的大小。专家程序员熟悉各种行之有效的算法和各自的复杂性和使用这些知识来选择算法最适合的环境。不同的编程语言支持不同风格的编程(称为编程范例)。语言的选择是受许多因素。理想情况下,编程语言最适合手头的任务将被选中。

很难确定哪些是最受欢迎的现代编程语言。有些语言是非常流行的对于特定类型的应用程序(e . g。COBOL依然强劲的企业数据中心。经常在大型主机,FORTRAN在工程应用中。web开发的脚本语言。在嵌入式应用程序和C)。虽然有些语言经常写许多不同种类的应用程序使用。也许多应用程序使用一个混合的几种语言建设和使用。

许多计算机语言提供一个机制来调用库提供的功能等。dll。提供的功能在图书馆遵循相应的运行时约定(如。这些函数,方法的参数),那么可以用其他语言编写。

调试是一个非常重要的任务在软件开发过程中,因为一个不正确的程序可以对用户产生重大影响。有些语言更倾向于某些类型的错误,因为他们的规范不需要编译器执行检查和其他语言一样多。使用静态分析工具可以帮助发现一些可能的问题。

相关主题