Isaac
Lifelong Learner
- Local time
- Today, 11:36
- Joined
- Mar 14, 2017
- Messages
- 11,106
If I have 2 procedures, both with some required parameters, and let's say for whatever reason I've structured them in a way where there is one particular param that essentially has the same meaning & purpose to both procedures. Perhaps we could assume for the purpose of this question, to keep it simple, that there is a good reason for that. But I guess if you have an explanation for why this "ought" never be the case, I'm open to learning that too.
Sub1 does a few things and Sub2 does a few things, but each one of them needs this information - Param1. Therefore, it is a required parameter of both.
Are there any guiding principles here or not really?
Sub1 does a few things and Sub2 does a few things, but each one of them needs this information - Param1. Therefore, it is a required parameter of both.
- Are there any guidelines, experience, opinions on naming conventions for that Param1 ? As far as naming them the same, naming them different, or naming them specifically to indicate their hierarchy?
- Is your suggestion mostly for readability and maintenance, or is something involved that gets impacted with error handling or some other 'hard' result?
Are there any guiding principles here or not really?