<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: YAML in a cake? No, thank you!</title>
	<atom:link href="http://cakebaker.wordpress.com/2006/08/20/yaml-in-a-cake-no-thank-you/feed/" rel="self" type="application/rss+xml" />
	<link>http://cakebaker.wordpress.com/2006/08/20/yaml-in-a-cake-no-thank-you/</link>
	<description>baking cakes with CakePHP</description>
	<lastBuildDate>Wed, 08 May 2013 13:40:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Felix Geisendörfer</title>
		<link>http://cakebaker.wordpress.com/2006/08/20/yaml-in-a-cake-no-thank-you/#comment-1589</link>
		<dc:creator><![CDATA[Felix Geisendörfer]]></dc:creator>
		<pubDate>Thu, 07 Sep 2006 17:45:48 +0000</pubDate>
		<guid isPermaLink="false">https://cakebaker.wordpress.com/2006/08/20/yaml-in-a-cake-no-thank-you/#comment-1589</guid>
		<description><![CDATA[Ok, I think I can see your point as well. Yes, I write my tests with an IDE as well and I think this shouldn&#039;t be the decision making factor for fixtures. However, I think readability of your fixtures *does* matter:

I am a developer, I can read insane arrays containing 6 or 7 nested other arrays (thanks to paranthese matching of my IDE), but I don&#039;t want to. When writing tests (and apps too), I try to apply KISS as much as possible because if your tests are complicated they might as well be faulty which is not acceptable for TDD. Now I think managing nested arrays for Cake Model data can work alright, but recently I wrote a GIF file decoder &amp; encoder in PHP which required tons of nested arrays and fixture data. YAML was *very* helpful throughout the entire process of cataloging a set of images to see if the decoder can decode them successfuly. So regarding the test suite you could leave the choice to the developer on what fixture type they want to use. Inline PHP can be done with a little regex and eval.]]></description>
		<content:encoded><![CDATA[<p>Ok, I think I can see your point as well. Yes, I write my tests with an IDE as well and I think this shouldn&#8217;t be the decision making factor for fixtures. However, I think readability of your fixtures *does* matter:</p>
<p>I am a developer, I can read insane arrays containing 6 or 7 nested other arrays (thanks to paranthese matching of my IDE), but I don&#8217;t want to. When writing tests (and apps too), I try to apply KISS as much as possible because if your tests are complicated they might as well be faulty which is not acceptable for TDD. Now I think managing nested arrays for Cake Model data can work alright, but recently I wrote a GIF file decoder &amp; encoder in PHP which required tons of nested arrays and fixture data. YAML was *very* helpful throughout the entire process of cataloging a set of images to see if the decoder can decode them successfuly. So regarding the test suite you could leave the choice to the developer on what fixture type they want to use. Inline PHP can be done with a little regex and eval.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.wordpress.com/2006/08/20/yaml-in-a-cake-no-thank-you/#comment-1507</link>
		<dc:creator><![CDATA[cakebaker]]></dc:creator>
		<pubDate>Wed, 30 Aug 2006 08:37:30 +0000</pubDate>
		<guid isPermaLink="false">https://cakebaker.wordpress.com/2006/08/20/yaml-in-a-cake-no-thank-you/#comment-1507</guid>
		<description><![CDATA[@Felix: The point with DRY&#039;ness is not the updating of the field names, but the creation of the records. I am lazy, so I don&#039;t like to repeat the column names again and again (which is not necessary with your posted example). Readability is IMHO not that important, as the audience for the test data are developers. So the test data must be readable for developers, but not necessary for everyone else. 

The &quot;problem&quot; with fixtures is that they sometimes do not store plain data. Fixtures (as in Railsland) can contain loops or function calls, so in my opinion it is wrong to store fixtures  in a data format. MAybe the format shown in the post is not perfect and can be improved, but I think it is the direction to go.

I think the concept of YAML that you do not need an IDE to reasonably edit the files is not really important for developers. I don&#039;t know how you work, but if I write tests, I am always in my IDE. 

Well, in Rails you can mix your YAML files with Ruby snippets to allow for dynamic fixtures, so you can do something like (the example is in PHP):

  password: &lt;?php echo md5(&#039;thepassword&#039;); ?&gt;
]]></description>
		<content:encoded><![CDATA[<p>@Felix: The point with DRY&#8217;ness is not the updating of the field names, but the creation of the records. I am lazy, so I don&#8217;t like to repeat the column names again and again (which is not necessary with your posted example). Readability is IMHO not that important, as the audience for the test data are developers. So the test data must be readable for developers, but not necessary for everyone else. </p>
<p>The &#8220;problem&#8221; with fixtures is that they sometimes do not store plain data. Fixtures (as in Railsland) can contain loops or function calls, so in my opinion it is wrong to store fixtures  in a data format. MAybe the format shown in the post is not perfect and can be improved, but I think it is the direction to go.</p>
<p>I think the concept of YAML that you do not need an IDE to reasonably edit the files is not really important for developers. I don&#8217;t know how you work, but if I write tests, I am always in my IDE. </p>
<p>Well, in Rails you can mix your YAML files with Ruby snippets to allow for dynamic fixtures, so you can do something like (the example is in PHP):</p>
<p>  password: &lt;?php echo md5(&#8216;thepassword&#8217;); ?&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Felix Geisendörfer</title>
		<link>http://cakebaker.wordpress.com/2006/08/20/yaml-in-a-cake-no-thank-you/#comment-1469</link>
		<dc:creator><![CDATA[Felix Geisendörfer]]></dc:creator>
		<pubDate>Sat, 26 Aug 2006 17:30:24 +0000</pubDate>
		<guid isPermaLink="false">https://cakebaker.wordpress.com/2006/08/20/yaml-in-a-cake-no-thank-you/#comment-1469</guid>
		<description><![CDATA[I think I like YAML a lot, I&#039;m using it for my unit testing data right now and I&#039;m very pleased with the efficiency.

Regarding your problem with it&#039;s DRY&#039;ness, you could do something like this:

posts_table_definition:
 - id
 - name
 - url

cakephp:
  - 1
  - CakePHP website
  - http://www.cakephp.org

manual:
  - 2
  - CakePHP manual
  - http://manual.cakephp.org

But I don&#039;t even see why you&#039;d want to do that. When you need to change table fields, you can run a quick search &amp; replace, which your IDE should handle, even for YAML, and your done. The entire point of YAML is that it&#039;s not about DRY&#039;ness but about readability for humas, which is exactly what you want when dealing with test data.

Regarding your other issues with it:
- Yes, PHP is more consistent with Cake. But only because Cake goes with Conventions over Configuration, otherwise PHP would maybe never have become the language used for configuration files. But we are not talking about configuration files here, we are talking about Domain data. And data is usally stored in the database when working CakePHP. Since database isn&#039;t the first choice for test fixtures, I think YAML wins over php as a form of data storage.

- Another concept of YAML is, that you don&#039;t *need* an IDE to be reasonably able to edit it. But you do need one for php, so again, in my oppinion YAML wins.

- &quot;YAML looks ugly if you mix it with code&quot;: Your sql database looks ugly when you mix it with code too? Or do you mean putting business logic in your yaml files? I wouldn&#039;t see why that would be needed. Different fixtures, different files.]]></description>
		<content:encoded><![CDATA[<p>I think I like YAML a lot, I&#8217;m using it for my unit testing data right now and I&#8217;m very pleased with the efficiency.</p>
<p>Regarding your problem with it&#8217;s DRY&#8217;ness, you could do something like this:</p>
<p>posts_table_definition:<br />
 &#8211; id<br />
 &#8211; name<br />
 &#8211; url</p>
<p>cakephp:<br />
  &#8211; 1<br />
  &#8211; CakePHP website<br />
  &#8211; <a href="http://www.cakephp.org" rel="nofollow">http://www.cakephp.org</a></p>
<p>manual:<br />
  &#8211; 2<br />
  &#8211; CakePHP manual<br />
  &#8211; <a href="http://manual.cakephp.org" rel="nofollow">http://manual.cakephp.org</a></p>
<p>But I don&#8217;t even see why you&#8217;d want to do that. When you need to change table fields, you can run a quick search &amp; replace, which your IDE should handle, even for YAML, and your done. The entire point of YAML is that it&#8217;s not about DRY&#8217;ness but about readability for humas, which is exactly what you want when dealing with test data.</p>
<p>Regarding your other issues with it:<br />
- Yes, PHP is more consistent with Cake. But only because Cake goes with Conventions over Configuration, otherwise PHP would maybe never have become the language used for configuration files. But we are not talking about configuration files here, we are talking about Domain data. And data is usally stored in the database when working CakePHP. Since database isn&#8217;t the first choice for test fixtures, I think YAML wins over php as a form of data storage.</p>
<p>- Another concept of YAML is, that you don&#8217;t *need* an IDE to be reasonably able to edit it. But you do need one for php, so again, in my oppinion YAML wins.</p>
<p>- &#8220;YAML looks ugly if you mix it with code&#8221;: Your sql database looks ugly when you mix it with code too? Or do you mean putting business logic in your yaml files? I wouldn&#8217;t see why that would be needed. Different fixtures, different files.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.wordpress.com/2006/08/20/yaml-in-a-cake-no-thank-you/#comment-1438</link>
		<dc:creator><![CDATA[cakebaker]]></dc:creator>
		<pubDate>Thu, 24 Aug 2006 06:14:06 +0000</pubDate>
		<guid isPermaLink="false">https://cakebaker.wordpress.com/2006/08/20/yaml-in-a-cake-no-thank-you/#comment-1438</guid>
		<description><![CDATA[@scott lewis: Yeah, you are right, in software engineering there are always trade-offs you have to make.]]></description>
		<content:encoded><![CDATA[<p>@scott lewis: Yeah, you are right, in software engineering there are always trade-offs you have to make.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: scott lewis</title>
		<link>http://cakebaker.wordpress.com/2006/08/20/yaml-in-a-cake-no-thank-you/#comment-1425</link>
		<dc:creator><![CDATA[scott lewis]]></dc:creator>
		<pubDate>Tue, 22 Aug 2006 02:34:47 +0000</pubDate>
		<guid isPermaLink="false">https://cakebaker.wordpress.com/2006/08/20/yaml-in-a-cake-no-thank-you/#comment-1425</guid>
		<description><![CDATA[The PHP solution is more consistent at the cost of being more verbose:

:id:name:url:

versus

function(){returnarray(,&#039;&#039;,&#039;&#039;);}

(excluding whitespace). Also note that the PHP version requires the class wrapper and the columns array, neither of which are required for the YAML version.

Lack of IDE support just means you need a better IDE. :)

And I think code tends to look ugly next to YAML, but that is just an aesthetic choice.

Trade-offs, trade-offs, trade-offs. Everything is trade-offs. :)]]></description>
		<content:encoded><![CDATA[<p>The PHP solution is more consistent at the cost of being more verbose:</p>
<p>:id:name:url:</p>
<p>versus</p>
<p>function(){returnarray(,&#8221;,&#8221;);}</p>
<p>(excluding whitespace). Also note that the PHP version requires the class wrapper and the columns array, neither of which are required for the YAML version.</p>
<p>Lack of IDE support just means you need a better IDE. :)</p>
<p>And I think code tends to look ugly next to YAML, but that is just an aesthetic choice.</p>
<p>Trade-offs, trade-offs, trade-offs. Everything is trade-offs. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.wordpress.com/2006/08/20/yaml-in-a-cake-no-thank-you/#comment-1421</link>
		<dc:creator><![CDATA[cakebaker]]></dc:creator>
		<pubDate>Mon, 21 Aug 2006 16:40:28 +0000</pubDate>
		<guid isPermaLink="false">https://cakebaker.wordpress.com/2006/08/20/yaml-in-a-cake-no-thank-you/#comment-1421</guid>
		<description><![CDATA[@all: Thanks for your feedback. You are right, column names are useful, so I added an array to the class:

var $columns = array(&#039;id&#039;, &#039;name&#039;, &#039;url&#039;);


DRY was not the only reason I have chosen plain PHP over YAML:
- a PHP solution is more consistent with cake
- there is IDE support for PHP, but not for YAML (thanks to the templates of my IDE  I am faster writing a method than a YAML record)
- YAML looks ugly if you mix it with code]]></description>
		<content:encoded><![CDATA[<p>@all: Thanks for your feedback. You are right, column names are useful, so I added an array to the class:</p>
<p>var $columns = array(&#8216;id&#8217;, &#8216;name&#8217;, &#8216;url&#8217;);</p>
<p>DRY was not the only reason I have chosen plain PHP over YAML:<br />
- a PHP solution is more consistent with cake<br />
- there is IDE support for PHP, but not for YAML (thanks to the templates of my IDE  I am faster writing a method than a YAML record)<br />
- YAML looks ugly if you mix it with code</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bret Kuhns</title>
		<link>http://cakebaker.wordpress.com/2006/08/20/yaml-in-a-cake-no-thank-you/#comment-1411</link>
		<dc:creator><![CDATA[Bret Kuhns]]></dc:creator>
		<pubDate>Mon, 21 Aug 2006 02:27:25 +0000</pubDate>
		<guid isPermaLink="false">https://cakebaker.wordpress.com/2006/08/20/yaml-in-a-cake-no-thank-you/#comment-1411</guid>
		<description><![CDATA[I also agree with the comments above. The PHP solution uses more syntax and it seems less flexible. Plus the repetition of the PHP syntax itself seems less DRY than simply repeating column names.]]></description>
		<content:encoded><![CDATA[<p>I also agree with the comments above. The PHP solution uses more syntax and it seems less flexible. Plus the repetition of the PHP syntax itself seems less DRY than simply repeating column names.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: scott lewis</title>
		<link>http://cakebaker.wordpress.com/2006/08/20/yaml-in-a-cake-no-thank-you/#comment-1408</link>
		<dc:creator><![CDATA[scott lewis]]></dc:creator>
		<pubDate>Mon, 21 Aug 2006 01:11:04 +0000</pubDate>
		<guid isPermaLink="false">https://cakebaker.wordpress.com/2006/08/20/yaml-in-a-cake-no-thank-you/#comment-1408</guid>
		<description><![CDATA[&quot;No Magic Numbers&quot; is a far, far more important rule than DRY. Your Cake implementation has the magic numbers 0, 1 and 2. To eliminate them, we need to use an associative array and define meaningful names for the keys. Which would eliminate the one &#039;advantage&#039; of the PHP method and leave us with a more verbose syntax than the YAML option.


Premature optimization is the root of all evil. -- Donald Knuth]]></description>
		<content:encoded><![CDATA[<p>&#8220;No Magic Numbers&#8221; is a far, far more important rule than DRY. Your Cake implementation has the magic numbers 0, 1 and 2. To eliminate them, we need to use an associative array and define meaningful names for the keys. Which would eliminate the one &#8216;advantage&#8217; of the PHP method and leave us with a more verbose syntax than the YAML option.</p>
<p>Premature optimization is the root of all evil. &#8212; Donald Knuth</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Evan Broder</title>
		<link>http://cakebaker.wordpress.com/2006/08/20/yaml-in-a-cake-no-thank-you/#comment-1403</link>
		<dc:creator><![CDATA[Evan Broder]]></dc:creator>
		<pubDate>Sun, 20 Aug 2006 17:52:34 +0000</pubDate>
		<guid isPermaLink="false">https://cakebaker.wordpress.com/2006/08/20/yaml-in-a-cake-no-thank-you/#comment-1403</guid>
		<description><![CDATA[Agreed with Patrice. I know that apparently the Cake Overlords decided they didn&#039;t want YAML in Cake, but I think that repeating column names is much better than having no column names at all.]]></description>
		<content:encoded><![CDATA[<p>Agreed with Patrice. I know that apparently the Cake Overlords decided they didn&#8217;t want YAML in Cake, but I think that repeating column names is much better than having no column names at all.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrice</title>
		<link>http://cakebaker.wordpress.com/2006/08/20/yaml-in-a-cake-no-thank-you/#comment-1402</link>
		<dc:creator><![CDATA[Patrice]]></dc:creator>
		<pubDate>Sun, 20 Aug 2006 17:14:23 +0000</pubDate>
		<guid isPermaLink="false">https://cakebaker.wordpress.com/2006/08/20/yaml-in-a-cake-no-thank-you/#comment-1402</guid>
		<description><![CDATA[And where do you define the order of the columns? Does it take the order in the database?

Not sure I like your approach because there is NO inline documentation. And a change in the table layout will probably require a re-write of every single fixture for that table. Unless you always add columns at the end - which I don&#039;t.]]></description>
		<content:encoded><![CDATA[<p>And where do you define the order of the columns? Does it take the order in the database?</p>
<p>Not sure I like your approach because there is NO inline documentation. And a change in the table layout will probably require a re-write of every single fixture for that table. Unless you always add columns at the end &#8211; which I don&#8217;t.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
