J
Josh Mcfarlane
Just sort of curious because of a trend I've been noticing.
Around here, most of the newer students and even some professionals
that pick up C++ or another similar language tend to do inefficient
things with loops / iterations, such as:
array[0] = 0;
for (int i =1; i < size; ++i)
{
array = i;
}
or my favorite
for (int i = 0; i < 2*size; ++i)
{
if (i % 2 == 0)
dofunct(array[i/2]);
else
dootherfunct(array[i/2]);
}
Is proper iteration really that hard of a concept to grasp?
Around here, most of the newer students and even some professionals
that pick up C++ or another similar language tend to do inefficient
things with loops / iterations, such as:
array[0] = 0;
for (int i =1; i < size; ++i)
{
array = i;
}
or my favorite
for (int i = 0; i < 2*size; ++i)
{
if (i % 2 == 0)
dofunct(array[i/2]);
else
dootherfunct(array[i/2]);
}
Is proper iteration really that hard of a concept to grasp?