openframeworks / openframeworks/openFrameworks

Begin using the "override" and "final" specifiers where appropriate.

Open
#4,856 5 comments 0 reactions 1 assignee View on GitHub

@bakercp is already working on this.

Since Feb 19, 2016.

development-strategy docsprint
Dominant language
C++
Stars
10.4k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
9

Description

In our documentation discussions (and based on the recent survey), it's clear that users find answers to their questions using a multiplicity of strategies. Many advanced users read the headers directly for answers. Thus, our push for "const-correctness" in recent years has made it much easier to determine essential qualities of the interface (e.g. passing pixels to function A will not modify the passed pixels) without digging too far into the implementation. Of course it also goes far to help users avoid mistakes.

Since our codebase heavily relies upon inheritance interface inheritance and subtyping and virtual hierarchies that can sometimes be confusing requiring users to drill down into our powerful virtual inheritance hierarchy (especially around pixels and video).

With the new support of c++11, I'd propose that continue building code that is clearer and easier to read for advanced users by employing the consistent use of the new override and final specifiers (http://en.cppreference.com/w/cpp/language/override and http://en.cppreference.com/w/cpp/language/final).

While I consider these specifiers to be valuable from a programming perspective (e.g. the application of final could be useful in some cases), they clearly signal and document intent API design intent, which in my mind works in concert with the written low-level doxygen-style documentation.

Timing on implementing this is clearly a concern -- a consistent application would touch a lot of headers -- but perhaps we could pick a milestone and move in that direction.

Like the successful const-correct push, it would not change functionality.

Feedback?

@arturoc @workergnome @ofZach @danomatika

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.