[osg-users] [ANN] Cross-platform examples for Linux, macOS, Windows, Android, iOS, and Web

Robert Osfield robert.osfield at gmail.com
Fri Sep 28 06:48:34 PDT 2018


On Fri, 28 Sep 2018 at 12:13, michael kapelko <kornerr at gmail.com> wrote:
> But so far I've seen no problem with `this` approach.

Well it compiles... and technically it's valid C++.

I don't believe it's a good practice though, you can do lots of crazy
things in C++ and still have it compile.  The 6 extra characters that
I have to read that takes my concentration away from the important
stuff that has relevant meaning i.e. the variables names and methods
that are being called.  The code is less readable.  Code that is less
readable takes more effort to understand.

When writing a tutorial for others to learn from it's paramount that
the code is readable and represents best practice so those less
experienced in programming can learn it quicker and adopt those same
good practices.  Using this-> isn't best practice C++, it's not even a
good practice, it's a practice that's makes the code less readable.

It makes it hard to recommend users have a look at your tutorials as I
really don't want users adopting dubious practices in their own code.

Robert.




However, for an experienced engineer to come at the code my response
was "WTF is going on here with use of "this->" everywhere".  It
confused me what special glude


More information about the osg-users mailing list