ponyc icon indicating copy to clipboard operation
ponyc copied to clipboard

Write class String documentation

Open SeanTAllen opened this issue 9 years ago • 10 comments

There's some method level documentation but the class level where we should have lots of example code etc is just:

Strings don't specify an encoding

SeanTAllen avatar Apr 09 '16 18:04 SeanTAllen

bumping to sub myself.

chrisosaurus avatar Jul 28 '16 02:07 chrisosaurus

First pass attempt in #1087, feedback welcome :)

chrisosaurus avatar Jul 30 '16 05:07 chrisosaurus

Still need to add examples showing how encoding works, how accessing characters works

Not entirely happy with substring behaviour.

Filed #1088

chrisosaurus avatar Jul 30 '16 06:07 chrisosaurus

Given #1087 was merged, can this issue be closed now?

iktyrrell avatar Oct 14 '16 08:10 iktyrrell

Given the importance of string, I think we could add still more to bring ourselves up to having basics. I'm quite open to convincing.

SeanTAllen avatar Oct 14 '16 12:10 SeanTAllen

I'm touching on this in the string api RFC, but I actually think it would be worthwhile having a chapter in the tutorial on the builtin types that includes common use-cases. Out of scope for this ticket perhaps, as this relates to the class-level documentation.

iktyrrell avatar Oct 14 '16 12:10 iktyrrell

I'm not sure the tutorial is the right place for that. A "guide to the standard library" does sound like a good idea. I would imagine it to be a more guided version of what you get from the standard library docs. Perhaps it is the standard library docs but with meta information guiding you through it.

SeanTAllen avatar Oct 14 '16 12:10 SeanTAllen

To be clear, I am only talking about types in the builtin package, or at least those with literal syntax. A guide to the standard library sounds nice, though perhaps a cookbook would be an alternative way to illustrate "how to use". Not sure there is an obvious linear narrative for the library, but maybe just a collection of fundamentals - i/o, file access, networking etc.

iktyrrell avatar Oct 14 '16 12:10 iktyrrell

From a user standpoint, there's no difference between the classes in the builtin package vs those outside of it. Builtin exists because they require compiler support. There's no other reason for their organization into that package, so I wouldn't use that as a delimiting line for any documentation.

SeanTAllen avatar Oct 14 '16 13:10 SeanTAllen

Commenting so this get reviewed during Sync eventually.

There are a handful of methods without docstrings, but I do not think it is clear from the current state of String documentation and the thread here what is left to do before closing this issue.

rhagenson avatar Aug 30 '22 01:08 rhagenson