Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Issue 23190016: editing doc comments for List class (Closed)

Created:
7 years, 4 months ago by mem
Modified:
7 years, 3 months ago
CC:
Lasse Reichstein Nielsen
Visibility:
Public.

Description

editing doc comments for List class BUG= R=kathyw@google.com Committed: https://code.google.com/p/dart/source/detail?r=26434

Patch Set 1 #

Total comments: 54

Patch Set 2 : integrated KW and Seth's comments #

Total comments: 8

Patch Set 3 : tweaks according to KW #

Patch Set 4 : removed/corrected a couple of links #

Patch Set 5 : merging with master & final tweaks #

Total comments: 10
Unified diffs Side-by-side diffs Delta from patch set Stats (+130 lines, -140 lines) Patch
M sdk/lib/core/list.dart View 1 2 3 6 chunks +130 lines, -140 lines 10 comments Download

Messages

Total messages: 13 (0 generated)
mem
Editing pass on List class.
7 years, 4 months ago (2013-08-16 22:05:52 UTC) #1
sethladd
more to come https://codereview.chromium.org/23190016/diff/1/sdk/lib/core/list.dart File sdk/lib/core/list.dart (right): https://codereview.chromium.org/23190016/diff/1/sdk/lib/core/list.dart#newcode19 sdk/lib/core/list.dart:19: * * Unmodifiable list. There's also ...
7 years, 4 months ago (2013-08-19 15:59:28 UTC) #2
Kathy Walrath
lots o' nits https://codereview.chromium.org/23190016/diff/1/sdk/lib/core/list.dart File sdk/lib/core/list.dart (right): https://codereview.chromium.org/23190016/diff/1/sdk/lib/core/list.dart#newcode28 sdk/lib/core/list.dart:28: * Examples: Add some more words ...
7 years, 4 months ago (2013-08-19 22:41:10 UTC) #3
mem
https://codereview.chromium.org/23190016/diff/1/sdk/lib/core/list.dart File sdk/lib/core/list.dart (right): https://codereview.chromium.org/23190016/diff/1/sdk/lib/core/list.dart#newcode19 sdk/lib/core/list.dart:19: * * Unmodifiable list. On 2013/08/19 15:59:28, sethladd wrote: ...
7 years, 4 months ago (2013-08-20 21:14:07 UTC) #4
Kathy Walrath
A few quibbles. Otherwise, LGTM. https://codereview.chromium.org/23190016/diff/6001/sdk/lib/core/list.dart File sdk/lib/core/list.dart (right): https://codereview.chromium.org/23190016/diff/6001/sdk/lib/core/list.dart#newcode91 sdk/lib/core/list.dart:91: * The created list ...
7 years, 4 months ago (2013-08-20 21:39:34 UTC) #5
mem
https://codereview.chromium.org/23190016/diff/6001/sdk/lib/core/list.dart File sdk/lib/core/list.dart (right): https://codereview.chromium.org/23190016/diff/6001/sdk/lib/core/list.dart#newcode91 sdk/lib/core/list.dart:91: * The created list is of fixed-length unless [growable] ...
7 years, 4 months ago (2013-08-20 23:18:19 UTC) #6
Kathy Walrath
LGTM. The only remaining thing I noticed (as we talked about off this thread) was ...
7 years, 4 months ago (2013-08-20 23:33:40 UTC) #7
mem
Committed patchset #5 manually as r26434 (presubmit successful).
7 years, 4 months ago (2013-08-21 15:47:04 UTC) #8
floitsch
DBC: I already made the same comments on Shailen's CL [0], but just to have ...
7 years, 3 months ago (2013-09-23 12:34:46 UTC) #9
Kathy Walrath
A few comments on Florian's comments. https://codereview.chromium.org/23190016/diff/18001/sdk/lib/core/list.dart File sdk/lib/core/list.dart (right): https://codereview.chromium.org/23190016/diff/18001/sdk/lib/core/list.dart#newcode48 sdk/lib/core/list.dart:48: * The created ...
7 years, 3 months ago (2013-09-24 00:47:41 UTC) #10
floitsch
https://codereview.chromium.org/23190016/diff/18001/sdk/lib/core/list.dart File sdk/lib/core/list.dart (right): https://codereview.chromium.org/23190016/diff/18001/sdk/lib/core/list.dart#newcode48 sdk/lib/core/list.dart:48: * The created list is fixed-length if _length_ is ...
7 years, 3 months ago (2013-09-24 10:37:14 UTC) #11
Kathy Walrath
https://codereview.chromium.org/23190016/diff/18001/sdk/lib/core/list.dart File sdk/lib/core/list.dart (right): https://codereview.chromium.org/23190016/diff/18001/sdk/lib/core/list.dart#newcode48 sdk/lib/core/list.dart:48: * The created list is fixed-length if _length_ is ...
7 years, 3 months ago (2013-09-24 17:12:39 UTC) #12
floitsch
7 years, 3 months ago (2013-09-24 17:21:47 UTC) #13
Message was sent while issue was closed.
https://codereview.chromium.org/23190016/diff/18001/sdk/lib/core/list.dart
File sdk/lib/core/list.dart (right):

