Skip to content

Nested or Compact Class and Module naming style? #199

Open
@mahdiar-naufal-shyftplan

Description

Hi, is there any specific style that you guys follow for class and module naming style, either nested or compact??
In the rubystyle guide they prefer nested due to surprising constant lookups

Using the scope resolution operator can lead to surprising constant lookups due to Ruby’s lexical scoping
ref: https://rubystyle.guide/#namespace-definition

example of nested:

class Foo
  class Bar
  end
end

example of compact:

class Foo::Bar
end

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