📄 lib0029.html
字号:
<html>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>The Evolution of Languages</title>
<link rel="STYLESHEET" type="text/css" href="images/xpolecat.css">
<link rel="STYLESHEET" type="text/css" href="images/ie.content.books24x7.css">
</head>
<body >
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<td><div STYLE="MARGIN-LEFT: 0.15in;">
<a href="toc.html"><img src="images/teamlib.gif" width="62" height="15" border="0" align="absmiddle" alt="Team LiB"></a></div></td>
<td valign="top" class="v2" align="right"><div STYLE="MARGIN-RIGHT: 0.15in"><a href="LiB0028.html"><img src="images/previous.gif" width="62" height="15" border="0" align="absmiddle" alt="Previous Section"></a>
<a href="LiB0030.html"><img src="images/next.gif" width="41" height="15" border="0" align="absmiddle" alt="Next Section"></a>
</div></td></tr>
</table>
<div class="chapter">
<a name="ch03"></a>
<div class="section">
<h2 class="first-section-title"><a name="359"></a><a name="ch03lev1sec4"></a>The Evolution of Languages</h2><p class="first-para">The fundamental, core issue encountered in software engineering is <i class="emphasis">complexity.</i> The evolution of programming languages has been driven by the need to manage and constrain complexity. Initially, programs were hard-coded in raw binary. This was back in the days of Howard Aiken's MARK I, which was unveiled in 1944. As the years wore on, programs got to a size where coding in raw binary was simply too tedious.</p>
<p class="para">In 1949, the first <i class="emphasis">assembly language</i> was developed for the UNIVAC I. Assembly language made programming less complicated by replacing raw binary instructions with terse symbolic <a name="360"></a><a name="IDX-169"></a>mnemonics. Originally, a programmer would have had to manually write something like:</p>
<div class="informalexample">
<pre class="literallayout">
10010110 10101110 01101011
</pre>
</div>
<p class="para">Using assembly language, the previous binary instruction could be replaced with:</p>
<div class="informalexample">
<pre class="literallayout">
INC AR 0x6B
</pre>
</div>
<p class="para">This primitive symbolic notation helped to make programming easier. Again, programs became larger and more complicated to the extent that something new was needed. This something new reared its head in the next decade. In the 1950s, with the emergence of transistor-based circuits, higher-level languages emerged. Two such languages were COBOL and FORTRAN. All of these early high-level languages were <i class="emphasis">block-based</i> and used the GOTO statement, or something resembling it, to move from block to block.</p>
<p class="para">The emergence of block-based languages led to the development of <i class="emphasis">structured programming</i> in the late 1960s. The essay that led to the birth of structured programming was written by Dijkstra in 1968. It was a letter in the <i class="emphasis">Communications of the ACM</i> titled "GOTO Statement Considered Harmful." This revolutionary paper caused quite a stir. The state-of-the-art languages at the time, like COBOL II and FORTRAN IV, used GOTOs liberally.</p>
<table border="0" cellspacing="0" cellpadding="0" class="note">
<tr>
<td valign="top" class="admon-check"></td><td valign="top" class="admon-title">Note </td><td valign="top" class="admon-body">
<p class="first-para">Structured programming is an approach to writing procedure-based code where the use of the GOTO statement is either minimized or excluded entirely. History sides with Dijkstra. Structured programming was the paradigm that characterized software development in the 1970s and 1980s.</p>
</td>
</tr>
</table>
<p class="para">When a software team in the 1970s wanted to design a business application, they would first model the data that the application would manage. This usually meant designing database tables and memory resident data structures. This initial collection of schemas and data types would be the starting point around which everything else would revolve. Next, the team would decide on the algorithms and corresponding functions that would operate on the data.</p>
<p class="para">Structured programming is notably either data-oriented or procedure-oriented, but never both.</p>
<p class="para">Even though structured programming was supposed to be a cure-all, it fell short of its expectations. Specifically, the structured approach proved to be inadequate with regard to maintaining large projects. This is a crucial flaw because most of the money invested in a software project is spent on maintenance. During the 1980s, structured programming was gradually replaced by the <a name="361"></a><a name="IDX-170"></a>object-oriented approach that was promoted by languages like C+ + and Smalltalk.</p>
<p class="para">Can you see the trend I'm trying to illuminate?</p>
<p class="para">I am of the opinion that every programming language has a complexity threshold. After a program reaches a certain number of lines of code, it becomes difficult to understand and modify. Naturally, lower-level languages will have a lower complexity threshold than the higher ones. To get an idea of what the complexity threshold is for different types of programming languages, we can take a look at a collection of well-known operating systems (see <a class="internaljump" href="#ch03table05">Table 3.5</a>).</p>
<a name="362"></a><a name="ch03table05"></a>
<table class="table" border="1">
<caption class="table-title">
<span class="table-title"><span class="table-titlelabel">Table 3.5</span></span>
</caption>
<thead>
<tr valign="top">
<th class="th" scope="col" align="left">
<p class="table-para">
<b class="bold">OS</b>
</p>
</th><th class="th" scope="col" align="left">
<p class="table-para">
<b class="bold">Lines of Code</b>
</p>
</th><th class="th" scope="col" align="left">
<p class="table-para">
<b class="bold">Primary Language</b>
</p>
</th><th class="th" scope="col" align="left">
<p class="table-para">
<b class="bold">Source</b>
</p>
</th>
</tr>
</thead>
<tbody>
<tr valign="top">
<td class="td" align="left">
<p class="table-para">
<b class="bold">DOS</b>
</p>
</td><td class="td" align="left">
<p class="table-para">20,000</p>
</td><td class="td" align="left">
<p class="table-para">assembler</p>
</td><td class="td" align="left">
<p class="table-para">Modern Operating Systems (Andrew Tanenbaum)</p>
</td>
</tr>
<tr valign="top">
<td class="td" align="left">
<p class="table-para">
<b class="bold">MINIX</b>
</p>
</td><td class="td" align="left">
<p class="table-para">74,000</p>
</td><td class="td" align="left">
<p class="table-para">C</p>
</td><td class="td" align="left">
<p class="table-para">Operating Systems, Design and Implementation (Andrew Tanenbaum)</p>
</td>
</tr>
<tr valign="top">
<td class="td" align="left">
<p class="table-para">
<b class="bold">FreeBSD</b>
</p>
</td><td class="td" align="left">
<p class="table-para">200,000 (kernel only)</p>
</td><td class="td" align="left">
<p class="table-para">C</p>
</td><td class="td" align="left">
<p class="table-para">The Design and Implementation of 4.4BSD Operating System (McKusick et. al.)</p>
</td>
</tr>
<tr valign="top">
<td class="td" align="left">
<p class="table-para">
<b class="bold">Windows 98</b>
</p>
</td><td class="td" align="left">
<p class="table-para">18 million lines (everything)</p>
</td><td class="td" align="left">
<p class="table-para">C/C + +</p>
</td><td class="td" align="left">
<p class="table-para">February 2, 1999 (A.M. Session) United States vs. Microsoft et. al.</p>
</td>
</tr>
</tbody>
</table>
<p class="para">From <a class="internaljump" href="#ch03table05">Table 3.5</a>, it seems that the number of lines of code that can be efficiently managed by a language increase by a factor of 10 as you switch to more sophisticated paradigms (see <a class="internaljump" href="#ch03table06">Table 3.6</a>).</p>
<a name="363"></a><a name="ch03table06"></a>
<table class="table" border="1">
<caption class="table-title">
<span class="table-title"><span class="table-titlelabel">Table 3.6</span></span>
</caption>
<thead>
<tr valign="top">
<th class="th" scope="col" align="left">
<p class="table-para">
<b class="bold">Language</b>
</p>
</th><th class="th" scope="col" align="left">
<p class="table-para">
<b class="bold">Paradigm</b>
</p>
</th><th class="th" scope="col" align="left">
<p class="table-para">
<b class="bold">Complexity Threshold</b>
</p>
</th>
</tr>
</thead>
<tbody>
<tr valign="top">
<td class="td" align="left">
<p class="table-para">Raw binary</p>
</td><td class="td" align="left">
<p class="table-para">no-holds-barred</p>
</td><td class="td" align="left">
<p class="table-para">10,000 instructions</p>
</td>
</tr>
<tr valign="top">
<td class="td" align="left">
<p class="table-para">Assembler</p>
</td><td class="td" align="left">
<p class="table-para">block-based using GOTO</p>
</td><td class="td" align="left">
<p class="table-para">100,000 lines</p>
</td>
</tr>
<tr valign="top">
<td class="td" align="left">
<p class="table-para">C</p>
</td><td class="td" align="left">
<p class="table-para">structured (no GOTO)</p>
</td><td class="td" align="left">
<p class="table-para">1,000,000 lines</p>
</td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -