L
lovecreatesbeauty
Some of the coding guideline are mandatory, and even the format or
layout of the text of the source code also should be followed. There's
plenty of codes like the following snippet.
Do you think the "re-evaluating the previous condition" is necessary
and should be avoided though it's one of your coding guideline? And
yes, there's plenty of code like this in many projects.
78 /* Error handling */
79 if ((NULL == p_SrcNm) || (NULL == p_DestNm))
80 {
81 lb_RetVal = false;
82
83 /* some other things special here ... */
84
85 if (NULL == p_SrcNm) /* Re-evaluating the previous
condition */
86 {
87 /* some other things special here ... */
88
89 ErrorEntryAdd(p_SrcNm);
90 ErrorHandle();
91 }
92
93 if (NULL == p_DestNm) /* Re-evaluating the previous
condition */
94 {
95 /* some other things special here ... */
96
97 ErrorEntryAdd(p_DestNm);
98 ErrorHandle();
99 }
100 }
layout of the text of the source code also should be followed. There's
plenty of codes like the following snippet.
Do you think the "re-evaluating the previous condition" is necessary
and should be avoided though it's one of your coding guideline? And
yes, there's plenty of code like this in many projects.
78 /* Error handling */
79 if ((NULL == p_SrcNm) || (NULL == p_DestNm))
80 {
81 lb_RetVal = false;
82
83 /* some other things special here ... */
84
85 if (NULL == p_SrcNm) /* Re-evaluating the previous
condition */
86 {
87 /* some other things special here ... */
88
89 ErrorEntryAdd(p_SrcNm);
90 ErrorHandle();
91 }
92
93 if (NULL == p_DestNm) /* Re-evaluating the previous
condition */
94 {
95 /* some other things special here ... */
96
97 ErrorEntryAdd(p_DestNm);
98 ErrorHandle();
99 }
100 }