并行程序设计导论
基本术语 (Basic Terminology)
Before we start the technicalities of our topic, let us understand some very basics.
在开始本主题的技术介绍之前,让我们了解一些非常基础的知识。
- What is Programming? 什么是编程?
Instructing the computer to do some task by telling it “What to do” and “How to do it” is programming. It is the medium by which instructions are passed to the computer.
通过告诉计算机“做什么”和“如何 做”来指示计算机执行某些任务。 它是将指令传递到计算机的媒介。
- What is Programming Language? 什么是编程语言?
Humans use language(s) to communicate with each other. Similarly, the medium used to communicate with the computer to tell “What to do and How to do it” is known as Programming Language.
人类使用一种或多种语言相互交流。 同样,用于与计算机进行通信以告知“该做什么和怎么做”的介质也称为编程语言。
- Why Programming Language ? 为什么要编程语言?
Computers can understand only Binary Language consisting of huge combinations of “0”s and “1”s which is definitely not easy for humans to understand. Programming Language(s) are more readable for humans as they use English alphabets and words, Numbers, Symbols.
A software tool called as “compiler”, which is basically a translator, converts the Human Readable Programming Language into Binary Language which computer can understand.计算机只能理解由“ 0”和“ 1”的巨大组合组成的二进制语言,这对人类来说绝对不容易理解。 编程语言对于人类更易读,因为他们使用英文字母和单词,数字,符号。
基本上是翻译器的一种称为“编译器”的软件工具,将人类可读的编程语言转换为计算机可以理解的二进制语言 。
什么是C编程? (What is C Programming?)
C is one of the Programming Language(s) which revolutionized the world of Computers. Dennis Ritchie created the language at Bell Labs and it appeared in 1972. Since then, it is one of the most popular and widely used languages in millions of devices.
C是彻底改变计算机世界的一种编程语言。 丹尼斯·里奇(Dennis Ritchie)在贝尔实验室创建了该语言,并于1972年出现。从那时起,它是数百万种设备中最受欢迎和使用最广泛的语言之一。
C语言编程的特点 (Features of C Programming)
- Easy to Code 易于编码
- Strongly Typed 强类型
- Compiled Language 编译语言
- High Performance and Reliable 高性能可靠
- Close to Hardware Compiled Code 接近硬件编译代码
- Procedure Oriented Programming (POP) 面向过程的编程(POP)
C程序设计的应用 (Applications of C Programming)
- Device Drivers 设备驱动程序
- Kernel of Operating Systems 操作系统内核
- System Programming 系统程式设计
- Embedded Computer and System Applications like “Traffic Light Controllers” 嵌入式计算机和系统应用程序,例如“交通灯控制器”
- Compilers of other Language(s) such as Python, Pearl etc. 其他语言的编译器,例如Python ,Pearl等。
- Heavy Computing tools such as “MATLAB” or “Mathematica” 重型计算工具,例如“ MATLAB”或“ Mathematica”
C编程的历史 (History of C Programming)
In the late 1960s, when computer hardware got “Transistors” and “ICs (Integrated Circuits)” Assembly Language, FORTRAN, COBOL etc. were being used. Although these languages were serving the purpose at the time to an extent, they had limitations.
在1960年代后期,当计算机硬件获得“晶体管”和“ IC(集成电路)”时,就使用了汇编语言,FORTRAN,COBOL等。 尽管这些语言在某种程度上达到了当时的目的,但它们有局限性。
For example, Assembly Language had vast abilities but hard to code, especially when programs become larger. Other languages Such as COBOL, PASCAL were easy and User-Friendly Programming Language(s) but had limited capabilities, i.e. programmer could use only pre-defined features but may not create the desired one.
例如,汇编语言具有强大的功能,但很难编写代码,尤其是在程序变大时。 其他语言(如COBOL,PASCAL)虽然简单易用,但对用户友好,但功能有限,即程序员只能使用预定义的功能,而不能创建所需的功能。
At Bell Labs, “Dennis Ritchie” (Computer Scientist) looked at the scenario and came up with an idea to create something with vast capabilities like Assembly Language and User-Friendly.
在贝尔实验室,“ Dennis Ritchie”(计算机科学家)研究了这种情况,并提出了创建具有汇编语言和用户友好性之类功能的想法。
The idea said, “Give all possible capabilities within the language which are required frequently and the power to create if it is not present”.
这个想法说:“在语言中提供经常需要的所有可能的功能,以及如果不存在,则具有创建的能力”。
The idea devolved as “C Programming Language” and the power given to it was “Control Structure”.
这个想法演变为“ C编程语言”,赋予它的力量是“控制结构”。
Initially, C Compiler was programmed in Assembly Language. C uses simple English words, numbers and symbols as required, making it easily readable and understandable for humans.
最初,C编译器是用汇编语言编程的。 C根据需要使用简单的英语单词,数字和符号,使人类易于阅读和理解。
UNIX OS was also being developed at Bell Labs and Dennis Ritchie re-programmed the code for “C compiler”, “UNIX OS”, System and Application programs in C language itself and compiled. Thus, performance enhanced significantly as there was no explicit translation because from OS to Application programs, everything was in C. This resulted in quick and wide adaptability of C Programming Language.
贝尔实验室也在开发UNIX OS,Dennis Ritchie用C语言本身对“ C编译器”,“ UNIX OS”,系统和应用程序的代码进行了重新编程,然后进行了编译。 因此,由于没有显式转换,因此性能得到了显着提高,因为从OS到应用程序,所有内容都在C中。这导致C编程语言具有快速而广泛的适应性。
摘要 (Summary)
As a result, the wide applications and features of C make it a very essential and irreplaceable language for computers. For any individual entering in Programming and Development, it is highly recommended to start with C Programming because no other language can show the depths and understanding of programming as clearly as C.
结果,C的广泛应用和功能使其成为计算机中非常重要且不可替代的语言。 对于进入程序设计和开发的任何个人,强烈建议从C编程开始,因为没有其他语言能够像C一样清楚地显示出对编程的深度和理解。
References: Wikipedia Article
参考: 维基百科文章
翻译自: https://www.journaldev.com/25129/introduction-to-c-programming
并行程序设计导论