2.2 Functions
If you place all the statements needed for the calculation of a complex task in a single coherent source code section (the main program), you’ll lose track of your own work as the number of program lines increases. The development process itself and subsequent changes to the source code are thus unnecessarily complicated, if not impossible. In this context, the subroutine technique provides the option to break down complex problems into subproblems that are easy to master. This structuring option is available in every programming language. However, in the discourse about modern programming languages (C, C++, Java), the term subroutine is no longer common; instead, the term function is used. In general, in modern programming ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access