Hacker News new | ask | show | jobs
by avian 1484 days ago
> Someone had to translate GL_MAX_TEXTURE_SIZE into mMaxTextureSize.

I fail to see how the fact that the Latin alphabet has upper and lower case is to blame for this. This is more about the coding standards the author has to abide to than anything else.

If your coding standard would require you to name the property MMAXTEXTURESIZE instead of mMaxTextureSize, would there be any less busy work?

2 comments

even if his coding standard allows GL_MAX_TEXTURE_SIZE, I still don't see the point. One (original) GL_MAX_TEXTURE_SIZE is a global constant and his limits.GL_MAX_TEXTURE_SIZE is just a member. You will still need a "conversion" code for every constant there is.

    Notice all this busy work
And the code that comes after that is same amount of work, except typing mMaxTextureSize instead of copy pasting GL_MAX_TEXTURE_SIZE perhaps. Is he really complaining about this?

Also is author pushing for everyone should follow one standard? Hard to say what he is asking for.

And often I want to see where the member is using without seeing everywhere the global constant is.

And yes, all this can be fixed by using a context aware IDE, but so can OP's original problem.

I mean, they're already using Hungarian notation wrong[1], if you want painless translations use a language that allows for reflection and use smarter naming conventions

[1] https://www.joelonsoftware.com/2005/05/11/making-wrong-code-...