Can you do this with a class instance?

Started by
12 comments, last by Stainless 9 years, 10 months ago
If it's purely because of readability, you can consider making an auto &.. based on the mRenderer object and give it a name with one character. Then it would be: r->dothis() etc, keeping the original object's name untouched and clear to understand.

Personally I would keep it like you have right now and try bundling functions that you often call in "pairs" (like some said above)

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me

Advertisement

Some of the things programmers do to "tidy up code" or "reduce typing" are an absolute nightmare.

Some people call it "job security measures" because no fecker in the world can understand the code when you have finished with it.

Hell I saw one block of code where the programmer had redefined + - * / to be complex functions.

A += B just added the two values together and stored it in A

A = A + B created a matrix based on B, multiplied A by it converted the results to a vector normalised it and stored it in A

How the hell was I supposed to read the code?

Just don't do it unless you have a really, really good reason for it.

Just don't do it unless you have a really, really good reason for it.


Don't conflate obfuscation with simplification. Good simplifications make code easier to read, not harder.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

Just don't do it unless you have a really, really good reason for it.


Don't conflate obfuscation with simplification. Good simplifications make code easier to read, not harder.

And bad ones obfuscate the code smile.png

This topic is closed to new replies.

Advertisement