The following two C# code snippets produce different results (assuming the variable level is used both before and after the recursive call). Why?
public DoStuff(int level) { // ... DoStuff(level++); // ... }
,
public DoStuff(int level) { // ... DoStuff(level+1); // ... }
After reading some of the responses below I thought it would be worthwhile posting the stack traces for level++, ++level and level+1 to highlight how deceiving this problem is.
I've simplified them for this post. The recursive call sequence starts with DoStuff(1).
// level++
DoStuff(int level = 1) DoStuff(int level = 2) DoStuff(int level = 2) DoStuff(int level = 2)
// ++level
DoStuff(int level = 4) DoStuff(int level = 4) DoStuff(int level = 3) DoStuff(int level = 2)
// level+1
DoStuff(int level = 4) DoStuff(int level = 3) DoStuff(int level = 2) DoStuff(int level = 1)
Test-retest reliability is a measure of reliability obtained by administering the same test twice over a period of time to a group of individuals. The scores from Time 1 and Time 2 can then be correlated in order to evaluate the test for stability over time.
For example, a group of respondents is tested for IQ scores: each respondent is tested twice - the two tests are, say, a month apart. Then, the correlation coefficient between two sets of IQ-scores is a reasonable measure of the test-retest reliability of this test.
How are reliability and validity assessed? Reliability can be estimated by comparing different versions of the same measurement. Validity is harder to assess, but it can be estimated by comparing the results to other relevant data or theory.
To clarify all the other responses:
+++++++++++++++++++++
DoStuff(a++);
Is equivalent to:
DoStuff(a); a = a + 1;
+++++++++++++++++++++
DoStuff(++a);
Is equivalent to:
a = a + 1; DoStuff(a);
+++++++++++++++++++++
DoStuff(a + 1);
Is equivalent to:
b = a + 1; DoStuff(b);
+++++++++++++++++++++
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With