[erlang-questions] correct terminology for referring to strings
Paul Barry
paul.james.barry@REDACTED
Tue Jul 31 11:41:48 CEST 2012
Hi Joe.
I think "string literal" is pretty widely understood (it even has a
WikiPedia entry, here: http://en.wikipedia.org/wiki/String_literal).
What threw me about your sentence was the use of the word 'codepoint',
which will be OK for those already familiar with Unicode, but might
confuse those who are not. My feeling (and this might be a gross
over-simplification) is that most North-American programmers know
about Unicode but don't let it worry them too much, resulting in less
of a familiarity with it than might be necessary (and I apologize to
any North-American programmers that this comment rubs the wrong way).
Perhaps "unicode characters" might be easier to read/understand?
Although not probably totally technically correct...
Another thing that you might wish to consider is breaking the sentence
in two, as follows:
<< An Erlang "string" is simply a list of integers. Each integer can
represent any Unicode codepoint/character. >>
Just my 2 cent.
Paul.
On 31 July 2012 10:24, Joe Armstrong <erlang@REDACTED> wrote:
> I'm working on a 2'nd edition of my book, and have got to strings :-)
> Strings confuse everybody, including me so I have a few questions:
>
> To start with Erlang doesn't have strings - it has lists (not strings)
> and it has string literals.
>
> I want to define a string - is this correct:
>
> << A "string" is a list of integers where the integers
> represent Unicode codepoints. >>
>
> Questions:
> Is the sentence inside << .. >> using the correct terminology?
> If not what should it say?
>
> Is the sentence inside << ... >> widely understood, do you think this
> would confuse a lot of people?
>
> Is the phrase "string literal" widely understood?
>
>
> Cheers
>
> /Joe
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
--
Paul Barry, w: http://paulbarry.itcarlow.ie - e: paul.barry@REDACTED
Lecturer, Computer Networking: Institute of Technology, Carlow, Ireland.
More information about the erlang-questions
mailing list