Friday 5 January 2018

Bad Code...

You know when you open someones code and you find this inside a class function...

unsigned short currentMessageOffset = this->CurrentMessageOffset;

That you're in for a rough ride.

First of all, WHY assign the member value on the right to a local?  No-where else in the class is this value edited or read, so there's no need to assign it to anything.

And then the naming, this naming of something local with the same name, and it is the same name, despite the capitol leading letter, it's the same name, just makes this utterly useless.

All this before even mentioning that the code is an assignment not an allocation, so annoying.

No comments:

Post a Comment