25.8k views
1 vote
What are the two issues that arise when subprogram names are parameters?

1 Answer

5 votes

Final answer:

The two issues that arise when subprogram names are parameters are aliasing, which can cause unintended side effects, and visibility problems, which may result in naming conflicts.

Step-by-step explanation:

When subprograms are allowed to have subprogram names as parameters, two main issues arise: aliasing and visibility problems. Aliasing occurs when the same subprogram parameter is passed by reference multiple times, or when a global variable and a subprogram parameter reference the same memory location. This can lead to side effects that are hard to anticipate and debug. Visibility problems, on the other hand, happen when the subprogram's parameter names clash with the names of subprograms or other identifiers within its scope, leading to confusion and errors.

User Ristogod
by
8.8k points