| ▲ | anta40 5 hours ago | |||||||
Say to strictly enforce modularity, e.g helper functions that can only be accessed within its function. Pascal supports it (at least Turbo Pascal, no idea about ISO Pascal). | ||||||||
| ▲ | Joker_vD 4 hours ago | parent | next [-] | |||||||
For a counterpoint, see David R. Hanson's "Is block structure necessary?" (1981) [0] — back in those days, "block structure" meant nested routines with nested scopes — which argues that having instead a proper module system, with explicit control over what's being exported from a module, not only gives a better modularity, decomposition, and encapsulation, but also simplifies both the language's implementation, and the run-time structures it needs (remember displays, and the hardware support for them e.g. x86's ENTER?).
[0] https://drh.github.io/documents/blockstructure.pdf | ||||||||
| ▲ | kccqzy 3 hours ago | parent | prev [-] | |||||||
The traditional way of doing this in C is simply static functions. Every .c file has exactly one non-static function and all the other helper functions are static. | ||||||||
| ||||||||