Worst Phobos documentation evar!
Walter Bright via Digitalmars-d
digitalmars-d at puremagic.com
Sat Dec 27 17:00:00 PST 2014
This is so bad there isn't even a direct link to it, it hides in shame. Just go
here:
http://dlang.org/phobos/std_encoding.html#.transcode
and scroll up one entry. Here it is:
size_t encode(Tgt, Src, R)(in Src[] s, R range);
Encodes c in units of type E and writes the result to the output range R.
Returns the number of Es written.
Let me enumerate the awesomeness of its awfulness:
1. No 'Return:' block, though it obviously returns a value.
2. No 'Params:' block, though it obviously has parameters.
3. No 'Example:' block
4. No comparison with other 'encode' functions in the same module.
5. No description of what 'Tgt' is.
6. No description of what 'Src' is.
7. No clue where the variable 'c' comes from.
8. No clue where the type 'E' comes from.
9. 'R' is a type, not an instance.
10. I suspect it has something to do with UTF encodings, but there is no clue.
There's simply no way to figure out what is going on here without reading the
source code.
Anyone want to take this on? There's a lot of stuff like this in Phobos. It's
too much for one person to tackle, but if each of us just pick a function here
and there, we can crowdsource and improve things greatly.
Some ones I've done, as examples of easy improvements:
https://github.com/D-Programming-Language/phobos/pull/2805
https://github.com/D-Programming-Language/phobos/pull/2812
https://github.com/D-Programming-Language/phobos/pull/2813
https://github.com/D-Programming-Language/phobos/pull/2814
More information about the Digitalmars-d
mailing list