News for hackers. Stuff that matters.
Re:Writing comments about pointer ownership by nice_byte on Sunday August 23, 2015 @02:52PM (#10106388)
While it's true that most people have to deal with lots of legacy code, as long as their compilers are up-to-date, it doesn't prevent them from using new language features.
Re:Writing comments about pointer ownership by pavlov on Sunday August 23, 2015 @03:05PM (#10106416)
In practice it often does, because introducing brand new patterns alongside existing ones may be frowned upon in a large project.

Consider a codebase that uses the "comment indicates ownership transfer" pattern everywhere. Would it improve the code quality if one developer suddenly introduced unique_ptr, std::move and rvalue references in just one place in the API, when every other call would still be using the old style?

To my taste, the mental overhead of having two different ownership patterns would outweigh the advantage of the new compiler checks (which in this case would be mostly theoretical, since the devs working on this project would presumably feel at home with the old pattern).