On 07/05/2012 09:32 PM, dcoder wrote:
Thanks for the thorough explanation, but it begs the question why not make strings be array of chars that have \0 at the end of it?
Because that is inefficient. It disables string slicing and is completely redundant.
BTW: String literals are guaranteed to be zero-terminated.
Since, lots of D programmers were/are probably C/C++ programmers, why should D be different here?
Because it is a superior model.
Wouldn't it facilitate more C/C++ programmers to come to D?
Why would that matter?