We were struggling to get developers at the office so in managements whizdom we took on an offshore team of 5.
They have since been let go - here is an example of how they fleshed out their code…
public static bool Comparison(bool? status)
{
if (status == true)
{
return true;
}
else
{
return false;
}
}
As is, this is indeed “funny” or at least not really glorious
But… maybe there was some code inside the IF sections at some time ?
Something like displaying messages, debug code or even calls to other methods depending on the test result. Once not useful anymore, thoses lines of code may have been removed but not the structure, hence leaving such a beautiful code…
What makes me thinking at this is the fact that a specific function has been created for a comparison. If it was a simple logical test, there was no need to even create the function. You see what I mean ?
Anyway, a second reading of the code should have avoided leaving such a thing, I admit.
hmmm really…
i must admin they must be smart people, simply because they know how to create a lot of work that simply does nothing (and get paid) i wonder how long they were doing this under your noses… so hey they had to get innovative and start creating code that does a lots of noting … and they take that nothing and run it through a function that would make sure it is truly nothing.
lucky for me that these folks existed otherwise, the management would have never knew how my skills really matter…
back to fixing code…
@ Jay Jay - indeed. The really scary part of it is that was at least readable even thou it did nothing, you should see what they did with Background Worker threads…OMG…
[quote=“Weiti”]@ Bec a fuel:
Even if they thought that sometimes someone needs to extend that code - YAGNI
You aint gonna need it.
[/quote]
Indeed. And I completely agree.
My purpose was more to say that these guys might have needed at some time in the process to add some “useful” code (at leat, useful for them) in the IF structure and that after they didn’t need it anymore they have removed it but forgot to/didn’t remove the now unneeded IF structure.
I generally don’t trust any code that wasn’t written at my own desk. That probably makes me a jerk, but at least when stuff breaks, I know who to blame