Here is the essential parts of a (HS) Junior level question from one of our (Canadian) national computing challenges. (http://www.cemc.uwaterloo.ca/contests/computing/2017/stage%201/juniorEF.pdf)
Problem start
Input Specification:
The first line of input contains the integer x (−1000 ≤ x ≤ 1000; x != 0). The second line of input contains the integer y (−1000 ≤ y ≤ 1000; y != 0).
Output Specification
Output the quadrant number (1, 2, 3 or 4) for a specific x,y coordinate.
end
I have long suspected a difference in the outcome between objects-early and objects-late. For instance, a student who was given an objects-early approach might create code like this:
public class Point
{
public Point( int x, int y)
{
this.x = x;
this.y = y;
}
public int getQuadrant()
{
if(x>0 && y>0) return 1;
if(x>0 && y<0) return 4;
if(x<0 && y>0) return 2;
if(x<0 && y<0) return 3;
return 0; // origin or no quadrant
}
private int x = 0;
private int y = 0;
}
Whereas a student who was given an objects-late approach might create code more like so:
public int determineQuadrant1( int x, int y )
{
if(x>0 && y>0) return 1;
if(x>0 && y<0) return 4;
if(x<0 && y>0) return 2;
if(x<0 && y<0) return 3;
return 0; // origin or no quadrant
}
And similarly later in the same challenge students were asked if there could arrive at a destination (coordinate) using an exact number of moves (energy) and I noticed these types of solutions:
public class Point {
public int distanceTo( Point p )
{ return | x – p.x | + | y – p.y | ; } // math notation used }
While Late Objects students continued to approach the solution as functions with:
int getDistance( int x1, int y1, int x2, int y2 )
{ /* same math */ }
What I think I am seeing is a preference for Early Object students to employ objects and services in their solutions from the start, while Late Object students kind of ease into it if at all. I have additional examples from questions later in the challenge that seem to support this.
Is there evidence, either published or anecdotal, that I am correct? Do we know that the order of instruction matters here?