[Issue 4070] prefix const on member functions considered confusing

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Apr 5 13:44:05 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4070


Steven Schveighoffer <schveiguy at yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schveiguy at yahoo.com


--- Comment #2 from Steven Schveighoffer <schveiguy at yahoo.com> 2010-04-05 13:44:02 PDT ---
The point is that it's confusing, not inconsistent.  It's confusing to read
since the this parameter is hidden.  Yes, it's consistent and unambiguous, but
it's confusing.

It's your prerogative not to disallow the syntax, but keep in mind that
allowing the const before a function that returns a type will result in most
style guides advising against it because it's too confusing.  Effectively, the
fact that it's confusing will negate its usage.

Isn't one of the goals of the programming language to come up with consistent,
*sensible* syntax?

This is compounded by the fact that the const qualifier has an alternative
location.

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


More information about the Digitalmars-d-bugs mailing list