正在加载图片...
1102 EMULATING OBJECT TECHNOLOGY IN NON-O-O ENVIRONMENTS $34.3 34.3 FORTRAN FORTRAN should virtually eliminate coding and debugging Cited in [Wexelblat FORTRAN Preliminary Report,IBM,November 1954 1981]. The oldest surviving programming language,Fortran remains widely used for scientific The official name is computation.Shockingly perhaps for people who went on from it to such "structured" FORTRAN,although the less obtrusive languages as Pascal,you can in fact get a little more O-O frills in Fortran,although this is form is commonly partly thanks to facilities that may be considered low-level and were intended for other goals. used too. Some context Fortran was initially designed,as a tool for programming the IBM 704,by an IBM team under John Backus (later also instrumental in the description of Algol),with a first general release in 1957.Fortran II followed,introducing subroutines.Fortran IV solidified the language in 1966(Fortran IIL,704-specific,was not widely distributed),and was standardized by ANSI The next revision process led to Fortran 77,actually approved in 1978,with better control structures and some simplifications.An even longer revision yielded Fortran 90 and Fortran 95,which have been diversely met and have not quite replaced their predecessors. For most people with a computing science degree earned after the First World War, Fortran is old hat,and they would rather be caught reading the Intel 4044 User's Manual than admit they know anything about FORMAT and arithmetic /F instructions.In reality, however,quite a few programmed in Fortran at some stage,and many other people who are programmers by any objective criterion,even if their business card reads"theoretical physicist","applied mathematician","mechanical engineer"or even,in a few cases, "securities analyst",use Fortran as their primary tool day in and day out.Fortran remains in common use not only for maintaining old software but even for starting new projects. To the outsider it sometimes seems that scientific programming-the world of Fortran-has remained aloof from much of the evolution in software engineering.This is partly true,partly not.The low level of the language,and the peculiar nature of scientific computing (software produced by people who,although scientists by training,often lack formal software education),have resulted in some software of less than pristine quality. But some of the best and most robust software also comes from that field,including advanced simulations of extremely complex processes and staggering tools for scientific visualization.Such products are no longer limited to delicate but small numerical algorithms;like their counterparts in other application areas,they often manipulate complex data structures,rely on database technology,include extensive user interface components.And,surprising as it may seem,they are still often written in Fortran. The COMMON technique A Fortran system is made of a main program and a number of routines(subroutines or functions).How can we provide a semblance of data abstraction? The usual technique is to represent the data through a so-called COMMON block,a Fortran mechanism for making data accessible to any routine that cares to want it,and to implement each of the associated exported features(such as put etc.for stacks)through a separate routine.Here for example is a sketch of a put routine for a stack of real numbers:1102 EMULATING OBJECT TECHNOLOGY IN NON-O-O ENVIRONMENTS §34.3 34.3 FORTRAN FORTRAN should virtually eliminate coding and debugging FORTRAN Preliminary Report, IBM, November 1954 The oldest surviving programming language, Fortran remains widely used for scientific computation. Shockingly perhaps for people who went on from it to such “structured” languages as Pascal, you can in fact get a little more O-O frills in Fortran, although this is partly thanks to facilities that may be considered low-level and were intended for other goals. Some context Fortran was initially designed, as a tool for programming the IBM 704, by an IBM team under John Backus (later also instrumental in the description of Algol), with a first general release in 1957. Fortran II followed, introducing subroutines. Fortran IV solidified the language in 1966 (Fortran III, 704-specific, was not widely distributed), and was standardized by ANSI. The next revision process led to Fortran 77, actually approved in 1978, with better control structures and some simplifications. An even longer revision yielded Fortran 90 and Fortran 95, which have been diversely met and have not quite replaced their predecessors. For most people with a computing science degree earned after the First World War, Fortran is old hat, and they would rather be caught reading the Intel 4044 User’s Manual than admit they know anything about FORMAT and arithmetic IF instructions. In reality, however, quite a few programmed in Fortran at some stage, and many other people who are programmers by any objective criterion, even if their business card reads “theoretical physicist”, “applied mathematician”, “mechanical engineer” or even, in a few cases, “securities analyst”, use Fortran as their primary tool day in and day out. Fortran remains in common use not only for maintaining old software but even for starting new projects. To the outsider it sometimes seems that scientific programming — the world of Fortran — has remained aloof from much of the evolution in software engineering. This is partly true, partly not. The low level of the language, and the peculiar nature of scientific computing (software produced by people who, although scientists by training, often lack formal software education), have resulted in some software of less than pristine quality. But some of the best and most robust software also comes from that field, including advanced simulations of extremely complex processes and staggering tools for scientific visualization. Such products are no longer limited to delicate but small numerical algorithms; like their counterparts in other application areas, they often manipulate complex data structures, rely on database technology, include extensive user interface components. And, surprising as it may seem, they are still often written in Fortran. The COMMON technique A Fortran system is made of a main program and a number of routines (subroutines or functions). How can we provide a semblance of data abstraction? The usual technique is to represent the data through a so-called COMMON block, a Fortran mechanism for making data accessible to any routine that cares to want it, and to implement each of the associated exported features (such as put etc. for stacks) through a separate routine. Here for example is a sketch of a put routine for a stack of real numbers: Cited in [Wexelblat 1981]. The official name is FORTRAN, although the less obtrusive form is commonly used too
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有