天天看點

幾個常見的計算機術語分析

instruction

   n.a manual usually accompanying a technical device and explaining how to install or operate it

routine

  n.Computer Science. A set of programming instructions designed to perform a specific limited task.

program

  n.Computer Science. a sequence of instructions that a computer can interpret and execute

subroutine

  n. Computer Science

        A set of instructions that performs a specific task for a main routine, requiring direction back to the proper place in the main routine on completion of the task.

subprogram

  n.A computer program contained within another program that operates semi-independently of the encasing program.

procedure

  n.Computer Science. A set of instructions that performs a specific task; a subroutine or function.

function

  n.Computer Science. A procedure within an application.

  所說subroutine和subprogram翻譯過來都是“子程式”的意思,但是,仔細分析其英文解釋,卻有着細微的差别。個人認為如果要劃分範圍的話,subprogram應該從屬于subroutine的範疇。

  從單詞的組成上來講,sub有“子”的意思,而分析routine和program我會注意到,

    routine是 A set of programming instructions

    而program則是A sequence of instructions

  更為關鍵的是program是一系列計算機能夠執行的指令,而routine是設計好的一系列程式指令(可以模糊的了解為使用者發出的指令),也就是說從routine到program還有一個層級的差異。換句話講,一個計算機應用程式,使用者在操作時發出一系列指令,主程式接收使用者的指令後,然後調用應用程式對應的功能子產品,而功能子產品也就是事先設計好的子程式(subroutine)(用“功能子產品”來描述有些牽強),當對應的功能子產品接收到指令後,然後繼續調用相應的subprogram,向其發出一系列指令(programming instruction),subprogram接收到指令後,在調用相應的函數(function)最終解釋執行為A sequence of instructions 。這一過程的路線圖為:

    Person ---> Application ---> Subroutine ---> SubProgram --->  Function --->Instruction --->Computer

  對應使用者來說,能夠接觸到的則是Application,或許還可以接觸到Subroutine,而Subprogram則是一個個的黑箱,裡面封裝了各種各樣的“苦力”Function,由它通過一系列Instruction來操作Computer,最終滿足使用者的要求。

  對于Procedure和Function之間有什麼差異,我也沒弄明白…………

繼續閱讀