Difference between revisions of "Talk:Development:Reviewing"
(→Thoughts on review model: oops) |
(→Code style questions: more) |
||
(One intermediate revision by the same user not shown) | |||
Line 10: | Line 10: | ||
[6:50pm] ss|work2: s/big/complex<br> | [6:50pm] ss|work2: s/big/complex<br> | ||
[6:50pm] ardissone: small code can still have complex interactions<br> | [6:50pm] ardissone: small code can still have complex interactions<br> | ||
+ | |||
+ | == Code style questions == | ||
+ | |||
+ | [11:15am] peeja: do we line-break long method calls?<br> | ||
+ | [11:17am] ardissone|away: i believe people have been scolded for breaking 80, yes, but i'm not the right person to answer<br> | ||
+ | [11:17am] peeja: ok<br> | ||
+ | [11:17am] ardissone|away: that should be part of our code style doc if it's not...<br> | ||
+ | [...]<br> | ||
+ | [11:22am] peeja: do we try to use @class over #import?<br> | ||
+ | [11:22am] ardissone|away: i believe there's a rule for that for w/s/cocoa, but i don't know if we have one<br> | ||
+ | [11:23am] kreeger: peeja: you can pre-declare a class<br> | ||
+ | [11:23am] kreeger: rather than having to import that everytime a header is included<br> | ||
+ | [11:23am] kreeger: removes a shit load of dependencies<br> | ||
+ | [11:23am] peeja: ok<br> | ||
+ | [11:24am] kreeger: same thing in c++:<br> | ||
+ | [11:24am] peeja: when do you need to #import?<br> | ||
+ | [11:24am] kreeger: instead of:<br> | ||
+ | [11:24am] kreeger: #include "nsISupports.h"<br> | ||
+ | [11:24am] kreeger: class nsISupports;<br> | ||
+ | [11:24am] kreeger: although nsISupports wasn't the best example<br> | ||
+ | [11:24am] kreeger: ok<br> | ||
+ | [11:24am] kreeger: so the #import actually pulls the header into the file before compilation<br> | ||
+ | [11:25am] peeja: rught<br> | ||
+ | [11:25am] kreeger: so symbols (like classes and functions) can be defined at compiler time<br> | ||
+ | [11:25am] peeja: er, right<br> | ||
+ | [11:25am] kreeger: and #import imports the file only once<br> | ||
+ | [11:25am] kreeger: and #include imports everytime<br> | ||
+ | [11:25am] peeja: but in obj-c, where do we draw the line and use @class<br> | ||
+ | [11:25am] peeja: yeah, I know<br> | ||
+ | [11:25am] peeja: do we use it when we use methods?<br> | ||
+ | [11:25am] kreeger: the trick is to only use @class when you just need to define a class<br> | ||
+ | [11:26am] peeja: but don't need any of the methods in it?<br> | ||
+ | [11:26am] kreeger: but when you need to start using some of the classes meethods, you will need to #include/#import the header<br> | ||
+ | [11:26am] peeja: ok<br> | ||
+ | [11:28am] kreeger: #import isn't technically recommended for anything other than Apple's stuff<br> | ||
+ | [11:28am] kreeger: I try and only use it for Obj-C stuff, and use #include for everything else (c, c++)<br> | ||
+ | [...]<br> | ||
+ | [3:05pm] peeja|dunce: what's the proper way to typecast classes?<br> | ||
+ | [3:06pm] peeja|dunce: do we typically assert?<br> | ||
+ | [3:06pm] peeja|dunce: (not the syntax, but the policy, in case the typecast is wrong)<br> | ||
+ | [3:23pm] josh: peeja|dunce: in what code<br> | ||
+ | [3:23pm] josh: peeja|dunce: afaik, in Camino, there is no policy, just assess the situation and do what you think is necessary |
Latest revision as of 13:09, 21 June 2007
Thoughts on review model
[6:49pm] ss|work2: Everyone should be targeting the "newbie" reviewers first and letting the sr and/or smorgan look at it after that.
[6:49pm] ardissone: i agree
[6:50pm] ss|work2: If it's small code, let a newbie reviewer look at it, then an sr.
[6:50pm] ss|work2: If it's big code, newbie reviewer than smorgan, who might find more.
[6:50pm] ardissone: or complex
[6:50pm] ss|work2: That will help the newbie reviewer see what they missed as well without burdening the sr queue
[6:50pm] ss|work2: Right.
[6:50pm] ss|work2: s/big/complex
[6:50pm] ardissone: small code can still have complex interactions
Code style questions
[11:15am] peeja: do we line-break long method calls?
[11:17am] ardissone|away: i believe people have been scolded for breaking 80, yes, but i'm not the right person to answer
[11:17am] peeja: ok
[11:17am] ardissone|away: that should be part of our code style doc if it's not...
[...]
[11:22am] peeja: do we try to use @class over #import?
[11:22am] ardissone|away: i believe there's a rule for that for w/s/cocoa, but i don't know if we have one
[11:23am] kreeger: peeja: you can pre-declare a class
[11:23am] kreeger: rather than having to import that everytime a header is included
[11:23am] kreeger: removes a shit load of dependencies
[11:23am] peeja: ok
[11:24am] kreeger: same thing in c++:
[11:24am] peeja: when do you need to #import?
[11:24am] kreeger: instead of:
[11:24am] kreeger: #include "nsISupports.h"
[11:24am] kreeger: class nsISupports;
[11:24am] kreeger: although nsISupports wasn't the best example
[11:24am] kreeger: ok
[11:24am] kreeger: so the #import actually pulls the header into the file before compilation
[11:25am] peeja: rught
[11:25am] kreeger: so symbols (like classes and functions) can be defined at compiler time
[11:25am] peeja: er, right
[11:25am] kreeger: and #import imports the file only once
[11:25am] kreeger: and #include imports everytime
[11:25am] peeja: but in obj-c, where do we draw the line and use @class
[11:25am] peeja: yeah, I know
[11:25am] peeja: do we use it when we use methods?
[11:25am] kreeger: the trick is to only use @class when you just need to define a class
[11:26am] peeja: but don't need any of the methods in it?
[11:26am] kreeger: but when you need to start using some of the classes meethods, you will need to #include/#import the header
[11:26am] peeja: ok
[11:28am] kreeger: #import isn't technically recommended for anything other than Apple's stuff
[11:28am] kreeger: I try and only use it for Obj-C stuff, and use #include for everything else (c, c++)
[...]
[3:05pm] peeja|dunce: what's the proper way to typecast classes?
[3:06pm] peeja|dunce: do we typically assert?
[3:06pm] peeja|dunce: (not the syntax, but the policy, in case the typecast is wrong)
[3:23pm] josh: peeja|dunce: in what code
[3:23pm] josh: peeja|dunce: afaik, in Camino, there is no policy, just assess the situation and do what you think is necessary