<?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/"
		>
<channel>
	<title>Comments on: Do you really need different ways for doing the same?</title>
	<atom:link href="http://cakebaker.42dh.com/2008/03/02/do-you-really-need-different-ways-for-doing-the-same/feed/" rel="self" type="application/rss+xml" />
	<link>http://cakebaker.42dh.com/2008/03/02/do-you-really-need-different-ways-for-doing-the-same/</link>
	<description>baking cakes with CakePHP</description>
	<lastBuildDate>Sat, 13 Mar 2010 15:19:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2008/03/02/do-you-really-need-different-ways-for-doing-the-same/comment-page-1/#comment-72913</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Sun, 09 Mar 2008 16:30:48 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2008/03/02/do-you-really-need-different-ways-for-doing-the-same/#comment-72913</guid>
		<description>@Matt: You can also provide options for the end() method, see the &lt;a href=&quot;http://api.cakephp.org/1.2/class_form_helper.html#0931f9a1565e7992013c6e6adb8d23dd&quot; rel=&quot;nofollow&quot;&gt;API&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>@Matt: You can also provide options for the end() method, see the <a href="http://api.cakephp.org/1.2/class_form_helper.html#0931f9a1565e7992013c6e6adb8d23dd" rel="nofollow">API</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Huggins</title>
		<link>http://cakebaker.42dh.com/2008/03/02/do-you-really-need-different-ways-for-doing-the-same/comment-page-1/#comment-72541</link>
		<dc:creator>Matt Huggins</dc:creator>
		<pubDate>Sat, 08 Mar 2008 18:20:47 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2008/03/02/do-you-really-need-different-ways-for-doing-the-same/#comment-72541</guid>
		<description>@Beth - You said &quot;The heart of the matter is WHY button option exists in both methods and WHEN to use $form-&gt;end(&#039;Button&#039;) vs $form-&gt;submit!!&quot;

I believe the submit() function includes a second array parameter that allows you to provide additional attributes (such as onclick, style, css class, etc.) much like other input functions within the FormHelper.  The end() function does not provide this option, it simply creates a very basic submit button with the caption provided.</description>
		<content:encoded><![CDATA[<p>@Beth &#8211; You said &#8220;The heart of the matter is WHY button option exists in both methods and WHEN to use $form-&gt;end(&#8216;Button&#8217;) vs $form-&gt;submit!!&#8221;</p>
<p>I believe the submit() function includes a second array parameter that allows you to provide additional attributes (such as onclick, style, css class, etc.) much like other input functions within the FormHelper.  The end() function does not provide this option, it simply creates a very basic submit button with the caption provided.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2008/03/02/do-you-really-need-different-ways-for-doing-the-same/comment-page-1/#comment-71222</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Tue, 04 Mar 2008 18:14:05 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2008/03/02/do-you-really-need-different-ways-for-doing-the-same/#comment-71222</guid>
		<description>@all: Thanks for your comments!

@Neil: Yes, $form-&gt;end() adds a hidden field if you use the Security component.

@MN: An addition to Tim&#039;s explanation (@Tim: thanks!): If you have only one field to update, you could also use the following code:
&lt;pre&gt;
$this-&gt;YourModel-&gt;id = $yourID;
$this-&gt;YourModel-&gt;saveField(&#039;fieldname&#039;, &#039;value&#039;);
&lt;/pre&gt;

@Jeff: Well, I think you miss the point. My point is that you should think twice before you add the second/third/... way for doing something you already implemented in your software. In principle it is about DRY (don&#039;t repeat yourself) at the feature/documentation level.

It&#039;s possible that the example I have chosen is not the best example, as the end() method does a bit more than the submit() method. But think about the scenario of finding all users with a certain name. How many different ways are there to accomplish this task?

@Beth: Yes, I agree with you that it is good to have debates in the community. 

@ajmacaro: Cool to hear you learned something from this article :)</description>
		<content:encoded><![CDATA[<p>@all: Thanks for your comments!</p>
<p>@Neil: Yes, $form-&gt;end() adds a hidden field if you use the Security component.</p>
<p>@MN: An addition to Tim&#8217;s explanation (@Tim: thanks!): If you have only one field to update, you could also use the following code:</p>
<pre>
$this-&gt;YourModel-&gt;id = $yourID;
$this-&gt;YourModel-&gt;saveField('fieldname', 'value');
</pre>
<p>@Jeff: Well, I think you miss the point. My point is that you should think twice before you add the second/third/&#8230; way for doing something you already implemented in your software. In principle it is about DRY (don&#8217;t repeat yourself) at the feature/documentation level.</p>
<p>It&#8217;s possible that the example I have chosen is not the best example, as the end() method does a bit more than the submit() method. But think about the scenario of finding all users with a certain name. How many different ways are there to accomplish this task?</p>
<p>@Beth: Yes, I agree with you that it is good to have debates in the community. </p>
<p>@ajmacaro: Cool to hear you learned something from this article :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ajmacaro</title>
		<link>http://cakebaker.42dh.com/2008/03/02/do-you-really-need-different-ways-for-doing-the-same/comment-page-1/#comment-71063</link>
		<dc:creator>ajmacaro</dc:creator>
		<pubDate>Tue, 04 Mar 2008 02:42:38 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2008/03/02/do-you-really-need-different-ways-for-doing-the-same/#comment-71063</guid>
		<description>Hey, i didnt know end() has a parameter. :)

When you see things useless, then it is useless. Think positive,
what you just read doesnt waste any of your precious time. 
If my boss ask me why there are two functions. Then i have some
answer for him. &quot;Why dont you read cakebaker blog. and read the
comments.&quot;

Sometimes i question myself.  Why people have to use &quot;this and that&quot;, if he can use &quot;this and that&quot;? Then i realize, simple because some prefered to use &quot;this&quot; rather than &quot;that&quot;.</description>
		<content:encoded><![CDATA[<p>Hey, i didnt know end() has a parameter. :)</p>
<p>When you see things useless, then it is useless. Think positive,<br />
what you just read doesnt waste any of your precious time.<br />
If my boss ask me why there are two functions. Then i have some<br />
answer for him. &#8220;Why dont you read cakebaker blog. and read the<br />
comments.&#8221;</p>
<p>Sometimes i question myself.  Why people have to use &#8220;this and that&#8221;, if he can use &#8220;this and that&#8221;? Then i realize, simple because some prefered to use &#8220;this&#8221; rather than &#8220;that&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Beth</title>
		<link>http://cakebaker.42dh.com/2008/03/02/do-you-really-need-different-ways-for-doing-the-same/comment-page-1/#comment-71062</link>
		<dc:creator>Beth</dc:creator>
		<pubDate>Tue, 04 Mar 2008 02:40:35 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2008/03/02/do-you-really-need-different-ways-for-doing-the-same/#comment-71062</guid>
		<description>I&#039;m not worried about who&#039;s right or wrong. Daniel at least posed the question and squeezed out some potential rationale for their existence @Neil. The heart of the matter is WHY button option exists in both methods and WHEN to use $form-&gt;end(&#039;Button&#039;) vs $form-&gt;submit!! For now, I&#039;ll stick with what I know.

I look at it this way, everyone knows that $uses and $html-&gt;link are slow/resource hogs, yet it&#039;s preached, tutorialized, blogged, documented like the gospel because of the &quot;automagic&quot;. Either you take the red pill or the blue, it&#039;s up to you. But when you wake up to sheeit performance who&#039;s fault is that? You!

I choose to use the form helper to display error messages because I want to be able to internationalize the messages even though the downside is displaying error message below a field is BAD usability. BTW, I have multiple rules per field and form-&gt;error doesn&#039;t work without more work which I don&#039;t have time to hack. I also don&#039;t believe in hard coding messages in the model.

IMHO,  debate is good within a community. Either everyone wants a good product or their egos stroked. Look at Rails if you think everything is so rosy - http://www.juixe.com/techknow/index.php/2008/01/04/ruby-on-rails-radioactive-fallout/

Daniel has at least stuck with Cake unlike a lot of others who have gone DOA. I won&#039;t name names. Cake really needs a community leader such as Fabien from Symfony.

Can anyone name 10 cake blogs that are still providing relevant information/examples? And I&#039;m not talking about regurgitating the same old stuff for every new release of cake, i.e. Blog Tutorial for Cake x.x.x.

Ah, I feel clean again ;)</description>
		<content:encoded><![CDATA[<p>I&#8217;m not worried about who&#8217;s right or wrong. Daniel at least posed the question and squeezed out some potential rationale for their existence @Neil. The heart of the matter is WHY button option exists in both methods and WHEN to use $form-&gt;end(&#8216;Button&#8217;) vs $form-&gt;submit!! For now, I&#8217;ll stick with what I know.</p>
<p>I look at it this way, everyone knows that $uses and $html-&gt;link are slow/resource hogs, yet it&#8217;s preached, tutorialized, blogged, documented like the gospel because of the &#8220;automagic&#8221;. Either you take the red pill or the blue, it&#8217;s up to you. But when you wake up to sheeit performance who&#8217;s fault is that? You!</p>
<p>I choose to use the form helper to display error messages because I want to be able to internationalize the messages even though the downside is displaying error message below a field is BAD usability. BTW, I have multiple rules per field and form-&gt;error doesn&#8217;t work without more work which I don&#8217;t have time to hack. I also don&#8217;t believe in hard coding messages in the model.</p>
<p>IMHO,  debate is good within a community. Either everyone wants a good product or their egos stroked. Look at Rails if you think everything is so rosy &#8211; <a href="http://www.juixe.com/techknow/index.php/2008/01/04/ruby-on-rails-radioactive-fallout/" rel="nofollow">http://www.juixe.com/techknow/index.php/2008/01/04/ruby-on-rails-radioactive-fallout/</a></p>
<p>Daniel has at least stuck with Cake unlike a lot of others who have gone DOA. I won&#8217;t name names. Cake really needs a community leader such as Fabien from Symfony.</p>
<p>Can anyone name 10 cake blogs that are still providing relevant information/examples? And I&#8217;m not talking about regurgitating the same old stuff for every new release of cake, i.e. Blog Tutorial for Cake x.x.x.</p>
<p>Ah, I feel clean again ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim Daldini</title>
		<link>http://cakebaker.42dh.com/2008/03/02/do-you-really-need-different-ways-for-doing-the-same/comment-page-1/#comment-71013</link>
		<dc:creator>Tim Daldini</dc:creator>
		<pubDate>Mon, 03 Mar 2008 23:04:43 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2008/03/02/do-you-really-need-different-ways-for-doing-the-same/#comment-71013</guid>
		<description>@MN:
If you want Model::save to do a UPDATE instead of an INSERT you should make sure the value of the primary key is in the array you are passing the the save method.

For example, if you are trying to update the &#039;name&#039; field from &#039;George&#039; to &#039;John&#039; the array you pass to model::save should contain   a &#039;name&#039; key with the value of John AND an &#039;id&#039; key with the value that corresponds to the record you are trying to update.</description>
		<content:encoded><![CDATA[<p>@MN:<br />
If you want Model::save to do a UPDATE instead of an INSERT you should make sure the value of the primary key is in the array you are passing the the save method.</p>
<p>For example, if you are trying to update the &#8216;name&#8217; field from &#8216;George&#8217; to &#8216;John&#8217; the array you pass to model::save should contain   a &#8216;name&#8217; key with the value of John AND an &#8216;id&#8217; key with the value that corresponds to the record you are trying to update.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Loiselle</title>
		<link>http://cakebaker.42dh.com/2008/03/02/do-you-really-need-different-ways-for-doing-the-same/comment-page-1/#comment-70960</link>
		<dc:creator>Jeff Loiselle</dc:creator>
		<pubDate>Mon, 03 Mar 2008 16:22:39 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2008/03/02/do-you-really-need-different-ways-for-doing-the-same/#comment-70960</guid>
		<description>Daniel, you pose the question, &quot;Do you really need different ways for doing the same?&quot;. Well, let&#039;s use our noggins!

PHP gives you all of the tools you need to build a web site. Why do you need a framework at all? SQL is far more flexible than Cake&#039;s ORM layer in many cases, so why build one! Hell, why do you even need file_get_contents() when you can fopen() your way to fame and fortune. Why do you need high level languages at all if one can sit down with a hot cup of joe and crank out some ASM. 

Technically, all these things don&#039;t really do the same thing do they?

Some things are based on convenience and there&#039;s hardly a price to pay to support the two methods of syntactical sugar you mention. The methods don&#039;t do the same thing. Period.

Take a deep breath and talk about something more important.</description>
		<content:encoded><![CDATA[<p>Daniel, you pose the question, &#8220;Do you really need different ways for doing the same?&#8221;. Well, let&#8217;s use our noggins!</p>
<p>PHP gives you all of the tools you need to build a web site. Why do you need a framework at all? SQL is far more flexible than Cake&#8217;s ORM layer in many cases, so why build one! Hell, why do you even need file_get_contents() when you can fopen() your way to fame and fortune. Why do you need high level languages at all if one can sit down with a hot cup of joe and crank out some ASM. </p>
<p>Technically, all these things don&#8217;t really do the same thing do they?</p>
<p>Some things are based on convenience and there&#8217;s hardly a price to pay to support the two methods of syntactical sugar you mention. The methods don&#8217;t do the same thing. Period.</p>
<p>Take a deep breath and talk about something more important.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MN</title>
		<link>http://cakebaker.42dh.com/2008/03/02/do-you-really-need-different-ways-for-doing-the-same/comment-page-1/#comment-70930</link>
		<dc:creator>MN</dc:creator>
		<pubDate>Mon, 03 Mar 2008 13:12:39 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2008/03/02/do-you-really-need-different-ways-for-doing-the-same/#comment-70930</guid>
		<description>Hi there,
I know that here is not an exact place to ask my question but I have tried to use Model::save function to save a new value for one field in my table and found out that cake uses an INSERT sql command for saving the data resulting in a new row to be added every time! is this my problem or I haven&#039;t seen a role in using that function?</description>
		<content:encoded><![CDATA[<p>Hi there,<br />
I know that here is not an exact place to ask my question but I have tried to use Model::save function to save a new value for one field in my table and found out that cake uses an INSERT sql command for saving the data resulting in a new row to be added every time! is this my problem or I haven&#8217;t seen a role in using that function?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CakePHP &#38; DIEVOLUTION Blog &#187; Blog Archiv &#187; Kurztipp: Aufpassen bei Ajax-Forms</title>
		<link>http://cakebaker.42dh.com/2008/03/02/do-you-really-need-different-ways-for-doing-the-same/comment-page-1/#comment-70901</link>
		<dc:creator>CakePHP &#38; DIEVOLUTION Blog &#187; Blog Archiv &#187; Kurztipp: Aufpassen bei Ajax-Forms</dc:creator>
		<pubDate>Mon, 03 Mar 2008 10:32:36 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2008/03/02/do-you-really-need-different-ways-for-doing-the-same/#comment-70901</guid>
		<description>[...] ohne Werte per Ajax vom Server geschickt wird. Am besten nutzt ihr hier den Formhelper wie ihn cakebaker beschreibt, dass spart sogar noch eine [...]</description>
		<content:encoded><![CDATA[<p>[...] ohne Werte per Ajax vom Server geschickt wird. Am besten nutzt ihr hier den Formhelper wie ihn cakebaker beschreibt, dass spart sogar noch eine [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Neil Crookes</title>
		<link>http://cakebaker.42dh.com/2008/03/02/do-you-really-need-different-ways-for-doing-the-same/comment-page-1/#comment-70882</link>
		<dc:creator>Neil Crookes</dc:creator>
		<pubDate>Mon, 03 Mar 2008 09:08:15 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2008/03/02/do-you-really-need-different-ways-for-doing-the-same/#comment-70882</guid>
		<description>I think $form-&gt;end() also adds additional code if you are using the Security component.</description>
		<content:encoded><![CDATA[<p>I think $form-&gt;end() also adds additional code if you are using the Security component.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
