Style: On capital letters in names

Johannes Loher johannes.loher at fg4f.de
Tue Jan 15 22:06:32 UTC 2019


On Tuesday, 15 January 2019 at 22:01:21 UTC, Victor Porton wrote:
> It seems that https://dlang.org/dstyle.html misses the question 
> how to name function which gets an URI (URI is an abbr written 
> in capital letters):
>
> getURI or getUri?
>
> Please answer this my question and also update the style guide.

See https://dlang.org/dstyle.html#naming_acronyms

Acronyms
When acronyms are used in symbol names, all letters in the 
acronym should have the same case. So, if the first letter in the 
acronym is lowercase, then all of the letters in the acronym are 
lowercase, and if the first letter in the acronym is uppercase, 
then all of the letters in the acronym are uppercase.

This clearly states it should be „getURI“, because the „U“ needs 
to be a capital letter because of camelCase


More information about the Digitalmars-d mailing list