1. 2
    1. 3

      Why tho? When do I need a number without any further context? SEVEN is exactly as magic as 7, and DAYS_IN_WEEK = SEVEN doesn’t offer anything over assigning directly to the integer while adding the expense of understanding this here thing.

      Unless we’re just having fun, in which case I’m into it, but I think it’d be nice to indicate it’s a parody library. This does seem to be a good way to achieve dogmatic adherence to the “best practice” of not assigning ints and could fool junior folks into thinking it’s the right move. Teach through humor rather than making folks feel foolish.

      1. 1

        Yep. 42 is meaningless, ANSWER_TO_THE_GALAXY is not. FOURTY_TWO contains identical information to the former, except… actually not identical: it’s slower to parse when dealing with these small numbers, especially if English isn’t your first/native language. Maybe on the way high end of the number scale this starts making more sense (ONE_BILLION is actually somewhat useful maybe?)

        1. 2

          ONE_BILLION is actually somewhat useful maybe?

          Maybe — is that a short billion or a long billion?

          1. [Comment removed by author]