[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ?-suffix for booleans... good-idea? or bad-idea?
From: |
Thompson, David |
Subject: |
Re: ?-suffix for booleans... good-idea? or bad-idea? |
Date: |
Tue, 25 Apr 2017 20:23:23 -0400 |
Hey,
On Mon, Apr 24, 2017 at 1:01 PM, Christopher Allan Webber
<address@hidden> wrote:
>
> What do people think? I'm struggling with deciding what's the right
> thing for my own code, but leaning towards "we shouldn't use the ?
> suffix for just boolean values".
My convention is that anything that evaluates to either #t or #f has a
'?' at the end. Thus both predicates and flag variables are named
like this. Using 'is-' or something like that is just how languages
that don't allow punctuation in symbols workaround the limitation.
Ruby is particularly annoying because while a method name can have a
question mark at the end, a variable name cannot.
tl;dr - Good idea!
- Dave