You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Ole Ersoy (JIRA)" <di...@incubator.apache.org> on 2007/04/15 01:36:15 UTC

[jira] Updated: (DIR-209) Convention for Naming Constants

     [ https://issues.apache.org/jira/browse/DIR-209?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ole Ersoy updated DIR-209:
--------------------------

    Description: 
Our code would be much easier to read if we agree to use a set of conventions for naming constants.

Here's an example:

String TOP_OBJECT_CLASS_NAME = "top";
String CN_ATTRIBUTE_TYPE_NAME = "cn";

As a general convention we should always spell out
fully what something is (With a few exceptions for things like DIT,
etc. that are really well defined within their Conceptual Domain, and
would make the constant string really long.

Right now we have things like:
M_OID_AT
MR_OID
etc.

And I can guess what these mean fairly easily, but as we
add more and more, this just adds to the cognitive load
of understanding the code base, and ultimately slows development,
especially for newcomers.

Cheers,
- Ole



  was:
Our code would be much easier to read if we agree to use a set of conventions for naming constants.

Here's an example:

String TOP_ATTRIBUTE_TYPE_NAME = "top";
String CN_ATTRIBUTE_TYPE_NAME = "cn";

As a general convention we should always spell out
fully what something is (With a few exceptions for things like DIT,
etc. that are really well defined within their Conceptual Domain, and
would make the constant string really long.

Right now we have things like:
M_OID_AT
MR_OID
etc.

And I can guess what these mean fairly easily, but as we
add more and more, this just adds to the cognitive load
of understanding the code base, and ultimately slows development,
especially for newcomers.

Cheers,
- Ole




> Convention for Naming Constants
> -------------------------------
>
>                 Key: DIR-209
>                 URL: https://issues.apache.org/jira/browse/DIR-209
>             Project: Directory
>          Issue Type: Task
>          Components: miscellaneous
>            Reporter: Ole Ersoy
>         Assigned To: Ole Ersoy
>            Priority: Minor
>
> Our code would be much easier to read if we agree to use a set of conventions for naming constants.
> Here's an example:
> String TOP_OBJECT_CLASS_NAME = "top";
> String CN_ATTRIBUTE_TYPE_NAME = "cn";
> As a general convention we should always spell out
> fully what something is (With a few exceptions for things like DIT,
> etc. that are really well defined within their Conceptual Domain, and
> would make the constant string really long.
> Right now we have things like:
> M_OID_AT
> MR_OID
> etc.
> And I can guess what these mean fairly easily, but as we
> add more and more, this just adds to the cognitive load
> of understanding the code base, and ultimately slows development,
> especially for newcomers.
> Cheers,
> - Ole

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.