[Issue 6232] An idea for std.string.toStringz docs

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jun 30 19:35:16 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6232



--- Comment #5 from Jonathan M Davis <jmdavisProg at gmx.com> 2011-06-30 19:30:18 PDT ---
1. It only helps if you're actually keeping zero-terminated strings around,
which is likely an atypical use case. Usually, you pass it to the C function
and forget about it.

2. Even if your suggestion does help prevent bugs, _none_ of the C functions in
druntime are going to be declared to use CcharPtr, so it doesn't help at all
unless you're declaring a bunch of C declarations yourself. So, it makes no
sense to put the suggestion in the standard library's documentation. If
CcharPtr were in druntime or Phobos that would be different, but it isn't.

There are plenty of suggestions which could be given to improve code quality.
That doesn't mean that they belong in the standard library's documentation. If
there were some sort of page with tips for D programmers, then perhaps it could
go there, but I really don't think that it has any business going in the
standard docs.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list