<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Constants?  Well, I declare!</title>
	<atom:link href="http://www.riskbloggers.com/benfield/2007/02/constants-well-i-declare/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.riskbloggers.com/benfield/2007/02/constants-well-i-declare/</link>
	<description>Security Wisdom Ahead of the Curve</description>
	<pubDate>Sat, 05 Jul 2008 00:47:02 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Benjamin Field</title>
		<link>http://www.riskbloggers.com/benfield/2007/02/constants-well-i-declare/#comment-582</link>
		<dc:creator>Benjamin Field</dc:creator>
		<pubDate>Fri, 16 Feb 2007 00:16:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.riskbloggers.com/benfield/2007/02/constants-well-i-declare/#comment-582</guid>
		<description>Thanks for your comment, Larry.  I think these are good principals to be reminded of concerning constants, and I appreciated the balance that I gained in my perspective by considering your points.

I would add only that, at least at my house, I've seen the number of seconds, which typically remains fairly constant, increase dangerously on the fourth Thursday in November around about when the pumpkin pie comes out.

In an interpreted web application language such as PHP, where changing the configuration often means changing code, where copying and pasting is more common than linking and compiling, where code is promiscuous, and runtime arguments come from an untrusted user running code on your box, it's possible to be more liberal with the use of constants and save – not create – headache.</description>
		<content:encoded><![CDATA[<p><!-- google_ad_section_start -->Thanks for your comment, Larry.  I think these are good principals to be reminded of concerning constants, and I appreciated the balance that I gained in my perspective by considering your points.</p>
<p>I would add only that, at least at my house, I&#8217;ve seen the number of seconds, which typically remains fairly constant, increase dangerously on the fourth Thursday in November around about when the pumpkin pie comes out.</p>
<p>In an interpreted web application language such as PHP, where changing the configuration often means changing code, where copying and pasting is more common than linking and compiling, where code is promiscuous, and runtime arguments come from an untrusted user running code on your box, it&#8217;s possible to be more liberal with the use of constants and save – not create – headache.<!-- google_ad_section_end --></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Larry J. Hughes, Jr.</title>
		<link>http://www.riskbloggers.com/benfield/2007/02/constants-well-i-declare/#comment-474</link>
		<dc:creator>Larry J. Hughes, Jr.</dc:creator>
		<pubDate>Fri, 09 Feb 2007 20:52:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.riskbloggers.com/benfield/2007/02/constants-well-i-declare/#comment-474</guid>
		<description>Hmm, I don't like this argument at all.  I'll use the generic word "container" for simplicity. 

* There's a big difference between a container varying over the execution of a 
program and varying over the life of a program. The simplest case is when a container derives from a command-line argument which changes periodically.  I'm sure you get that, so it's possible your semantics were just a little off.

* There are constants and there are constants.  A good one is the number of seconds in a day.  A bad one is the number of buildings your company occupies. A frightening one is the number of digits required to represent a year.  It's a judgement call, and if you've read much of other people's code...well, 'nuff said..

* Many containers are best passed as arguments.  This promotes modular and reusable code, lest you end up having to recompile and relink all modules in a ginormous project -- say, an OS kernel -- vs. just one.  That's why unix 'make' exists.

* Try debugging a program that was erroneously linked with object code that was previously compiled with a different constant [sic] value!

* The choice isn't always binary - static variables for example.

This is just a partial list.  I'm not saying you don't want to use constants, but I am saying they must be used very judiciously!

Truth in advertising:  I haven't read any of that book.</description>
		<content:encoded><![CDATA[<p><!-- google_ad_section_start -->Hmm, I don&#8217;t like this argument at all.  I&#8217;ll use the generic word &#8220;container&#8221; for simplicity. </p>
<p>* There&#8217;s a big difference between a container varying over the execution of a<br />
program and varying over the life of a program. The simplest case is when a container derives from a command-line argument which changes periodically.  I&#8217;m sure you get that, so it&#8217;s possible your semantics were just a little off.</p>
<p>* There are constants and there are constants.  A good one is the number of seconds in a day.  A bad one is the number of buildings your company occupies. A frightening one is the number of digits required to represent a year.  It&#8217;s a judgement call, and if you&#8217;ve read much of other people&#8217;s code&#8230;well, &#8217;nuff said..</p>
<p>* Many containers are best passed as arguments.  This promotes modular and reusable code, lest you end up having to recompile and relink all modules in a ginormous project &#8212; say, an OS kernel &#8212; vs. just one.  That&#8217;s why unix &#8216;make&#8217; exists.</p>
<p>* Try debugging a program that was erroneously linked with object code that was previously compiled with a different constant [sic] value!</p>
<p>* The choice isn&#8217;t always binary - static variables for example.</p>
<p>This is just a partial list.  I&#8217;m not saying you don&#8217;t want to use constants, but I am saying they must be used very judiciously!</p>
<p>Truth in advertising:  I haven&#8217;t read any of that book.<!-- google_ad_section_end --></p>
]]></content:encoded>
	</item>
</channel>
</rss>
