FrankChen021 commented on pull request #10635:
URL: https://github.com/apache/druid/pull/10635#issuecomment-757192914


   
   > 
   > * IMO the name `decimal_format` is misleading. It sounds like a function 
that will format a number to a specific amount of decimals. Maybe instead we 
could call it `human_readable_decimal_format`. For consistency it may then be 
nice to call the others `human_readable_binary_byte_format` and 
`human_readable_decimal_byte_format`. The function names are long, but I think 
that's probably better than being misleading. Any thoughts @FrankChen021, 
@abhishekagarwal87, @clintropolis?
   
   Naming is really a big challenge in the world of programming :) . There're 
some ways listed as follows
   
   * Alternative 1 - One function with different format specifier
    format(number, 'human_readable_bin_byte')
    format(number, 'human_readable_dec_byte')
    format(number, 'human_readable_decimal')
   
   It looks like the parameters are still too long.
   
   * Alternative 2 - One function with abbreviated format specifier
   format(number, 'si') -- si is the standard word for binary byte.
   format(number, 'iec') -- iec is the standard word for decimal byte
   format(number, 'dec') 
   
   If we want to design one function, the challenge is how to give nice names 
for format specifiers. But it also leaves the extensibility in the future to 
support other kinds of number format. Do you have nicer format specifier names ?
   
   * Alternative 3 - based on @gianm 's suggestion
   human_readable_format_bin_byte
   human_readable_format_dec_byte
   human_readable_format_dec
   
   I think I would prefer the 3rd here. What do you think ? @gianm 
@clintropolis @abhishekagarwal87 ?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org
For additional commands, e-mail: commits-h...@druid.apache.org

Reply via email to