delta-io / delta

An open-source storage framework that enables building a Lakehouse architecture with compute engines including Spark, PrestoDB, Flink, Trino, and Hive and APIs
https://delta.io
Apache License 2.0
7.59k stars 1.7k forks source link

[Kernel] Proposal to change naming convention for getter method #3814

Open ebyhr opened 2 weeks ago

ebyhr commented 2 weeks ago

Currently, kernel uses get prefix for getter method, but it will lead to inconsistent naming once we start using record of JDK 16.

I propose changing the convention to avoid get prefix as much as possible like Iceberg project. https://iceberg.apache.org/contribute/#method-naming

  1. Avoid get in method names, unless an object must be a Java bean.
    • In most cases, replace get with a more specific verb that describes what is happening in the method, like find or fetch.
    • If there isn't a more specific verb or the method is a getter, omit get because it isn't helpful to readers and makes method names longer.

Relates to https://delta-users.slack.com/archives/C04TRPG3LHZ/p1729770917226719

ebyhr commented 2 weeks ago

cc: @vkorukanti

vkorukanti commented 2 weeks ago

Thanks, @ebyhr, for creating this issue. The proposed convention makes sense to me.

One qn I have is for the setX (for mutable objects). Is this remain the same or is there a convention?