<?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: Thoughts on coding and new classes as a result&#8230;</title>
	<atom:link href="http://www.clientcide.com/best-practices/thoughts-on-coding-and-new-classes-as-a-result/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.clientcide.com/best-practices/thoughts-on-coding-and-new-classes-as-a-result/</link>
	<description>Making stuff work on the other side of the request.</description>
	<lastBuildDate>Thu, 12 Jan 2012 20:00:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Mooish Repository Template and an All-JsonP Showcase &#187; Clientcide (Formerly CNET's Clientside)</title>
		<link>http://www.clientcide.com/best-practices/thoughts-on-coding-and-new-classes-as-a-result/comment-page-1/#comment-31663</link>
		<dc:creator>Mooish Repository Template and an All-JsonP Showcase &#187; Clientcide (Formerly CNET's Clientside)</dc:creator>
		<pubDate>Sun, 28 Dec 2008 21:18:35 +0000</pubDate>
		<guid isPermaLink="false">http://clientside.cnet.com/?p=394#comment-31663</guid>
		<description>[...] source of the site itself is all cleanly written MooTools classes, reminding me of my thoughts on programming to [...]</description>
		<content:encoded><![CDATA[<p>[...] source of the site itself is all cleanly written MooTools classes, reminding me of my thoughts on programming to [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Teejay</title>
		<link>http://www.clientcide.com/best-practices/thoughts-on-coding-and-new-classes-as-a-result/comment-page-1/#comment-31564</link>
		<dc:creator>Teejay</dc:creator>
		<pubDate>Sat, 01 Nov 2008 17:13:23 +0000</pubDate>
		<guid isPermaLink="false">http://clientside.cnet.com/?p=394#comment-31564</guid>
		<description>I haven&#039;t been reading the blog lately but having read this post, I have begun to change my coding style with regards to Mootools. 

Extensible coding with Mootools makes me feel good in a way.</description>
		<content:encoded><![CDATA[<p>I haven&#8217;t been reading the blog lately but having read this post, I have begun to change my coding style with regards to Mootools. </p>
<p>Extensible coding with Mootools makes me feel good in a way.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Inspired by Aaron Newton&#8217;s &#8220;Programming to the Pattern&#8221; &#124; Garrick Cheung</title>
		<link>http://www.clientcide.com/best-practices/thoughts-on-coding-and-new-classes-as-a-result/comment-page-1/#comment-31543</link>
		<dc:creator>Inspired by Aaron Newton&#8217;s &#8220;Programming to the Pattern&#8221; &#124; Garrick Cheung</dc:creator>
		<pubDate>Tue, 14 Oct 2008 06:33:57 +0000</pubDate>
		<guid isPermaLink="false">http://clientside.cnet.com/?p=394#comment-31543</guid>
		<description>[...] and the care-taker of Clientside, CNET.com&#8217;s developer blog. He recently wrote about being inspired to write code differently and a more indepth post about his thoughts on (take a deep breath if you&#8217;re verbally reading [...]</description>
		<content:encoded><![CDATA[<p>[...] and the care-taker of Clientside, CNET.com&#8217;s developer blog. He recently wrote about being inspired to write code differently and a more indepth post about his thoughts on (take a deep breath if you&#8217;re verbally reading [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jQuery, MooTools, and the Ajax Experience, Programming to the Pattern, and What Really Makes One Framework Different From Another &#187; Clientside</title>
		<link>http://www.clientcide.com/best-practices/thoughts-on-coding-and-new-classes-as-a-result/comment-page-1/#comment-31501</link>
		<dc:creator>jQuery, MooTools, and the Ajax Experience, Programming to the Pattern, and What Really Makes One Framework Different From Another &#187; Clientside</dc:creator>
		<pubDate>Fri, 03 Oct 2008 15:08:38 +0000</pubDate>
		<guid isPermaLink="false">http://clientside.cnet.com/?p=394#comment-31501</guid>
		<description>[...] in talking to Bill, I spoke about some of my recent thinking about what I&#8217;ve been calling &#8220;Programming to the Pattern.&#8221; It goes something like [...]</description>
		<content:encoded><![CDATA[<p>[...] in talking to Bill, I spoke about some of my recent thinking about what I&#8217;ve been calling &#8220;Programming to the Pattern.&#8221; It goes something like [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron N.</title>
		<link>http://www.clientcide.com/best-practices/thoughts-on-coding-and-new-classes-as-a-result/comment-page-1/#comment-31490</link>
		<dc:creator>Aaron N.</dc:creator>
		<pubDate>Fri, 19 Sep 2008 22:49:16 +0000</pubDate>
		<guid isPermaLink="false">http://clientside.cnet.com/?p=394#comment-31490</guid>
		<description>Glad to hear you&#039;re having a similar experience to me, Darren. I went through the same thing. After I thought, &quot;well, my code is in pretty good shape.&quot; But the more I considered it the more I realized that using classes pays these dividends. I do the same thing as you - when I write a quick function as part of a page&#039;s setup, I just bang it out. But when I write a class I&#039;m much more critical and careful.</description>
		<content:encoded><![CDATA[<p>Glad to hear you&#8217;re having a similar experience to me, Darren. I went through the same thing. After I thought, &#8220;well, my code is in pretty good shape.&#8221; But the more I considered it the more I realized that using classes pays these dividends. I do the same thing as you &#8211; when I write a quick function as part of a page&#8217;s setup, I just bang it out. But when I write a class I&#8217;m much more critical and careful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darren K</title>
		<link>http://www.clientcide.com/best-practices/thoughts-on-coding-and-new-classes-as-a-result/comment-page-1/#comment-31489</link>
		<dc:creator>Darren K</dc:creator>
		<pubDate>Fri, 19 Sep 2008 20:56:40 +0000</pubDate>
		<guid isPermaLink="false">http://clientside.cnet.com/?p=394#comment-31489</guid>
		<description>I have to admit, when I first read your article I thought, &quot;Big deal. I&#039;m already doing pretty much the same thing by organizing my scripts into objects and functions.&quot; Like you, I figured most of it was site specific and couldn&#039;t really be reused in other sites. Then I got to wondering, &quot;Is that really true?&quot; Even on the basic end, I always apply menu rollovers the same way, and if I want to vertically center an element there&#039;s no real reason to rewrite that code snippet each time even though it&#039;s only four lines.

So when I started my latest project, every time I wanted to do something, I thought about whether I could put my code into a class or an element extension. Sure enough, nearly all of my code was reusable and I simply hadn&#039;t been taking the time to put it into a reusable form. I&#039;d been reusing functions within site applications, but hadn&#039;t been thinking about how things could be reused between sites. My current project is small, but just making this small change in my thinking has drastically cut the main code base and dramatically increased the code organization (which I honestly thought was pretty good before).

I don&#039;t know if anyone else has  similar tendencies, but it&#039;s amazing how much more strict I am about organization when building a class. Maybe it&#039;s just me, but as soon as I turn something into a class I have the overwhelming urge to break it down into as many discrete functions as possible. So not only have I produced a lot of reusable code, but the quality of that code is much better than it would have been otherwise.

Thanks for sharing your thoughts. I&#039;ll certainly be trying to build things with more of an eye towards reusability from now on.</description>
		<content:encoded><![CDATA[<p>I have to admit, when I first read your article I thought, &#8220;Big deal. I&#8217;m already doing pretty much the same thing by organizing my scripts into objects and functions.&#8221; Like you, I figured most of it was site specific and couldn&#8217;t really be reused in other sites. Then I got to wondering, &#8220;Is that really true?&#8221; Even on the basic end, I always apply menu rollovers the same way, and if I want to vertically center an element there&#8217;s no real reason to rewrite that code snippet each time even though it&#8217;s only four lines.</p>
<p>So when I started my latest project, every time I wanted to do something, I thought about whether I could put my code into a class or an element extension. Sure enough, nearly all of my code was reusable and I simply hadn&#8217;t been taking the time to put it into a reusable form. I&#8217;d been reusing functions within site applications, but hadn&#8217;t been thinking about how things could be reused between sites. My current project is small, but just making this small change in my thinking has drastically cut the main code base and dramatically increased the code organization (which I honestly thought was pretty good before).</p>
<p>I don&#8217;t know if anyone else has  similar tendencies, but it&#8217;s amazing how much more strict I am about organization when building a class. Maybe it&#8217;s just me, but as soon as I turn something into a class I have the overwhelming urge to break it down into as many discrete functions as possible. So not only have I produced a lot of reusable code, but the quality of that code is much better than it would have been otherwise.</p>
<p>Thanks for sharing your thoughts. I&#8217;ll certainly be trying to build things with more of an eye towards reusability from now on.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron N.</title>
		<link>http://www.clientcide.com/best-practices/thoughts-on-coding-and-new-classes-as-a-result/comment-page-1/#comment-31488</link>
		<dc:creator>Aaron N.</dc:creator>
		<pubDate>Mon, 15 Sep 2008 21:40:35 +0000</pubDate>
		<guid isPermaLink="false">http://clientside.cnet.com/?p=394#comment-31488</guid>
		<description>My apologies to all here who posted a reply to this - I didn&#039;t realize that I had new posts to moderate (indeed, I was a bit miffed that my post didn&#039;t elicit even a single reply). Something&#039;s fishy with my wordpress install as it doesn&#039;t seem to be emailing me...

Regardless, this is all great feedback. Regarding jducoeur&#039;s suggestions on refactoring, I think that your approach is a matter of discipline. I&#039;ve found that if I don&#039;t do this kind of management as I&#039;m writing the code, I don&#039;t tend to get back around to it. Maybe two months later, on a different project, I&#039;ll think &quot;This is just like that thing I did a month or two ago...&quot; and the 5 or 10 or 30 lines of code needed to replicate it don&#039;t merit revisiting that older code.

I&#039;ve found that since I started working this way that things that I would never consider reusable to come around more than I would have guessed, and the fact that they are already portable increases the likelihood that I&#039;ll use it.

I agree with sivoh&#039;s comments about the other value - that it decreases complexity. Or, maybe it&#039;s that the complexity is more defined. You know where the touch points are of the application instead of getting this big spaghetti mess of functions and stand-alone code.

-Aaron</description>
		<content:encoded><![CDATA[<p>My apologies to all here who posted a reply to this &#8211; I didn&#8217;t realize that I had new posts to moderate (indeed, I was a bit miffed that my post didn&#8217;t elicit even a single reply). Something&#8217;s fishy with my wordpress install as it doesn&#8217;t seem to be emailing me&#8230;</p>
<p>Regardless, this is all great feedback. Regarding jducoeur&#8217;s suggestions on refactoring, I think that your approach is a matter of discipline. I&#8217;ve found that if I don&#8217;t do this kind of management as I&#8217;m writing the code, I don&#8217;t tend to get back around to it. Maybe two months later, on a different project, I&#8217;ll think &#8220;This is just like that thing I did a month or two ago&#8230;&#8221; and the 5 or 10 or 30 lines of code needed to replicate it don&#8217;t merit revisiting that older code.</p>
<p>I&#8217;ve found that since I started working this way that things that I would never consider reusable to come around more than I would have guessed, and the fact that they are already portable increases the likelihood that I&#8217;ll use it.</p>
<p>I agree with sivoh&#8217;s comments about the other value &#8211; that it decreases complexity. Or, maybe it&#8217;s that the complexity is more defined. You know where the touch points are of the application instead of getting this big spaghetti mess of functions and stand-alone code.</p>
<p>-Aaron</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sivoh</title>
		<link>http://www.clientcide.com/best-practices/thoughts-on-coding-and-new-classes-as-a-result/comment-page-1/#comment-31482</link>
		<dc:creator>sivoh</dc:creator>
		<pubDate>Fri, 05 Sep 2008 17:13:55 +0000</pubDate>
		<guid isPermaLink="false">http://clientside.cnet.com/?p=394#comment-31482</guid>
		<description>I think your strategy of dividing the page into widgets backed by JavaScript classes is absolutely the way to go.  The benefits of this style of programming go beyond reusability, however.  Much of the functionality of a moderately complicated client-side application will be patently non-reusable, but this code must still be encapsulated as if it were going to be reused.  Writing code as if it were going to be reused forces you to disconnect it from the rest of the application.  The fewer connections the code contains, the easier it is to add, modify and debug the code, because changes to the code are much less likely that to affect other parts of the application.  Failing to properly encapsulate code leads to the complexity death that is a common source of project failures (especially in rich-client projects).  Reusability itself is great when it works out, but it can actually have a negative effect on overall code complexity if the classes lack a well defined purpose and straightforward API.</description>
		<content:encoded><![CDATA[<p>I think your strategy of dividing the page into widgets backed by JavaScript classes is absolutely the way to go.  The benefits of this style of programming go beyond reusability, however.  Much of the functionality of a moderately complicated client-side application will be patently non-reusable, but this code must still be encapsulated as if it were going to be reused.  Writing code as if it were going to be reused forces you to disconnect it from the rest of the application.  The fewer connections the code contains, the easier it is to add, modify and debug the code, because changes to the code are much less likely that to affect other parts of the application.  Failing to properly encapsulate code leads to the complexity death that is a common source of project failures (especially in rich-client projects).  Reusability itself is great when it works out, but it can actually have a negative effect on overall code complexity if the classes lack a well defined purpose and straightforward API.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jducoeur</title>
		<link>http://www.clientcide.com/best-practices/thoughts-on-coding-and-new-classes-as-a-result/comment-page-1/#comment-31481</link>
		<dc:creator>jducoeur</dc:creator>
		<pubDate>Fri, 05 Sep 2008 15:58:51 +0000</pubDate>
		<guid isPermaLink="false">http://clientside.cnet.com/?p=394#comment-31481</guid>
		<description>I tend to take a somewhat more middle-ground approach, focused on refactoring.

When I&#039;m just writing something for the first time, I&#039;ll simply write it out in-place.  But I try to be absolutely strict about never duplicating code.  If I find myself writing the same thing again -- even just a few lines of code, or sometimes even a single line with complex parameters -- then that indicates to me that refactoring may be called for.  At that point, I&#039;ll lift that code out into a method, or a separate class/widget if the functionality cuts across class lines.

This approach seems to strike a good balance: rather than trying to guess in advance what is going to be reusable, I keep a close eye on my code and let the reusable bits emerge as I write.  That way, I don&#039;t spend too much time on factoring the code excessively, but still avoid code duplication (which is the root of most programming evils).

If you haven&#039;t read it, I commend Martin Fowler&#039;s book &quot;Refactoring&quot;.  It&#039;s one of those programming bibles that is worthwhile for every programmer...</description>
		<content:encoded><![CDATA[<p>I tend to take a somewhat more middle-ground approach, focused on refactoring.</p>
<p>When I&#8217;m just writing something for the first time, I&#8217;ll simply write it out in-place.  But I try to be absolutely strict about never duplicating code.  If I find myself writing the same thing again &#8212; even just a few lines of code, or sometimes even a single line with complex parameters &#8212; then that indicates to me that refactoring may be called for.  At that point, I&#8217;ll lift that code out into a method, or a separate class/widget if the functionality cuts across class lines.</p>
<p>This approach seems to strike a good balance: rather than trying to guess in advance what is going to be reusable, I keep a close eye on my code and let the reusable bits emerge as I write.  That way, I don&#8217;t spend too much time on factoring the code excessively, but still avoid code duplication (which is the root of most programming evils).</p>
<p>If you haven&#8217;t read it, I commend Martin Fowler&#8217;s book &#8220;Refactoring&#8221;.  It&#8217;s one of those programming bibles that is worthwhile for every programmer&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rexxars</title>
		<link>http://www.clientcide.com/best-practices/thoughts-on-coding-and-new-classes-as-a-result/comment-page-1/#comment-31480</link>
		<dc:creator>rexxars</dc:creator>
		<pubDate>Fri, 05 Sep 2008 06:59:17 +0000</pubDate>
		<guid isPermaLink="false">http://clientside.cnet.com/?p=394#comment-31480</guid>
		<description>I think it&#039;s a good way of coding, and shows you just how much you reuse things if it&#039;s available. Personally, I find myself doing a lot of the old addEvent(&#039;click&#039;) stuff, so I&#039;m definately going to try and adapt to making more reusable classes.

I think there&#039;s a typo in your Class.Binds example, it references this.boundAlert, which I believe should be refering to just alert in that last example.

Nice work on releasing the classes, you saved me some time with these :-)</description>
		<content:encoded><![CDATA[<p>I think it&#8217;s a good way of coding, and shows you just how much you reuse things if it&#8217;s available. Personally, I find myself doing a lot of the old addEvent(&#8216;click&#8217;) stuff, so I&#8217;m definately going to try and adapt to making more reusable classes.</p>
<p>I think there&#8217;s a typo in your Class.Binds example, it references this.boundAlert, which I believe should be refering to just alert in that last example.</p>
<p>Nice work on releasing the classes, you saved me some time with these :-)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

