Skip to content

Commit 2e8d269

Browse files
simplify G-1050 based on #206
1 parent c2e946f commit 2e8d269

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

docs/4-language-usage/1-general/g-1050.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ Literals are often used more than once in your code. Having them defined as a co
99

1010
All constants should be collated in just one package used as a library. If these constants should be used in SQL too it is good practice to write a deterministic package function for every constant.
1111

12-
In specific situations this rule could lead to an extreme plethora of constants, for example if you use Logger like `logger.append_param(p_params =>l_params, p_name => 'p_param1_todo', p_val => p_param1_todo);`, where the value for `p_name` always should be the name of the variable that is passed to `p_val`. For such cases it would be overkill to add constants for every single variable name you are logging, so if you use Logger or similar, consider making that an exception to the rule, just document exactly which exceptions you will allow and stick to them.
13-
14-
Another exception is literals in views. It is not possible to use constants there, and using functions to wrap constants can have a negative impact on performance when peeking at binding variables is essential for an optimal execution plan.
15-
16-
To reduce the number of false positives, the number of occurrences of a literal should be less than 3.
12+
To avoid an extreme plethora of constants or false positives, a literal should not occur more than once within a file.
1713

1814
## Example (bad)
1915

0 commit comments

Comments
 (0)