<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="344835" data-post-id="344835">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="jswanner" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/jswanner/120/24585_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  jswanner
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I do also name my database columns with a trailing <code>?</code>, it does mean needing to quote the field when writing SQL by hand (like in <code>psql</code>).</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="344835" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/do-you-think-names-for-bool-values-should-end-with-a-question-mark/64925/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-344835" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="344835"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="344836" data-post-id="344836">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sodapopcan" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sodapopcan/120/34668_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sodapopcan
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I didn’t even know you could do this!  Though I prefer the <code>:source</code> option (I think).</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="344836" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/do-you-think-names-for-bool-values-should-end-with-a-question-mark/64925/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-344836" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="344836"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="344837" data-post-id="344837">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dimitarvp" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/120/38664_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dimitarvp
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Oh yeah, I’ve done that a lot.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="344837" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/do-you-think-names-for-bool-values-should-end-with-a-question-mark/64925/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-344837" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="344837"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="344839" data-post-id="344839">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Nefcairon" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Nefcairon/120/31921_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Nefcairon
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>It’s even part of the official guide: <a href="https://hexdocs.pm/elixir/1.17.3/naming-conventions.html#trailing-question-mark-foo" rel="noopener nofollow ugc">Naming conventions — Elixir v1.17.3</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="344839" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/do-you-think-names-for-bool-values-should-end-with-a-question-mark/64925/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-344839" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="344839"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="344841" data-post-id="344841">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="frankdugan3" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/frankdugan3/120/39210_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  frankdugan3
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Specifically for functions, doesn’t specify variables/fields. That distinction is even in the poll.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="344841" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/do-you-think-names-for-bool-values-should-end-with-a-question-mark/64925/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-344841" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="344841"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="344844" data-post-id="344844">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Nefcairon" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Nefcairon/120/31921_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Nefcairon
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Sorry, my bad.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="344844" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/do-you-think-names-for-bool-values-should-end-with-a-question-mark/64925/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-344844" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="344844"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #16"></div>
  </section>
</div>
    <div class="postbit" id="344846" data-post-id="344846">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="frankdugan3" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/frankdugan3/120/39210_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  frankdugan3
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’m still undecided, but I lean toward the trailing <code>?</code> for variables/fields. It should certainly be consistent within a project, that’s for sure.</p>
<p>Rather than being a convention, it would be better IMO if there was compiler support for guaranteeing that  a trailing <code>?</code> is always a boolean, whether function, variable, field etc. Similar to the checks on <code>_</code> never being referenced or referencing non-existent struct fields. Obviously, that’s too much of a breaking change, will probably never happen. Could be something a tool like Credo detects, though. <img src="https://forum.elixirforum.com/images/emoji/apple/thinking.png?v=15" title=":thinking:" class="emoji" alt=":thinking:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="344846" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/do-you-think-names-for-bool-values-should-end-with-a-question-mark/64925/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-344846" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="344846"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #17"></div>
  </section>
</div>
    <div class="postbit" id="344849" data-post-id="344849">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="thiagomajesk" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/thiagomajesk/120/31904_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  thiagomajesk
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Ok, my thread necromancy skills seem to be on point <img src="https://forum.elixirforum.com/images/emoji/apple/laughing.png?v=15" title=":laughing:" class="emoji" alt=":laughing:" loading="lazy" width="20" height="20"></p>
<p>It seems quite silly, but I caught myself wondering about this more times than I’m willing to admit, and it’s great to see I’m not alone <img src="https://forum.elixirforum.com/images/emoji/apple/sweat_smile.png?v=15" title=":sweat_smile:" class="emoji" alt=":sweat_smile:" loading="lazy" width="20" height="20"> (thanks OP for creating the poll BTW).</p>
<p>One thing is true: the docs make it very clear that this particular convention is about function names. So I wonder if the trend of using variables with trailing marks comes mainly from Ecto - the <code>changeset.valid?</code> is the one example that always gets a mention.</p>
<aside class="quote no-group" data-username="frankdugan3" data-post="18" data-topic="64925">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/frankdugan3/48/39210_2.png" class="avatar"> frankdugan3:</div>
<blockquote>
<p>I’m still undecided, but I lean toward the trailing <code>?</code> for variables/fields. It should certainly be consistent within a project, that’s for sure.</p>
</blockquote>
</aside>
<p>Although I’ve done it both ways, my current perception is that following this convention for fields/ variables can get tricky because of external data mismatch (as <a class="mention" href="/u/dimitarvp" rel="nofollow">@dimitarvp</a> and <a class="mention" href="/u/jswanner" rel="nofollow">@jswanner</a> noted). Ecto does make this a little easier for us, but still. I think you can only guarantee 100% consistency if you follow this convention for function names.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="344849" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/do-you-think-names-for-bool-values-should-end-with-a-question-mark/64925/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-344849" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="344849"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #18"></div>
  </section>
</div>
    <div class="postbit" id="344850" data-post-id="344850">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="frankdugan3" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/frankdugan3/120/39210_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  frankdugan3
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I think the gravitation toward the trailing <code>?</code> is the desire to be able to know just by looking at the variable name that it’s a simple boolean, therefore requiring no further inspection to learn the variants. Reminds me a little bit of conventions like Hungarian Notation, which further reminds me of a similar problem: No compiler guarantees of the convention means the convention can lie to you about the data type.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="344850" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/do-you-think-names-for-bool-values-should-end-with-a-question-mark/64925/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-344850" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="344850"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #19"></div>
  </section>
</div>
    <div class="postbit" id="344852" data-post-id="344852">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dimitarvp" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/120/38664_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dimitarvp
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="frankdugan3" data-post="20" data-topic="64925">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/frankdugan3/48/39210_2.png" class="avatar"> frankdugan3:</div>
<blockquote>
<p>No compiler guarantees of the convention means the convention can lie to you about the data type.</p>
</blockquote>
</aside>
<p>Exactly. Hence you either have pre-commit GIT hook that runs your code through your own extra rules / linters, or just don’t bother at all because you’re only going to accumulate confusion and make your code error-prone with time.</p>
<aside class="quote no-group" data-username="thiagomajesk" data-post="19" data-topic="64925">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/thiagomajesk/48/31904_2.png" class="avatar"> thiagomajesk:</div>
<blockquote>
<p>Although I’ve done it both ways, my current perception is that following this convention for fields/ variables can get tricky because of external data mismatch (as <a class="mention" href="/u/dimitarvp" rel="nofollow">@dimitarvp</a> and <a class="mention" href="/u/jswanner" rel="nofollow">@jswanner</a> noted).</p>
</blockquote>
</aside>
<p>Yeah, more or less this. I am well-aware that Ecto can help with the <code>:source</code> option for each field but I’ve only used it when I worked with legacy databases where the fields were confusingly named i.e. <code>mid</code> for <code>match_id</code> (football DB), <code>rid</code> (<code>request_id</code>), <code>uwhen</code> (<code>inserted_at_utc</code> of sorts) and the like.</p>
<p>I am not going to reach for Ecto’s name-overriding facilities due to some OCD that screams in my head that <code>is_admin</code> should really be <code>admin?</code>. Meh.</p>
<hr>
<p>TL;DR your code and DB schema should be boring and predictable. Don’t act clever and keep your OCD away from both – or you and others are going to pay the price sooner or later.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="344852" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/do-you-think-names-for-bool-values-should-end-with-a-question-mark/64925/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-344852" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="344852"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #20"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/64925/load_more?page=3">Load more posts (7 remaining)</a>
</div></template></turbo-stream>