remove DEV and MONGO_DEV `if`-macros

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.3.1
    • Affects Version/s: None
    • Component/s: Internal Code
    • None
    • Fully Compatible
    • Dev Tools 2019-08-26
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      These macros read like statement attributes but are really flow control.

      They have the potential to "falsely" bind to following else statements, and clang-format can't see through it.

      The hidden if condition can't combine with other conditions using && and ||, so it ends up in some cases making code a little worse.

      `DEV` is too broad a namespace. Indeed we touch third-party source using it as an enum value.

      It could be confused with "DEVice".

      It isn't clear that DEVelopment build maps 1:1 to a "debug" build. Meaning is unclear.

      As an alternative, we can inline it where it appears, writing `if (kDebugBuild)` and we will have more conventional code. The sugar of the DEV macro isn't valuable enough to justify its risks.

      `mongo::kDebugBuild` is a conventional constexpr bool variable.

            Assignee:
            Billy Donahue
            Reporter:
            Billy Donahue
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: