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.
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…
[quote=“Weiti”]@ Bec a fuel:
Even if they thought that sometimes someone needs to extend that code - YAGNI
You aint gonna need it.
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.