News for hackers. Stuff that matters.
Re:Apple agrees to settle potential class action suit by U.S... by slumdev on Thursday August 26, 2021 @10:05PM (#28323527)
Complete with spelling errors, semicolons in place of commas, shouting snake case, and unnecessary explicit numbering. Definitely enterprise-grade.
Re:Apple agrees to settle potential class action suit by U.S... by cyral on Thursday August 26, 2021 @10:17PM (#28323612)
Not complete until it has a poorly documented API with some name like PriceKit, maybe hidden behind an entitlement as well.
Re:Apple agrees to settle potential class action suit by U.S... by jrockway on Thursday August 26, 2021 @10:44PM (#28323774)
The explicit numbering is so that you can reorder them to be more "readable" later. I didn't have the heart to do that here, but in the real world, anything goes!
Re:Apple agrees to settle potential class action suit by U.S... by inopinatus on Thursday August 26, 2021 @11:44PM (#28324082)
The real enterprise case is when additions are made for things that aren’t even pricing
Re:Apple agrees to settle potential class action suit by U.S... by TeMPOraL on Friday August 27, 2021 @03:26AM (#28325227)
There's also less enterprisy and more "1990s engineering" variant of this:

  enum PricePoint {
    //all the 500+ price points defined above...

    REGULAR_PRICE = 1023;
    PROMO1_PRICE = 1047552;
    PROMO2_PRICE = 1072693248;
    AUTOHINT_ROUND_99 = 1073741824;
    AUTOHINT_BUYING_POWER = 2147483648;
  }
Little bit twiddling, and you can encode 3 prices + some flags in an uint32.
Re:Apple agrees to settle potential class action suit by U.S... by winrid on Friday August 27, 2021 @02:52AM (#28325051)
BLUE_BANANA_CONCESSION = 9001
Re:Apple agrees to settle potential class action suit by U.S... by happytoexplain on Thursday August 26, 2021 @11:42PM (#28324068)
When somebody comes along and inserts a new case next to an existing case because they're closely related, you'll be glad the numbers are explicit.
Re:Apple agrees to settle potential class action suit by U.S... by slumdev on Friday August 27, 2021 @09:45AM (#28327743)
Negative - if these are going to be treated like keys where the integer value needs to retain the same meaning between builds, then an enum is the wrong abstraction to use.