www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3936] New: Suggestions for some better alternative names

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3936

           Summary: Suggestions for some better alternative names
           Product: D
           Version: 2.041
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc



In my mind (and in the mind of other programmers I know) a "byte" is an
unsigned value. This has caused some bugs in my programs. So A better naming
scheme can be "byte" and "sbyte" for the unsigned and signed bytes. But this is
a exception to naming scheme of D types, and it can cause other bugs. So as
compromise I think "ubyte" can be kept, but "byte" can be removed and replaced
by "sbyte".

------------------

In future D programs immutability will probably become quite common. Annotating
all not varying values in the code as "immutable" probably helps avoid some
bugs too, it looks like a good programming practice. The term "immutable" is
correct and readable, but it can be a little too much long. So it can be
replaced by "val" (short for "value", as present in the Scala language).

------------------

I find not easy to remember the size of the "wchar" and "dchar" types: is
something 'wide' wider than 'double'? But I don't have very good names to
replace them. For example they can be renamed as "shortchar" (or "char16") for
the 16 bits long, and "longchar" (or "char32") for the 32 bits long. The prefix
short/long makes the length easy to remember. But they are long names.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 12 2010
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3936




"longchar" is a bad name, because it's not 64 bit long.
char32 (or even "intchar") are better.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 25 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3936




Walter has refused the idea of changing wchar/dchar names.

(The "byte" ==> "sbyte" idea is in game still.)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 26 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3936




"auto ref" suggests a name as "auto const" instead of "inout".
Or better "auto_ref" and "auto_const".

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 31 2010
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3936




12:13:51 PDT ---
there's a common name for int8_t - tiny.

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