Skip to content

decimal_literal_representation is subjective #2421

Closed
@vorner

Description

@vorner

Hello

The lint about decimal literal being better written as hexadecimal feels very subjective. For me, if I see 4096, I know at once it's 4 kilobytes. If I see 0x1000, I have to really think how approximately large the number is. Sure, the second conveys the fact it is power of two more strongly, but the actual size of the number is better expressed in decimal, at least to me ‒ so I think it very much depends on the context, what is more important.

I find most of clippie's lints reasonable and based on some sane argument ‒ eg. performance, better suited method, etc. This one kind of seems to be out of line with that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-needs-discussionStatus: Needs further discussion before merging or work can be started

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions