"subroutines" in Chinese (Simplified)
子程序
Definition
子程序是计算机程序中可以单独执行特定任务的小模块,并且在需要时可以被重复调用。
Usage Notes (Chinese (Simplified))
“子程序”是编程领域的专有术语,有时也称为“函数”或“方法”,这些词通常可以互换,不过“子程序”往往偏向功能简单、独立的小模块。
Examples
We use subroutines to avoid repeating code.
我们使用**子程序**来避免重复代码。
The program has many subroutines for different tasks.
该程序有许多**子程序**来处理不同任务。
Each subroutine solves a specific problem.
每个**子程序**解决一个特定问题。
If your code gets too long, try breaking it into subroutines.
如果代码太长,不妨拆分成几个**子程序**。
Good programmers write clear subroutines others can reuse.
优秀的程序员会编写清晰的**子程序**,方便他人重复使用。
Debugging is easier when you organize your code into short subroutines.
把代码整理成简短的**子程序**,调试会更容易。