好词典

subprogram

UK //ˈsʌbprəʊɡræm//US //ˈsʌbproʊɡræm//

词源

源自计算机科学领域,由前缀 sub-(表示'次级')和 program(程序)组合而成,1950年代开始使用。

noun

❶ 计算机程序中独立执行特定功能的一段代码,通常可被主程序或其他子程序调用,实现代码复用和模块化设计。

“The main program calls this subprogram to calculate the average value.”

(主程序调用该子程序来计算平均值。)

“Each subprogram should have a clear purpose and well-defined interface.”

(每个子程序都应有明确的功能和定义良好的接口。)

同义词:function, procedure, routine

常见短语

call a subprogram — 在程序中执行子程序的指令,将控制权暂时转移到子程序代码段。

“The program calls the subprogram whenever it needs to validate user input.”

(每当需要验证用户输入时,程序就会调用该子程序。)