I don't remember exactly where I did this, but I did manage to pull this one off once:
int& derp = derp;
It annoys me that this is even allowed in the language.
These are my "dumbest" moments, in C++ at least:
struct Foo
{
Foo(float u, float v) : u(u), v(u)
{
}
float u;
float v;
};
A related version:
struct Bar
{
Bar(float someVariableX, float someVairableY)
:
someVariableX(someVariableX),
someVariableY(someVariableY)
{
}
float someVariableX;
float someVariableY;
};
lotsAndLotsAndLotsOfCode();
for(int i = 0 ; i < N ; +i) {
lotsAndLotsAndLotsOfCode();
frobnicate(i);
lotsAndLotsAndLotsOfCode();
}
lotsAndLotsAndLotsOfCode();
The common problem was dismissing the problematic code as being too trivial to contain a bug, and spending lots of time debugging the calling/called code looking for errors. One gets too used to reading what one expects to be the case, rather than reading what is actually there.