官术网_书友最值得收藏!

Functions

A function is a block of code that can be defined once and reused any number of times. When writing programs, it is best practice to break up complex programmatic processes into smaller units that perform specific tasks. Doing this has many advantages, some of which are:

  • Improving code readability: It is much easier to read programs that have been broken down into functional units. This is because the scope of the code to be understood at any given point in time is reduced when functions are utilized. The majority of the time, a programmer needs to only write or adjust a section of a large code base. When functions are utilized, the context of the program that needs to be read to ameliorate program logic is restricted to the body of the function in which the logic is written.
  • Improving the maintainability of a code base: The use of functions in a code base makes it easy to maintain programs. If a change needs to be made to a particular program feature, many times it is as easy as adjusting a function in which the feature has been created.
主站蜘蛛池模板: 宽甸| 明溪县| 株洲县| 安化县| 灵石县| 钦州市| 方山县| 东海县| 淅川县| 苍山县| 罗源县| 沅陵县| 长乐市| 襄垣县| 阳高县| 澎湖县| 柘城县| 德化县| 伊金霍洛旗| 萍乡市| 右玉县| 蒲江县| 邵阳县| 枣庄市| 浦北县| 夏河县| 安化县| 靖边县| 霞浦县| 遵义市| 正蓝旗| 兴和县| 普兰店市| 凤冈县| 三江| 瑞安市| 郸城县| 克拉玛依市| 康定县| 旌德县| 莲花县|