[policy, then patch] Decide on coding standard for configuration keys of ConfigEntities

Created on 5 November 2012, over 11 years ago
Updated 14 March 2024, 4 months ago

Problem/Motivation

The member variables of ConfigEntity's map 1-to-1 to the configuration keys in the corresponding config YAML files. Coding standards dictate lowerCamelCase for member variables in OOP code and underscore_separated for config keys. We need to decide what we want here. Most ConfigEntity's are not bitten by this, because they only contain one-word keys, in which case lowerCamelCase and underscore_separated fall together. :-)

We already have an inconsistency in core with the View entity (View::base_table) and the Breakpoint and BreakpointGroup entities.

Proposed resolution

-

Remaining tasks

Decide on one of the following:

  1. Make class members of configuration entities that map to configuration keys underscore_separated.
    Con: This violates the coding standards for object-oriented code.
  2. Make configuration keys that map to class members of configuration entities lowerCamelCase.
    Con: This violates the coding standard for configuration keys.
  3. Change our coding standard to require lowerCamelCase for all configuration keys.
    Con: It feels unnatural to use lowerCamelCase for non-object-oriented code. (This in a way applies to 2. as well.)
  4. Introduce an abstraction layer that maps underscore_separated configuration keys to lowerCamelCase class members.
    Con: More code, additional abstraction.

User interface changes

-

API changes

-

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component
DocumentationΒ  β†’

Last updated about 18 hours ago

No maintainer
Created by

πŸ‡©πŸ‡ͺGermany tstoeckler Essen, Germany

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024