https://codereview.chromium.org/23190016/diff/18001/sdk/lib/core/list.dart#ne...
sdk/lib/core/list.dart:48: * The created list is fixed-length if _length_ is
provided.
On 2013/09/24 17:12:41, Kathy Walrath wrote:
> > > This case is especially bad because the [length] here creates an x-ref to
> the
> > > length field, not to the length argument.
> > That's a bug in dartdoc.
> 
> It does seem like dartdoc should hew to the closest definition if we want to
use
> [] in this way. ("Closest definition" isn't equivalent to scope, it seems,
since
> `length` in the caller's code would refer to the instance variable, not to the
> name of the argument.)
> 
> So... What if you wanted to refer to the instance variable length in this
case?
> Would you use [List.length]? E.g.:
> 
> The [length] argument, if specified, sets the value of the [List.length]
> instance variable.
Not sure. But the argument is clearly in scope (otherwise we wouldn't be able to
refer to them in any dartdoc comment). It doesn't make sense that they come
after the instance variable, since the argument will shadow the instance
variable too.

> 
> > > Also, it's generally distracting to have a bunch of links within text. I'd
> > > rather use plain text except for a few judicious links. In fact, I think
> > > "_length_" can be just "length" or "the length" unless you really need to
> > > clarify that you're talking about the argument.
> > > 
> > > What do you think, Florian?
> > 
> > When we created dartdoc we decided not to use Java-like tags (@param,
@return,
> > etc.) but preferred plain English. The idea (at least for me) was to rely on
> > conventions to get similar behavior. For example, a sentence should start
with
> > "Returns" if it has the same meaning as Java's "@return". Similarly
sentences
> > should start with "Throws", if they describe an exception that is thrown.
> 
> Can you point me to an example of this?
> 
> It would seem to only really work for the first "sentence", since it's a
> sentence fragment. (It assumes an elliptical "This method/constructor".) After
> the first "sentence", we tend to use real, complete sentences. If we didn't,
the
> docs would read strangely.
That's fine. Relax it to: if the sentence contains the word "returns", ...

> 
> > Instead of "@param" we (I?) want to highlight sentences that refer to the
> > argument. So if the editor wants to give context information for a specific
> > argument it should highlight (or extract) all the sentences that talk about
> the
> > argument.
> 
> So this would be just for the editor (and other context-sensitive tools), not
> necessarily for the API docs? OK, that makes more sense.
Well the editor uses the API docs.

> 
> I'm still worried that people will leave out the [] or the API docs won't
treat
> it correctly. And it seems like the API docs are the most important thing, for
> now. It's going to be hard/inconvenient/unlikely for comment writers to test
how
> their comments will work in every permutation. If we could somehow make that
> testing easier or more rewarding, that could help.
That would be great. yes.
Ideally we should start to come up with rules that the editor can then implement
and that the writers can follow. We should have done this a long time ago, but
fortunately changing documentation isn't a breaking change...
> 
> > We could (and Lasse just agreed with me) provide even more guidelines: If a
> > sentence contains "argument [foo]", then this sentence will be used as short
> > description for the argument. Other occurrences of "[foo]" will be in the
long
> > description.
> > What this means: one should not just bracket every occurrence of the
argument.
> > In particular for examples it frequently does not make sense:
> > ===
> > In the following example [x] is set to 0 and therefore blablabla.
> > ===
> > This sentence should not be part of the short or long description of "x",
and
> > therefore the bracketing of "x" is bad.
> > 
> > So in this case (for the List factory) we could have something like:
> > Creates a list of the given length.
> > 
> > The optional argument [length] determines the length and type of the list.
> > 
> > The created list is fixed-length if [length] is provided.
> > 
> > The list has length 0 and is growable if [length] is omitted.
> > 
> > [length] must not be negative.
> 
> This is pretty choppy, with all those one-sentence paragraphs. Would it
ideally
> look more like this?
> 
>   The optional argument [length] determines the length and type of the list.
>   If you provide [length], the created list is fixed length; if you don't, the
>   list has length 0 and is growable. [length] must not be negative.
Sure.

> 
> > Note that this convention allows to combine the description of several
> arguments
> > into one line:
> > The argument [x] and argument [y] are the coordinates of the point.
> 
> That sounds awkward to me. If I were writing it naturally, it'd be:
> 
> The arguments [x] and [y] are the ....
I guess we could relax the rule to include "," and "and" for the "argument"
case.


> 
> > Finally: this is mostly a proposal and I don't think there is full agreement
> on
> > it.
> 
> There's never full agreement. :) But it's good that we're talking.
Agreed. Maybe I'm completely off (so make sure to talk to others too), but I
always hoped for these rules and support from the editor.

Powered by Google App Engine
This is Rietveld 408576698