<?xml version='1.0' encoding='UTF-8' ?>
<rss version="2.0" xmlns:admin="http://webns.net/mvcb/" xmlns:blogChannel="http://backend.userland.com/blogChannelModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:icbm="http://www.postneo.com/icbm" xmlns:includedComments="http://www.laudably.com/rss2-comments" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/">
	<channel>
		<title>GLORP News: category: OO and Design</title>
		<link>http://www.cincomsmalltalk.com/userblogs/knight/blogView</link>
		<description>HREF Considered Harmful</description>
		<webMaster>knight@acm.org</webMaster>
		<lastBuildDate>Tue, 13 Sep 2005 14:37:44 EDT</lastBuildDate>
		<image>
			<url>http://www.cincomsmalltalk.com/images/why-small.png</url>
			<title>GLORP News</title>
			<link>http://www.cincomsmalltalk.com/userblogs/knight/blogView</link>
			<height>50</height>
			<width>81</width>
		</image>
		<admin:generatorAgent rdf:resource="http://www.cincomsmalltalk.com/CincomSmalltalkWiki/Silt"></admin:generatorAgent>
		<admin:errorReportsTo rdf:resource="mailto:knight@acm.org"></admin:errorReportsTo>
		<dc:language>en-us</dc:language>
		<dc:creator>Alan Knight</dc:creator>
		<dc:rights>Copyright 2005 Alan Knight</dc:rights>
		<dc:date>2005-09-13T14:37:44-05:00</dc:date>
		<icbm:latitude>45.316667</icbm:latitude>
		<icbm:longitude>-75.666667</icbm:longitude>
		<item>
			<title>Refactoring and types</title>
			<link>http://www.cincomsmalltalk.com/userblogs/knight/blogView?showComments=true&amp;entry=3304075060</link>
			<category>OO and Design</category>
			<pubDate>Tue, 13 Sep 2005 14:37:40 EDT</pubDate>
			<description><![CDATA[<p><p><p><a href="http://www.cincomsmalltalk.com/blog/blogView?showComments=true&entry=3303367138" rel="noFollow">Jim Robertson's blog</a> had a 
discussion recently about manifest typing and refactoring support. It
got rapidly out of hand, but the basic point was interesting. Essentially, given static type information,
a refactoring engine can work better. In particular, it's possible to rename methods (with Integer + as the example)
which you couldn't in a dynamically typed system because you can't tell which sends are to integers and which to 
other things.</p>

<p>This is true, but more complicated than it first appears. It's not that the dynamically typed system
doesn't have enough information to do the refactoring, but rather that renaming a method implemented by multiple
classes incompatibly is not necessarily a behaviour-preserving transformation in a dynamically typed system. 
If there wasn't enough information, then the refactoring engine would just have trouble finding which call sites needed
to be modified. But we can easily have call sites that can't be automatically modified. Consider</p>
</p></p><pre>   frobnicate: something
      ^something + 7.
</pre><p>The parameter might be an integer, but it might not. I believe that the same issue arises in a statically typed system with type inference, or in a manifestly typed system with templates.  Suppose that we created a templated type SummableList&lt;T&gt;. This is just a 
parameterized collection with a sum operation that returns the sum of all the items in it. Now if we want to rename the + operation,
do we change the send of + in our class or not?</p>
<p>More generally, a dynamically typed program will have less information about itself than one with manifest typing (although I presume it would be the same as a statically typed program with type inference). That's part of the point - you don't have to specify as much. At least as far as Smalltalk is concerned, these are part of the reason it has development traditions like test-driven design, and unit testing (and is where the original refactoring tools came from, as well as the original xUnit). These kinds of measures help ensure correctness when the program changes, while preserving the flexibility, terseness, and other advantages of not specifying types up-front. And as well, keyword messages make name collisions that much less likely.</p>
<p>
But the nice thing about many of these techniques is that they don't just affect behaviour-preserving transformations. In my opinion, there's too much emphasis on that. While refactoring is wonderful, it's my considered opinion that to be really productive in development, you will eventually have to do something that changes the behaviour of the program. So it's not just the ability to make changes that don't affect behaviour, it's the extent to which changes in one place propogate through the rest of the program. Do they damp out quickly or do they force lots of other code to be changed. Examples of things that I'd consider to propogate are Java's checked exceptions in the method signatures and C++ const. Dynamic typing is an example of something that helps damp out changes.
</p>]]></description>
			<guid isPermaLink="false">3304075060</guid>
			<trackback:ping>http://www.cincomsmalltalk.com/userblogs/knight/servlet/CommentAPITBServlet?guid=3304075060</trackback:ping>
			<pingback:server>http://www.cincomsmalltalk.com/userblogs/knight/servlet/CommentAPIPBServlet?guid=3304075060</pingback:server>
			<pingback:target>http://www.cincomsmalltalk.com/userblogs/knight/blogView?entry=3304075060</pingback:target>
			<includedComments:comment-collection></includedComments:comment-collection>
			<wfw:comment>http://www.cincomsmalltalk.com/userblogs/knight/blogView/servlet/CommentAPIServlet?guid=3304075060</wfw:comment>
		</item>
		<item>
			<title>Reuse considered overused</title>
			<link>http://www.cincomsmalltalk.com/userblogs/knight/blogView?showComments=true&amp;entry=3286816969</link>
			<category>OO and Design</category>
			<pubDate>Fri, 25 Feb 2005 20:42:49 EST</pubDate>
			<description><![CDATA[<p>Ted Neward has a nice <a href="http://www.neward.net/ted/weblog/index.jsp?date=20050220#1108950783802">rant</a> about how every technology is pitched as enabling reuse, whatever that might mean.


</p>
<p><p>I remember back in the good old dot-com days, I took one of my recently-ex companies press releases, edited a few words judiciously, and challenged people to guess which decade it was written in. The promises of re-use Nirvana were all centered around components, but it read word-for-word like the kind of nonsense thrown around in the 80's for objects.

</p></p>]]></description>
			<guid isPermaLink="false">3286816969</guid>
			<trackback:ping>http://www.cincomsmalltalk.com/userblogs/knight/servlet/CommentAPITBServlet?guid=3286816969</trackback:ping>
			<pingback:server>http://www.cincomsmalltalk.com/userblogs/knight/servlet/CommentAPIPBServlet?guid=3286816969</pingback:server>
			<pingback:target>http://www.cincomsmalltalk.com/userblogs/knight/blogView?entry=3286816969</pingback:target>
			<includedComments:comment-collection></includedComments:comment-collection>
			<wfw:comment>http://www.cincomsmalltalk.com/userblogs/knight/blogView/servlet/CommentAPIServlet?guid=3286816969</wfw:comment>
		</item>
		<item>
			<title>Simple Things</title>
			<link>http://www.cincomsmalltalk.com/userblogs/knight/blogView?showComments=true&amp;entry=3262597097</link>
			<category>OO and Design</category>
			<pubDate>Fri, 21 May 2004 12:58:17 EDT</pubDate>
			<description><![CDATA[<p>A few times lately I've seen Alan Kay's maxim that "Simple things should be simple. Complex things should be possible" quoted. I'm actually not sure I agree with that, or at least I don't think it goes far enough.


</p>
<p><p>Now, I should say that it's a start, and it's a real shame that so few products can live up to it. For example, Gosling apparently admitted this about J2EE <a href=" http://cardboard.nu/blog/2004_05_13/gosling_on_suns_java_plans.html ">recently </a>. The problem is that if you follow this maxim with what I'll call the "wrong attitude" you can end up with "Microsoft usability". What I mean by that is that the underlying product is hideously complicated, but you have pretty bits to handle the really simple cases. So simple things, at least a few of them, are simple because you have wizards to generate them for you. Anything beyond that counts as complex. It's possible, but it sure won't be easy.


</p>

<p>Part of the problem is the discontinuity between the simple and the complex. One of the nice things in Smalltalk is that the barriers in "dropping down a level" are relatively small. Simple things are simple, but simple things are also incremental steps towards complex things. Another way of putting this is that magic should be avoided. If the underlying system can do something, the user ought to be able to do it, as easily as possible.


</p>

<p>I certainly wouldn't claim that VisualWorks, or Smalltalk in general is somehow the ultimate in this regard. We have lots of excessively complicated or just bad. One thing that helps Smalltalk though is the aesthetic of simplicity. It's by no means universal, but code being complicated is considered a valid criticism and there's just that much more pressure to simplify. 


</p>

<p>And in the end we get that much closer to the ultimate goal, which is after all the point of software. "Simple things should be simple. Complex things should also be simple"</p></p>]]></description>
			<guid isPermaLink="false">3262597097</guid>
			<trackback:ping>http://www.cincomsmalltalk.com/userblogs/knight/servlet/CommentAPITBServlet?guid=3262597097</trackback:ping>
			<pingback:server>http://www.cincomsmalltalk.com/userblogs/knight/servlet/CommentAPIPBServlet?guid=3262597097</pingback:server>
			<pingback:target>http://www.cincomsmalltalk.com/userblogs/knight/blogView?entry=3262597097</pingback:target>
			<includedComments:comment-collection></includedComments:comment-collection>
			<wfw:comment>http://www.cincomsmalltalk.com/userblogs/knight/blogView/servlet/CommentAPIServlet?guid=3262597097</wfw:comment>
		</item>
		<item>
			<title>Guard Clauses</title>
			<link>http://www.cincomsmalltalk.com/userblogs/knight/blogView?showComments=true&amp;entry=3253803340</link>
			<category>OO and Design</category>
			<pubDate>Mon, 09 Feb 2004 18:15:40 EST</pubDate>
			<description><![CDATA[<p><p>Update: It appears I was wrong about SmallLint - it's *suggesting* the use of guard clauses, not complaining about them. So I'm agreeing with it, and the ranting was unnecessary.</p>

<p>A small rant. I notice that the SmallLint code checker has a number of things it flags as potential problems. One of them is "guard clauses" - e.g. something of the form.
</p><pre>
isSomethingTrue
     someCondition ifTrue: [^true].
     someOtherCondition ifTrue: [^true].
	^thisCondition & thatCondition & theOtherCondition.
</pre></p>
<p>I *like* guard clauses. I'd much rather see code like this than complicated boolean expressions. Boolean expressions always confuse me, and are harder to walk through in the debugger. I was going to write out the boolean expression equivalent of the previous, but I'm pretty sure I'd get it wrong anyway.</p>]]></description>
			<guid isPermaLink="false">3253803340</guid>
			<trackback:ping>http://www.cincomsmalltalk.com/userblogs/knight/servlet/CommentAPITBServlet?guid=3253803340</trackback:ping>
			<pingback:server>http://www.cincomsmalltalk.com/userblogs/knight/servlet/CommentAPIPBServlet?guid=3253803340</pingback:server>
			<pingback:target>http://www.cincomsmalltalk.com/userblogs/knight/blogView?entry=3253803340</pingback:target>
			<includedComments:comment-collection>
				<includedComments:comment>
					<includedComments:guid>http://www.cincomsmalltalk.com/userblogs/knight/blogView?showComments=true&amp;entry=3253803340</includedComments:guid>
					<includedComments:puid>http://www.cincomsmalltalk.com/userblogs/knight/blogView?showComments=true&amp;entry=3253803340</includedComments:puid>
					<includedComments:author>Tom K</includedComments:author>
					<includedComments:pubDate>2004-02-09T19:17:02-05:00</includedComments:pubDate>
					<includedComments:content>&lt;p&gt;Either it's a VW peculiarity, or something doesn't jibe here.  In VA, when Smalllint complains about a guard clause, the method looks like this:



someMethod

     aCondition ifTrue: &lt;a href=""&gt;do a bunch of code&lt;/a&gt;



and the preferred refactoring is



someMethod

     aCondition ifFalse: &lt;a href=""&gt;^self&lt;/a&gt;.

     do a bunch of code



This makes sense to me - you end up bailing out of the method as early as possible, and avoid unnecessary nesting.  There's even an opportunity to extract some or all of the "do a bunch of code" statements into their own method.&lt;/p&gt;</includedComments:content>
					<includedComments:title>Guard Clauses</includedComments:title>
				</includedComments:comment>
			</includedComments:comment-collection>
			<wfw:comment>http://www.cincomsmalltalk.com/userblogs/knight/blogView/servlet/CommentAPIServlet?guid=3253803340</wfw:comment>
		</item>
		<item>
			<title>Programming Books</title>
			<link>http://www.cincomsmalltalk.com/userblogs/knight/blogView?showComments=true&amp;entry=3253618992</link>
			<category>OO and Design</category>
			<pubDate>Sat, 07 Feb 2004 15:03:12 EST</pubDate>
			<description><![CDATA[<p>In a fit of enthusiasm I recently bought 3 programming books
<ul>
<li> Agile Software Development with Scrum, by Ken Schwaber and Mike Beedle</li>
<li> Testing Extreme Programming, by Lisa Crispin and Tip House</li>
<li> Test-Driven Development, by Kent Beck</li>
</ul>

<p>I've heard good things about Scrum from a number of sources, so thought I'd check it out more thoroughly. The other two books, I think come out of a sense that I'm still not really sure how to best write test suites. The suites are tremendously helpful, but I think they could be more so, and better organized. And, though I've probably heard most of Kent's ideas on the subject, he's always interesting to read. The other testing book is written by professional testers, so should have a less programmer-centric view.


</p>

<p>Sometimes I'm not sure why I bother buying programming books at all. They're always a problem for me. If they don't have anything interesting to say about programming I tend to stop reading them fairly quickly. If they do have something interesting to say about programming then after a dozen pages or so I am often seized with an overwhelming urge to stop reading and <u>program</u>. So unless I'm in some situation where I can't program (e.g. on a plane with a dead laptop battery) I tend to only get small snippets read. (A friend who I mentioned this to said that he'd just bought two programming books - one on JSP and one on Javascript, and all it made him want to do was quit his job :-)


</p>

<p>Despite all that, I've been working my way slowly through the Scrum book, in bathroom-sized chunks, and so far it seems interesting, if harder to put into practice when you work at home.

</p></p>]]></description>
			<guid isPermaLink="false">3253618992</guid>
			<trackback:ping>http://www.cincomsmalltalk.com/userblogs/knight/servlet/CommentAPITBServlet?guid=3253618992</trackback:ping>
			<pingback:server>http://www.cincomsmalltalk.com/userblogs/knight/servlet/CommentAPIPBServlet?guid=3253618992</pingback:server>
			<pingback:target>http://www.cincomsmalltalk.com/userblogs/knight/blogView?entry=3253618992</pingback:target>
			<includedComments:comment-collection>
				<includedComments:comment>
					<includedComments:guid>http://www.cincomsmalltalk.com/userblogs/knight/blogView?showComments=true&amp;entry=3253618992</includedComments:guid>
					<includedComments:puid>http://www.cincomsmalltalk.com/userblogs/knight/blogView?showComments=true&amp;entry=3253618992</includedComments:puid>
					<includedComments:author></includedComments:author>
					<includedComments:pubDate>2004-03-15T05:01:35-05:00</includedComments:pubDate>
					<includedComments:content>&lt;p&gt;bu&lt;/p&gt;</includedComments:content>
					<includedComments:title>Untitled</includedComments:title>
				</includedComments:comment>
			</includedComments:comment-collection>
			<wfw:comment>http://www.cincomsmalltalk.com/userblogs/knight/blogView/servlet/CommentAPIServlet?guid=3253618992</wfw:comment>
		</item>
		<item>
			<title>Re: ModelDrivenArchitecture</title>
			<link>http://www.cincomsmalltalk.com/userblogs/knight/blogView?showComments=true&amp;entry=3253197650</link>
			<category>OO and Design</category>
			<pubDate>Mon, 02 Feb 2004 18:00:50 EST</pubDate>
			<description><![CDATA[<p><p><a href="http://martinfowler.com/bliki/ModelDrivenArchitecture.html">Martin Fowler comments on Model-Driven Architecture (MDA) </a>.</p>

<p>I've heard a lot of talk about MDA in the last while. I can't say I understand why. I thoroughly agree with Martin on this one</p></p>]]></description>
			<guid isPermaLink="false">3253197650</guid>
			<trackback:ping>http://www.cincomsmalltalk.com/userblogs/knight/servlet/CommentAPITBServlet?guid=3253197650</trackback:ping>
			<pingback:server>http://www.cincomsmalltalk.com/userblogs/knight/servlet/CommentAPIPBServlet?guid=3253197650</pingback:server>
			<pingback:target>http://www.cincomsmalltalk.com/userblogs/knight/blogView?entry=3253197650</pingback:target>
			<includedComments:comment-collection></includedComments:comment-collection>
			<wfw:comment>http://www.cincomsmalltalk.com/userblogs/knight/blogView/servlet/CommentAPIServlet?guid=3253197650</wfw:comment>
		</item>
	</channel>
</rss>

