I’m working through the vulkan tutorial and came across GLFW_TRUE and GLFW_FALSE. I presume there’s a good reason but in looking at the docs it’s just defining 1 and 0, so I’m sorta at a loss as to why some libraries do this (especially in cpp?).

Tangentially related is having things like vk_result which is a struct that stores an enum full of integer codes.

Wouldn’t it be easier to replace these variables with raw int codes or in the case of GLFW just 1 and 0?

Coming mostly from C, and having my caps lock bound to escape for vim, the amount of all caps variables is arduous for my admittedly short fingers.

Anyway hopefully one of you knows why libraries do this thanks!

  • Azzu@lemm.ee
    link
    fedilink
    arrow-up
    31
    arrow-down
    1
    ·
    12 hours ago

    My brain is so used to seeing political content that I read “why do liberals define their own true and false” and was already like “what kind of shit take am I going to have fun reading today”

      • Azzu@lemm.ee
        link
        fedilink
        arrow-up
        2
        arrow-down
        1
        ·
        4 hours ago

        I like my shit takes wrapped in beef rolls, in case you come across some more :)