RFR: 8345732: Provide helpers for using PartialArrayState [v4]
Albert Mingkun Yang
ayang at openjdk.org
Wed Dec 18 19:32:38 UTC 2024
On Wed, 18 Dec 2024 18:58:54 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
>> Why is "set" more than important than "stats" in "set of stats objects"? If "UL logging" is critical, "log_stats" would be better. When I first read this name, I thought it's related to "set" as in "getter/setter" of log...
>
> "stats" is redundent here. Recall this is a static function. A client call is
> going to look like `PartialArrayTaskStats::log_set(...)`, so it's already
> obvious it's related to "stats" at the call site.
>
> A value assigning function would have a "set_" prefix. Using a "_set" suffix
> for that would be really weird and non-idiomatic (and a reader would be quite
> right to complain about such).
I don't feel that the redundancy here is bad, since the first two args are tied to "stats". OTOH, I find the trailing "set" super confusing. This function is to log/print multiple stats, and the most intuitive choice would have been "log/print" + "stats", because it directly communicates the action being performed (logging stats).
Emphasizing the collective noun instead of the actual noun seems odd. YMMV.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22622#discussion_r1890738140
More information about the hotspot-gc-dev
mailing list