Skip to content

Improve code readability via importing constants in a right way #1588

@bharathappali

Description

@bharathappali

In Autotune.java we are accessing the constants in ServerContext.java in two different ways.

  1. We are accessing it via classname (ServerContext.ROOT_CONTEXT)
  2. We are directing importing the value and referencing it (KRUIZE_HTTP_THREAD_POOL_COUNT)

For any dev who is new to this codebase might feel some inconsistency in the way we access the constants, the two usage patterns mentioned above have same performance as it's a compile time effort to link the constants and in runtime we don't see any difference. But when it comes to coding experience, I feel referring with the class name makes more sense as the dev will be aware of the origin of the constant.

So changing all direct imports to classname based imports will help in dev experience and code readability.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions