[what is important to review] I find myself surprised, not completely unpleasently, at how different our tendencies are on this.
I say this is a little good, because it's a more complete picture of what we should be doing than any one of us would have. But it's mostly bad, because IMO, having each of us checking what we feel like stinks.
A. It sends out a really confused message as to what code should be like (you need a class comment, except if dvf is checking it, in which case just make sure you're not adding anything to Object! ;-) B. It's not a way to improve the quality of the code. Let's face it, if three of the harvesters don't have the same standards, why the heck should we assume that Ted does have (and if does, who's does he have? Mine? Doug's?)
We need a policy. It doesn't have to be complicated, but it needs to keep the image clean, systematically, not by chance. We need to balance this with keeping things fun, sure, so we'll have to be smart about it, but we need to deal with this. If we are warm and fluffy on this one, we can stop the cleanup projects right now, because quality will go down, not up, no matter how hard they work.
If we agree on this, here are some things I think we could do - * Find a good online reference for writing good Smalltalk code, ideally, something like Kents "Best Smalltalk practices". * All of us read it, read all code before approving stuff, and point people at the manual when said stuff stinks. * Require use of SLint. It's easy to install, there's a "SmallLint Tutorial" on SM. * Maybe make class comments mandatory, and implement some automated check for this, so I don't forget it.
What do you think? Other ideas?
Daniel
Doug Way dway@riskmetrics.com wrote:
goran.krampe@bluefish.se wrote:
Daniel Vainsencher danielv@netvision.net.il wrote:
Except for one thing - I haven't seen him post critical comments on any of the code he's reviewed, and for anyone that's going to be able to get stuff into the image where we all have to live with it, I want to know that he can be point out where code is lacking.
True, although I have to admit that I don't often have comments about the source code that I'm reviewing. More often I have a comment about some aspect of what the change does. (such as my extra comments about the BoundsInHaloFix2 changeset)
I guess I usually just give the source code (diffs) a quick look-over to make sure that nothing jumps out at me as being ugly. As far as judging source code, another factor is who wrote it... typically I will have a level of trust that somone like Ted Kaehler or Ned Konz won't need to have their code heavily scrutinized, but I may look more closely at the code of someone I don't know. (However, external testing is another matter... that's equally important for all submissions.)
Personally I have found that the code I have reviewed from others generally is good - but class comments and method comments tend to lack IMHO.
I really want the quality of comments to be higher in the official classes. I would personally never let classes in without class comments.
This is probably a good rule of thumb. New classes should certainly include class comments before we approve them. It's harder to have any simple rule about method comments... most methods do not need comments and should not have them, but some methods do need comments.
Except for the selection aspect, this is also important because posting these public comments is the way knowledge is transmitted about good/bad practice, and not just to the author of the specific code.
What does everybody think?
I definitely think Marcus should be a Harvester - if he likes to be one. :-)
I agree. (Oh wait, I see he's already approving items anyway... :-) )
- Doug Way
Squeakfoundation mailing list Squeakfoundation@lists.squeakfoundation.org http://lists.squeakfoundation.org/listinfo/squeakfoundation
Hi all!
Daniel Vainsencher danielv@netvision.net.il wrote:
[what is important to review] I find myself surprised, not completely unpleasently, at how different our tendencies are on this.
I say this is a little good, because it's a more complete picture of what we should be doing than any one of us would have. But it's mostly bad, because IMO, having each of us checking what we feel like stinks.
What we feel like?
A. It sends out a really confused message as to what code should be like (you need a class comment, except if dvf is checking it, in which case just make sure you're not adding anything to Object! ;-)
I never said that the only thing I check for is a class comment - I just noted that the code I have been looking at sofar has mostly been lacking in that department. I would be very wary of letting new methods into class Object too.
B. It's not a way to improve the quality of the code. Let's face it, if three of the harvesters don't have the same standards, why the heck should we assume that Ted does have (and if does, who's does he have? Mine? Doug's?)
I am not sure we have such different standards - but I still agree that we need a policy.
We need a policy. It doesn't have to be complicated, but it needs to keep the image clean, systematically, not by chance. We need to balance this with keeping things fun, sure, so we'll have to be smart about it, but we need to deal with this. If we are warm and fluffy on this one, we can stop the cleanup projects right now, because quality will go down, not up, no matter how hard they work.
If we agree on this, here are some things I think we could do -
- Find a good online reference for writing good Smalltalk code, ideally,
something like Kents "Best Smalltalk practices".
- All of us read it, read all code before approving stuff, and point
people at the manual when said stuff stinks.
What did you mean with "read all code" - you mean instead of simply "trusting" someone? I always read all code I review, regardless of author.
- Require use of SLint. It's easy to install, there's a "SmallLint
Tutorial" on SM.
- Maybe make class comments mandatory, and implement some automated
check for this, so I don't forget it.
I really think class comments should be mandatory.
What do you think? Other ideas?
Well, it would be interesting to write down the policy somewhere - at least the non obvious and the mandatory stuff. I am not saying "Swiki" because I am a bit tired of simply creating more and more pages on the Swikis, but if no other smarter way is found then sure, why not.
regards, Göran
Daniel Vainsencher wrote:
(...)
- Maybe make class comments mandatory, and implement some automated
check for this, so I don't forget it.
What do you think?
* Make more examples and assertions
Examples would help us to understand code and and to write tests.
So in addition to the KernelCleaningProject (KCP) and the MorphCleaningProject (MCP) I set up a wiki-page for an Example group (Eg)
http://minnow.cc.gatech.edu/squeak/3248 -------------------------- Goals
Provide examples for most of the classes.
Vision
If we had examples everywhere, it would be much easier to
- test code - understand code - type check code - compose new code in a test-driven style
Howto
Create a category on the class-side called *Eg-example-objects Create your example, stored in a method exampleFoo Send the changeset to the list as an enhancement [Enh]
Example
TextUrl class >> exampleSqueak ^self new url: 'http://www.squeak.org'
Text class >> exampleSqueakLink ^self string: 'Squeak!' attribute: TextURL exampleSqueak
TextMorph class >> exampleSqueakLink "self exampleSqueakLink openInWorld"
^self new contents: Text exampleSqueakLink
And soon you also find out (manually though), that you are asked if you want to open this link in a web-browser, but there is none anymore :-/
So please, join us and let us code for making the code more understandable and testable. It's easy...
Cheers,
Markus
Well, I would describe my current practice of checking some people's code more thoroughly than others as a temporary expediency, not a long-term policy. ;-) I agree that we need some sort of policy.
I guess what we're talking about here is what it means for something to be externally reviewed [er]. (Hmm, one confusing thing on http://minnow.cc.gatech.edu/squeak/3103 is that the description for [et] says that [et] also implies [er] and [cd], which seems incorrect to me.)
Anyway, a good start on getting a policy going might be to create a standalone tool which operates on a changeset, which would check for things like class comments being in place for newly defined classes. It could also run some subset of SLint tests (whichever rules we agree on), so SLint would be a prerequisite of the tool. (One issue I ran into with SLint is that it would be nice if it could just be run on the changed code, not the entire method. That might not be simple to implement, I realize.)
Plus the tool could have a few simple checks to make my life as the update-stream manager easier, such as making sure the changeset name isn't too long, doesn't have funny characters in it, etc. (Simply forcing it to be a changeset is even of some value... for example I'm about to incorporate Michael's network rewrite, but that's a SAR file, so I have to incorporate the 10 or so changesets/fileins separately, some of which could probably be combined, etc. Not a huge problem but still it's a bit of extra work for me.)
Then the idea would be that any submission must pass through the tool before it is [approved]. The harvesters could use the tool at first, but eventually people submitting things would want to run submissions through the tool themselves.
- Doug
Daniel Vainsencher wrote:
[what is important to review] I find myself surprised, not completely unpleasently, at how different our tendencies are on this.
I say this is a little good, because it's a more complete picture of what we should be doing than any one of us would have. But it's mostly bad, because IMO, having each of us checking what we feel like stinks.
A. It sends out a really confused message as to what code should be like (you need a class comment, except if dvf is checking it, in which case just make sure you're not adding anything to Object! ;-) B. It's not a way to improve the quality of the code. Let's face it, if three of the harvesters don't have the same standards, why the heck should we assume that Ted does have (and if does, who's does he have? Mine? Doug's?)
We need a policy. It doesn't have to be complicated, but it needs to keep the image clean, systematically, not by chance. We need to balance this with keeping things fun, sure, so we'll have to be smart about it, but we need to deal with this. If we are warm and fluffy on this one, we can stop the cleanup projects right now, because quality will go down, not up, no matter how hard they work.
If we agree on this, here are some things I think we could do -
- Find a good online reference for writing good Smalltalk code, ideally,
something like Kents "Best Smalltalk practices".
- All of us read it, read all code before approving stuff, and point
people at the manual when said stuff stinks.
- Require use of SLint. It's easy to install, there's a "SmallLint
Tutorial" on SM.
- Maybe make class comments mandatory, and implement some automated
check for this, so I don't forget it.
What do you think? Other ideas?
Daniel
squeakfoundation@lists.squeakfoundation.org