Discussion Overview
The discussion revolves around the programming style related to leaving an empty if statement in a recursive function in C++. Participants explore whether this practice is considered bad programming style and if it poses any potential dangers.
Discussion Character
- Debate/contested
- Technical explanation
Main Points Raised
- One participant expresses unease about having an empty if statement in their recursive function, questioning if it is bad style or potentially dangerous.
- Another participant argues that the original code is acceptable, noting that the comment "//do nothing" clarifies the intent.
- Some suggest alternative structures, such as using a return statement or modifying the recurrence condition to eliminate the need for an else statement.
- There is a viewpoint that in high-quality programming circles, the absence of an else statement might indicate a problem, and some would prefer to explicitly include a null else to demonstrate intent.
- One participant mentions that the choice depends on personal style and acceptance within the programming community.
- Another participant states a preference for having exit cases before recursive calls, indicating that they find the original structure suitable.
Areas of Agreement / Disagreement
Participants express differing opinions on the appropriateness of leaving an empty if statement in recursive functions. There is no consensus on whether it is bad style or acceptable, and multiple perspectives on programming practices are presented.
Contextual Notes
Some suggestions involve changing the recurrence condition or restructuring the code, but these are not universally agreed upon and depend on individual programming preferences.