Search code examples
racketnaming-conventionsconventions

What is the proper naming convention for Racket boolean parameters?


If we have a boolean defining whether to auto-accept or not, we'd call it auto-accept?. If we have a parameter defining some color we would call it color-param. How would we call the parameter that defines a boolean? auto-accept?-param because it is a 'parametrised' boolean? auto-accept-param? or even just auto-accept-param because a parameter is a parameter, and not a boolean?


Solution

  • It's very common to use the prefix current- to name parameters.

    http://docs.racket-lang.org/search/index.html?q=current-

    It's fairly common to append a question mark for parameters that holds a boolean value. In the list from above you see names such as:

    current-any-type? 
    current-cache-all?
    etc
    

    The full list of such parameters (long):

    http://docs.racket-lang.org/search/index.html?q=current?

    I suggest: currect-auto-accept?.