<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.evenamonkey.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>even a monkey - rant</title>
 <link>http://www.evenamonkey.com/taxonomy/term/36/0</link>
 <description></description>
 <language>en</language>
<item>
 <title>I hate negative fieldnames</title>
 <link>http://www.evenamonkey.com/i_hate_negative_fieldnames--2006--doug_sims</link>
 <description>&lt;!-- google_ad_section_start --&gt;
&lt;p&gt;Just had to dive into an un-named co-worker&#039;s  code to look at an issue. Please never name your boolean fieldnames in the negative, I may have to interprit your code and I have no patience for these antics!&lt;/p&gt;
&lt;h3&gt;here is the scenario:&lt;/h3&gt;
&lt;p&gt;there is a negativly named field in the DB named boo_nonsmoker.&lt;/p&gt;
&lt;p&gt;here is the Radio Button code block&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;input type=&amp;quot;radio&amp;quot; name=&amp;quot;boo_flex_nonsmoker_NewValue1&amp;quot; value=&amp;quot;F&amp;quot; &amp;lt;cfif not BooleanIsTrue(qryEmployee.boo_flex_nonsmoker)&amp;gt;checked&amp;lt;/cfif&amp;gt;&amp;gt;&lt;br /&gt;“I certify that I am a non-smoker.”&lt;br /&gt;&amp;lt;br&amp;gt;&lt;br /&gt;&amp;lt;input type=&amp;quot;radio&amp;quot; name=&amp;quot;boo_flex_nonsmoker_NewValue1&amp;quot; value=&amp;quot;T&amp;quot; &amp;lt;cfif BooleanIsTrue(qryEmployee.boo_flex_nonsmoker)&amp;gt;checked&amp;lt;/cfif&amp;gt;&amp;gt;I and/or my spouse is a smoker.&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;So in this scenario if they smoke, boo_nonsmoker gets set to true, making it really a flag for smokers, not nonsmokers.....it gets even more confusing when setting the default value...cfif not BooleanIsTrue nonsmoker.&lt;/p&gt;
&lt;h2&gt;oh, if only the field had just been named smoker instead.....&lt;/h2&gt;
&lt;!-- google_ad_section_end --&gt;
</description>
 <comments>http://www.evenamonkey.com/i_hate_negative_fieldnames--2006--doug_sims#comment</comments>
 <category domain="http://www.evenamonkey.com/monkeyblog/bad_code">bad code</category>
 <category domain="http://www.evenamonkey.com/monkeyblog/rant">rant</category>
 <pubDate>Thu, 14 Dec 2006 15:16:41 -0500</pubDate>
 <dc:creator>Doug Sims</dc:creator>
 <guid isPermaLink="false">47 at http://www.evenamonkey.com</guid>
</item>
</channel>
</rss>
