You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Greg Hudson <gh...@MIT.EDU> on 2002/11/20 10:37:09 UTC
nts -> cstring?
I would like our API to be consistent about how it refers to C-style
(null-terminated) strings. Right now some older functions use
"cstring" and some newer functions use "nts" (a lot fewer of them
after I simplified the svn_path interfaces). A summary:
nts cstring
--- -------
svn_xml_escape_nts svn_wc_translate_cstring
svn_xml_unescape_nts svn_cstring_split
svn_time_to_nts svn_cstring_split_append
svn_time_from_nts svn_utf_cstring_to_utf8_stringbuf
svn_time_to_human_nts svn_utf_cstring_to_utf8
svn_utf_cstring_from_utf8
svn_utf_cstring_from_utf8_fuzzy
svn_utf_cstring_from_utf8_stringbuf
svn_utf_cstring_from_utf8_string
I happen to find "cstring" a more readable convention (it wasn't at
all clear to me at first that "nts" stood for "null-terminated string"
and not some ISO time concept, when I first saw svn_time_to_nts). Are
there any -1s on renaming the last five _nts functions to _cstring
functions?
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: nts -> cstring?
Posted by Nuutti Kotivuori <na...@iki.fi>.
Greg Hudson wrote:
> I happen to find "cstring" a more readable convention (it wasn't at
> all clear to me at first that "nts" stood for "null-terminated
> string" and not some ISO time concept, when I first saw
> svn_time_to_nts). Are there any -1s on renaming the last five _nts
> functions to _cstring functions?
When I first noticed the _nts endings on functions I was so enchanted
about the naming that I went and fixed half the code at work to use
them.
What I like about nts is that:
* It specifies exactly what is going on - it's a null-terminated
string. I'm not saying that cstring would be too haphazard either,
but still for me, nts says it all. I guess I'm a bit tainted by
some weird code where CString was a class and so on.
* It's short and compact, you can easily stuff it in functions.
Ofcourse the negative is obvious:
* You don't realize it means a null-terminated string until after
you've seen it a few times.
But in any case, consistency is paramount - which way it goes here,
doesn't matter to me.
-- Naked
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: nts -> cstring?
Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Greg Hudson <gh...@MIT.EDU> writes:
> I happen to find "cstring" a more readable convention (it wasn't at
> all clear to me at first that "nts" stood for "null-terminated string"
> and not some ISO time concept, when I first saw svn_time_to_nts). Are
> there any -1s on renaming the last five _nts functions to _cstring
> functions?
Quite the opposite -- +1, I think it's clearer too.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org