The one I hate the most is using untyped data - for example passing an Object around when it should really be a more specific type - inviting runtime errors at a later date.
The ultimate manifestation of this is methods like the following, which will break if any of the contents of the object arrays aren't the right class, but also unless all of the arrays are the exact same size:
Code: Select all
methodName(param1 : ObjectArray; param2 : ObjectArray; param3 : ObjectArray);
vars
iPos : Integer;
begin
foreach iPos in 1 to param1.size do
param1[iPos].MyClass1.doSomething(param2[iPos].MyClass2, param3[iPos].MyClass3);
endforeach;
end;
This "pattern" seems to be most common with developers that originally learned programming in a non-OO language and never adjusted.
I have a catapult. Give me all the money or I will fling an enormous rock at your head.