Skip to content

Naming Convention: Properties vs Methods #488

@madsbk

Description

@madsbk

We want consistent naming of class members that don’t take any arguments. The goal is to clearly distinguish between cheap, read-only attributes and potentially expensive operations.

Naming Convention:

Properties

  • Definition: Cheap, read-only attributes.
  • Python: Use @property.
  • C++: Use noun-style naming.
    • Example:
      • Python: .size
      • C++: .size()

Methods

  • Definition: Potentially expensive operations.
  • Naming rule: Start with a leading verb.
  • Both Python & C++: Use regular methods.
    • Example:
      • Python: .get_table_view()
      • C++: .get_table_view()

TODO:

  • Rename C++ methods.
  • Rename Python methods.
  • Write a DEVELOPER_GUIDE.md.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions