Variable naming for identical variables: Global vs Local #236
PeterConijn
started this conversation in
BC Best Practices
Replies: 2 comments 1 reply
-
Ps. once (if) we reach a consensus, I will create an issue and PR and add it to the page. |
Beta Was this translation helpful? Give feedback.
0 replies
-
AA0244 is about parameters vs globals. Is your discussion about naming all non-global variables, or the parameters specifically? Speaking generally, I tend to update the local names instead of the global names, but there are different scenarios. In one scenario, I tend to prefix the parameter with |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In our organization, questions have been raised on how we handle global and local variable names for identical variables. The reason this came up is because AppSourceCop is warning about it (AA0244).
So the question became: what is the preferred way of solving this? I have seen that Microsoft tends to affix some global variables with Global (e.g. SalesLineGlobal) and sometimes they affix parameters with "New" (e.g. NewLocationCode).
Since AppSourceCop requires affixes which can be either prefixes or suffixes, having a universal preferred method is tricky. Do we go SalesLineGlobalXXX or GlobalSalesLineXXX? NewLocationCodeXXX or LocationCodeNewXXX?
Similar questions are raised for situations of DataItem vs. Variable.
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions