I suck at typedef naming

Feb 11, 2018 at 10:17pm
Hello,

I was following the call stack, to figure out where things had gone terribly wrong, when I came across this variable named section. Section of what?, I thought. After a quick search it was a typedef of std::pair<Coordinate, Coordinate> to model a line segment. I found the problem, fixed it, and did a project wide search for typedef. Result: typedef unsigned int maga; what the hell is maga? It was at this point I realized I sucked at giving my typedefs good meaningful names.
It would seem I've fallen back into bad habits when it comes to naming these. Any tricks or advice on good naming for typedefs is greatly appreciated.
Thank you for your time.
Feb 11, 2018 at 11:37pm
It sounds like you already understand that type names should be meaningful, so I think it's fair to assume that "maga" actually does have meaning, but that you just forgot what it was. In that case, maybe you don't need to learn how to name things, but rather you need to comment on the rationale that led you to choose that name, and the purpose of that typedef.
Topic archived. No new replies allowed.