> --
> Chromium Developers mailing list: chromi...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-dev
>
During my refactoring work, I've found OVERRIDE annotations to be useful. (More precisely, they've saved my rear several times.) If it were up to me, I'd make them mandatory. Is this an opinion shared?
By the way, it'd be also great to have some annotation that says "this is not an override", to make sure one is not accidentally overriding parent class' method (there might be even some old discussion about this).
During my refactoring work, I've found OVERRIDE annotations to be useful. (More precisely, they've saved my rear several times.) If it were up to me, I'd make them mandatory. Is this an opinion shared?
I've filed a bug: crbug.com/104314 and am looking into putting support for this into our clang style plugin. Let me know if you object.
Avi--
There's one case where you do not want to enforce this - when overriding a function defined in a header outside of the Chromium repo itself. For example, when implementing an interface defined in the WebKit API. Adding or requiring OVERRIDE for that case makes it extremely difficult to do rolls and two-sided commits since you can't do very useful things like land an implementation in chromium before landing the interface change in WebKit.
During my refactoring work, I've found OVERRIDE annotations to be useful. (More precisely, they've saved my rear several times.) If it were up to me, I'd make them mandatory. Is this an opinion shared?
On Tue, Nov 15, 2011 at 9:13 AM, Avi Drissman <a...@google.com> wrote:During my refactoring work, I've found OVERRIDE annotations to be useful. (More precisely, they've saved my rear several times.) If it were up to me, I'd make them mandatory. Is this an opinion shared?There's one case where you do not want to enforce this - when overriding a function defined in a header outside of the Chromium repo itself. For example, when implementing an interface defined in the WebKit API. Adding or requiring OVERRIDE for that case makes it extremely difficult to do rolls and two-sided commits since you can't do very useful things like land an implementation in chromium before landing the interface change in WebKit.If the .h and the .cc are both in the chromium repo then I strongly support making this required.
- Dominic
There's one case where you do not want to enforce this - when overriding a function defined in a header outside of the Chromium repo itself.
Avi