<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Developer Tutorials' Webmaster Blog &#187; yaml</title>
	<atom:link href="http://www.developertutorials.com/blog/tag/yaml/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.developertutorials.com/blog</link>
	<description>Keeping webmasters up-to-date on technology.</description>
	<pubDate>Tue, 02 Sep 2008 14:59:45 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
	<language>en</language>
			<item>
		<title>Why you should be using YAML for config</title>
		<link>http://www.developertutorials.com/blog/php/why-you-should-be-using-yaml-for-config-8/</link>
		<comments>http://www.developertutorials.com/blog/php/why-you-should-be-using-yaml-for-config-8/#comments</comments>
		<pubDate>Fri, 25 Jan 2008 12:03:06 +0000</pubDate>
		<dc:creator>Akash Mehta</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[yaml]]></category>

		<guid isPermaLink="false">http://www.developertutorials.com/blog/php/why-you-should-be-using-yaml-for-config-8/</guid>
		<description><![CDATA[The vast majority of PHP applications out there use native PHP files for configuration. One or more standard PHP files declares a number of variables used for configuration. Given the syntax constraints of PHP - e.g. you can&#8217;t put a quote inside quoted values - a culture of developers insisting on managing config files is [...]]]></description>
			<content:encoded><![CDATA[<p>The vast majority of PHP applications out there use native PHP files for configuration. One or more standard PHP files declares a number of variables used for configuration. Given the syntax constraints of PHP - e.g. you can&#8217;t put a quote inside quoted values - a culture of developers insisting on managing config files is pretty much standard. But it doesn&#8217;t have to be.</p>
<p>YAML, or YAML Ain&#8217;t Markup Language, is a &#8220;human friendly data serialization standard&#8221;. It&#8217;s essentially a very basic format for storing data, and uses far less syntax than standard PHP. Here&#8217;s a sample of YAML:</p>
<p><span id="more-8"></span><code>---<br />
Time: 2001-11-23 15:01:42 -5<br />
User: ed<br />
Warning:<br />
An error has occurred.</code></p>
<p>As you can see, it&#8217;s almost like English; it&#8217;s as basic as you want. Of course, that&#8217;s not to say it doesn&#8217;t support complex structures - <a href="http://yaml.org/start.html" target="_blank">this example</a> demonstrates the power of the format.</p>
<p>Now, this is all well and good, but what does it mean for us as developers? Well, quite a lot, it seems:</p>
<ol>
<li>Our configuration files can finally be read - and modified! - by anyone.</li>
<li>We can finally really start using config files, instead of database values with complex admin panels</li>
<li>Config files are no longer as error prone as they used to be; forgetting to escape a quote in a config value won&#8217;t accidentally bring down your live application.</li>
<li>The marketing guy can change ad positions in the company&#8217;s website himself, without having to call the poor IT guy at 1am.</li>
</ol>
<p>Of course, there are also performance considerations of interpreting a specialised format as opposed to using native programming code. Thankfully, <a href="http://spyc.sourceforge.net/" target="_blank">spyc, one of the best PHP YAML interpreters</a>, is pretty damn fast.</p>
<p>Now that we have reliable config files, why not use them?  Next time you&#8217;re building an application, instead of building some complex config manager in the admin panel, consider just using YAML.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark" style="float:left;">
<div class="d8" style="overflow:hidden">
<div id="socialstyles"><a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://www.developertutorials.com/blog/php/why-you-should-be-using-yaml-for-config-8/&amp;title=Why+you+should+be+using+YAML+for+config" title="Add to&nbsp;Del.icio.us">Del.icio.us</a></div><div id="socialstyles"><a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.developertutorials.com/blog/php/why-you-should-be-using-yaml-for-config-8/&amp;title=Why+you+should+be+using+YAML+for+config" title="Add to&nbsp;Digg This">Digg This</a></div><div id="socialstyles"><a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://www.developertutorials.com/blog/php/why-you-should-be-using-yaml-for-config-8/&amp;title=Why+you+should+be+using+YAML+for+config" title="Add to&nbsp;Stumble">Stumble</a></div></div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.developertutorials.com/blog/php/why-you-should-be-using-yaml-for-config-8/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
