Re: C++ style question": "virtual" annotations on methods

2013-09-04 Thread Robert O'Callahan
On Thu, Sep 5, 2013 at 7:40 AM, Ehsan Akhgari wrote: > On 2013-09-04 12:18 AM, Robert O'Callahan wrote: > >> I like to put "virtual" on all methods that are virtual, even when it's >> not >> strictly necessary because the method overrides a virtual method of the >> parent class. >> >> Other peopl

Re: C++ style question": "virtual" annotations on methods

2013-09-04 Thread Nicholas Cameron
+1 for always using virtual (useful documentation without having to check the super class), even with MOZ_OVERRIDE (just style). Also +1 for /* static */ on method definitions (when they are declared static) because that is useful information. /* virtual */ on definitions, I don't find useful b

Re: C++ style question": "virtual" annotations on methods

2013-09-04 Thread Ehsan Akhgari
On 2013-09-04 12:18 AM, Robert O'Callahan wrote: I like to put "virtual" on all methods that are virtual, even when it's not strictly necessary because the method overrides a virtual method of the parent class. Other people disagree, especially when the method has MOZ_OVERRIDE on it as well.

Re: C++ style question": "virtual" annotations on methods

2013-09-04 Thread Jeff Walden
On 09/04/2013 05:24 AM, Benjamin Smedberg wrote: >> MOZ_OVERRIDE implies virtual, you get a compile error when you put >> MOZ_OVERRIDE on a non virtual > It does? That surprises me (it certainly wasn't the original intent of > NS_OVERRIDE). There are certainly cases where we want to override non-

Re: C++ style question": "virtual" annotations on methods

2013-09-04 Thread Benjamin Smedberg
On 9/4/2013 12:45 AM, Chris Pearce wrote: On 04-Sep-13 4:18 PM, Robert O'Callahan wrote: I like to put "virtual" on all methods that are virtual, even when it's not strictly necessary because the method overrides a virtual method of the parent class. Other people disagree, especially when the

Re: C++ style question": "virtual" annotations on methods

2013-09-04 Thread Nicolas Silva
FWIW, I like to write both virtual and MOZ_OVERRIDE. I care a lot about always using MOZ_OVERRIDE when applicable. For virtual (when MOZ_OVERRIDE is present) I suppose it is more of a matter of tastes. Always explicitly writing both virtual and MOZ_OVERRIDE is a simpler rule than marking virtual on

Re: C++ style question": "virtual" annotations on methods

2013-09-04 Thread L. David Baron
On Wednesday 2013-09-04 14:28 +1000, Cameron McCormack wrote: > Bobby Holley wrote: > >+1. EIBTI. > > I agree, though MOZ_OVERRIDE does imply that the function is virtual > already, so it may not be so necessary there. I also support repeating virtual as good documentation. The introduction of M

Re: C++ style question": "virtual" annotations on methods

2013-09-03 Thread Chris Pearce
On 04-Sep-13 4:18 PM, Robert O'Callahan wrote: I like to put "virtual" on all methods that are virtual, even when it's not strictly necessary because the method overrides a virtual method of the parent class. Other people disagree, especially when the method has MOZ_OVERRIDE on it as well. "v

Re: C++ style question": "virtual" annotations on methods

2013-09-03 Thread Cameron McCormack
Bobby Holley wrote: +1. EIBTI. I agree, though MOZ_OVERRIDE does imply that the function is virtual already, so it may not be so necessary there. There are many cases of member function declarations like: /* virtual */ void theFunction(); I'm assuming this is done because of some compile

Re: C++ style question": "virtual" annotations on methods

2013-09-03 Thread Bobby Holley
On Tue, Sep 3, 2013 at 9:18 PM, Robert O'Callahan wrote: > I like to put "virtual" on all methods that are virtual, even when it's not > strictly necessary because the method overrides a virtual method of the > parent class. > +1. EIBTI. ___ dev-platfo

C++ style question": "virtual" annotations on methods

2013-09-03 Thread Robert O'Callahan
I like to put "virtual" on all methods that are virtual, even when it's not strictly necessary because the method overrides a virtual method of the parent class. Other people disagree, especially when the method has MOZ_OVERRIDE on it as well. What say you all? Rob -- Jtehsauts tshaei dS,o n"