<?xml version="1.0"?>
<!-- name="generator" content="blosxom/2.0" -->
<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">

<rss version="0.91">
  <channel>
    <title>Crater Moon Landings   </title>
    <link>http://www.cmdev.com/buzz/index.cgi</link>
    <description></description>
    <language>en</language>

  <item>
    <title>Is Coding Style Important?</title>
    <link>http://www.cmdev.com/buzz/index.cgi/2007/01/31#CodingStyle</link>
    <description>
&lt;p&gt;
Over at Artima, Frank Sommers writes &lt;a href=&quot;http://www.artima.com/weblogs/viewpost.jsp?thread=193517&quot;&gt;How Important is Coding Style, and How Do You Enforce It?&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
I've come to believe that having a coding style is important, but
enforcement is not. If programmers on my team can't adhere a style without
having to have their wrists slapped by some tool or enforcement police,
it's likely there are more serious issues lurking that will bite the
team far worse than misplaced curly braces or indentation errors.  &lt;/p&gt;


&lt;p&gt;
There is one kind of problem in the realm of keeping up a good,
consistent coding style that I see regularly.  In the case were the
team uses and idea or other automated code reformatting that generates
confusing and useless diffs in the version control system have a fairly
simple, non-technical, solution.  &lt;/p&gt;


&lt;p&gt;
It works like this: When you are preparing to edit a source file to make
some semantically important changes and the automated code-reformatter
also wants to move things around, do the change in two steps. Step one:
let the reformatter do its cleanup, make everything pretty, but make NO
other changes. Check in the file with a comment like &quot;Reformat changes
only&quot; to indicate that the code hasn't really changed*. NOW make your
real changes as needed, run your unit tests, etc, and check in with the
actual change message.  &lt;/p&gt;


&lt;p&gt;
Result: The diffs between what you changed and the original source
are clear and isolated, yet there is a record in the changelog of the
reformatting, which can be compared to the prior version (if needed)
to see what the formatter did.  &lt;/p&gt;


&lt;p&gt;
The extra effort is minimal for programmers who are serious about
enforcing a coding style, while the benefits of being able to
differentiate real changes from reformatting (and potentially help in
identifying programmers who are checking in code that doesn't meet the
style guidelines) are manifold.  &lt;/p&gt;


* Note that sometimes reformatting code, even though there are supposedly
no changes, will in fact result in changed behavior, especially in
languages like Python where whitespace is meaningful, but even in
languages where whitespace is mostly ignored. Another reason it's good
to have a clear record in the source control of only formatting change
check-ins.
</description>
  </item>
  <item>
    <title>Functions on the Heap</title>
    <link>http://www.cmdev.com/buzz/index.cgi/2006/10/29#FunctionsOnTheHeap</link>
    <description>
&lt;p&gt;
Robert C. Martin says in 
&lt;a href=&quot;http://www.artima.com/weblogs/viewpost.jsp?thread=37870&quot;&gt;Modelling
the real world&lt;/a&gt;, &quot;OO was &quot;discovered&quot; when two guys who were using a
block structured language to write a simulation engine played around with
moving the stack frame for a block to the heap, thus making the blocks
long-lived. Voila: objects!&quot;.  In other words, functions on the heap.
This is the legacy Kristen Nygaard and Ole-Johan Dahl left to the
world of computer science and software development, now called Object
Orientation. (There was another development related to C.A.R. Hoare's
thoughts on records and associated operators, but that leads off in
another direction.)  &lt;/p&gt;


&lt;p&gt;
What does it mean for a function to be on the heap? Typically blocks
are lexically scoped, and considered functions when they are named
and can be called from other parts of the program. Well, ordinarily,
in a block-structured language, when you enter a function a stack frame
is created, and the parameters are either copied to or referenced from
within that frame.  Variables local to that block are uninitialized, and
so must be assigned a value to be used.  When that block, the function,
exits, the stack frame is deleted and all the local variables become
undefined once again, and the parameters revert back to the values they
had before the block was entered. (By-reference parameters can appear
to change if the value of the thing referenced was changed, but that's
an additional complication we won't go into).  &lt;/p&gt;


&lt;p&gt;
The next time that block is entered (the function is called) all that
stack frame creation and initialization must be repeated.  What Nygaard
and Dahl did was to move that function onto the heap, where it continues
to exist after it is created and called. In the next call to the function,
the local variables are still at whatever value they were when the
last execution of the block finished.  What results is variables that
retain their values as long as the program executes, but are visible only
within the lexical scope where they are defined. That ends up being a very
powerful and useful way to structure and organize programs. Once the block
is capable of existing beyond a single invocation, it becomes useful to
be able to name the blocks and refer to them from multiple places.  &lt;/p&gt;


&lt;p&gt;
In the original
&lt;a href=&quot;http://www.amazon.com/exec/obidos/ASIN/0201633612/cratermoon-dev20&quot;&gt;Design
Patterns&lt;/a&gt; book by the &quot;Gang of Four&quot;, (Erich Gamma, Richard Helm,
Ralph Johnson, John Vlissides), one of the principles is &quot;encapsulate
the thing that varies&quot;. By using the technique of functions on the heap,
this &quot;thing that varies&quot; becomes not only the &quot;variables&quot; within a block,
but the operations which are associated with the block as well.  &lt;/p&gt;

&lt;p&gt;
Perhaps the most simplifying insight to be gained from looking at
objects this way is that it says nothing about types, certainly not in
the strictly defined way that is seen in languages like Java.  Abstract
data types and hierarchies of abstractions get a lot of attention in
current programming practices. It's well worth the time to explore the
implications of objects as long-lasting named functions on the heap.

&lt;/p&gt;
</description>
  </item>
  <item>
    <title>Why Refactoring Isn't Popular</title>
    <link>http://www.cmdev.com/buzz/index.cgi/2006/06/22#WhyNotRefactoring</link>
    <description>
&lt;p&gt;In &lt;a href=&quot;http://www.devsource.com/article2/0,1895,1979886,00.asp&quot;&gt;The
Refactoring Factor&lt;/a&gt; Esther Schindler wonders about the reasons
behind a study that shows only 22% of developers consider refactoring
important.  Before writing the article She asked some questions on the &lt;a
href=&quot;http://groups.yahoo.com/group/agile-testing/messages&quot;&gt;agile-testing&lt;/a&gt;
list and her article includes some of the points in the responses.
&lt;/p&gt;
&lt;p&gt;

I want to focus a bit on her primary conclusion, that programmers can't
get resources or buy-in to do refactoring.
&lt;/p&gt;
&lt;p&gt;
Because the programmer's managers won't allow it
&lt;/p&gt;
&lt;p&gt;

Somewhere I think I have the email directive that a project manager sent
out at one job I was on that said, to paraphrase, that anything beyond
the specific changes requested was a &quot;refactoring effort&quot; and therefore
out of scope.
&lt;/p&gt;
&lt;p&gt;

Now there is a simple explanation and a not-so-simple one for this.
The simple one is the spread of what Martin Fowler wrote about in
&lt;a href=&quot;http://www.martinfowler.com/bliki/RefactoringMalapropism.html&quot;&gt;Refactoring Malapropism&lt;/a&gt;. I
must confess I probably &lt;a
href=&quot;http://www.cmdev.com/buzz/index.cgi/2004/01/14#RefactoringMalpropism&quot;&gt;contributed&lt;/a&gt;
to it in the above mentioned situation, and I'm still paying penance
for it.
&lt;/p&gt;
&lt;p&gt;

Now the complex explanation. Project management can be seen as
the task of maximizing the completed features in the available
time within the budget of money and people.  In too many
situations, the estimates of time required are abbreviated. This
happens stereotypically by management, as Phillip Su writes in &lt;a
href=&quot;http://blogs.msdn.com/philipsu/archive/2006/06/14/631438.aspx&quot;&gt;Broken
Windows Theory &lt;/a&gt;, but it also happens because many programmers lack
sophistication estimating.  The programmers typically consider the time
only to write the code and get it to compile and running, leaving out
the other tasks that get the code from &quot;done&quot; to &quot;shippable&quot;. One reason
I've come to favor agile development styles is that they reduce the time
and disconnect between those two states.  Anyway, the result is that the
schedules are wrong, the projects get behind, and the solution adopted by
teams is typically to cut everything else except the promised features.
Short term gain, for long term loss, because the technical debt builds up.
&lt;/p&gt;
&lt;p&gt;

Now management has a hard time seeing the effects of technical debt.
They see that as a project goes along and a product grows, adding new
features and fixing existing code that doesn't work as desired takes more
time and becomes increasingly more likely to introduce new problems.
But by the time these manifest as the level of most projects, the
technical debt has built up to dangerous levels. The typical example I
give is what if a 5-star restaurant were to hire a lot of chefs and not
enough dishwashers, and decreed that the chefs must ONLY cook, never
clean up.  Initially they'd be able to feed a lot of people, but as
the dirty utensils and pots and pans build up, the chefs increasingly
have to hunt for clean ones and a place to work. Gunk builds up on
the grill. After a certain point, if we followed the typical IT shop
solution, the restaurant would throw out all the dirty stuff, replaces
the appliances that can't be salvaged, and if necessary hire new chefs.
&lt;/p&gt;
&lt;p&gt;

Of course great restaurants don't work like that. They and their chefs are
cleaning as they go, so that pan or knife that was used for the happy hour
buffet prep gets returned to use for the dinner entree and then dessert.
&lt;/p&gt;
&lt;p&gt;

Refactoring is cleaning the kitchen while you cook. It's not sexy, it
doesn't make the souffle fluffier or the piecrust flakier, but it's a
given that if it's not done, there won't be any souffle or pie at all.
&lt;/p&gt;
</description>
  </item>
  <item>
    <title>Junit 4 Official Release?</title>
    <link>http://www.cmdev.com/buzz/index.cgi/2006/02/16#JunitFour</link>
    <description>
&lt;p&gt;This morning I got email from sourceforge about
a new release of Junit.  I went and looked at the &lt;a
href=&quot;http://sourceforge.net/project/shownotes.php?release_id=394034&quot;&gt;release
notes&lt;/a&gt; and found that it's labeled Junit 4. 
Joseph Ottinger posts on &lt;a href=&quot;http://www.theserverside.com/news/thread.tss?thread_id=39048&quot;&gt;the Server Side forums&lt;/a&gt;
&lt;/p&gt;
</description>
  </item>
  <item>
    <title>Personality Styles in Adopting Agile</title>
    <link>http://www.cmdev.com/buzz/index.cgi/2006/02/10#AdoptingAgile</link>
    <description>
A brief except from the work I submitted to the Experience
Reports track for &lt;a href=&quot;http://www.agile2006.org/&quot;&gt;Agile 2006&lt;/a&gt;
with Jason P. Stevens

&lt;p&gt;
Over the course of two years of a development project, we introduced
team members to various agile practices. We observed which were adopted
and which were rejected by team members and looked at  how individual
personality factors correlated with the kinds of responses to the
practices.
&lt;/p&gt;

&lt;p&gt;
By &quot;agile practices&quot; we mean the &lt;a
href=&quot;http://agilemanifesto.org/principles.html&quot;&gt;Principles behind the
Agile Manifesto&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
People in our project ended up lumped into one of the following four areas:
&lt;dl&gt;
 &lt;dt&gt;Adopted&lt;/dt&gt;
    &lt;dd&gt;Picked up the practice and used it with reasonable correctness.&lt;/dd&gt;
 &lt;dt&gt;Adopted but Distorted&lt;/dt&gt;
    &lt;dd&gt;Picked up on the term and the form but missed the intent and did something not agile.&lt;/dd&gt;
 &lt;dt&gt;Actively Rejected&lt;/dt&gt;
    &lt;dd&gt;Did not adopt the practice and argued against its use.&lt;/dd&gt;
 &lt;dt&gt;Passively Rejected.&lt;/dt&gt;
    &lt;dd&gt;Kept doing things differently form agile practices but never sought to justify or debate.&lt;/dd&gt;
&lt;/dl&gt;
&lt;/p&gt;

&lt;p&gt;The project observed the reactions of individual team members to
agile practices and related those reaction to personality types such as
the categories suggested by the Myers-Briggs Type Index. For people who
are introducing agile practices we think we might have some things to
look for and ways to adapt to the varying responses usually seen among
individuals in a team new to agile.&lt;/p&gt;
</description>
  </item>
  <item>
    <title>Test-Defective</title>
    <link>http://www.cmdev.com/buzz/index.cgi/2005/08/27#TestDefective</link>
    <description>
&lt;p&gt;
True story: In a system that had recently been through a forced &quot;big
bang&quot; rollout and had only been live for a couple of weeks, one of the
daily financial processes failed one day due to some sort of rounding
error. It later happened that one of the developers mentioned that he
saw this error in test but hoped it was related to bad test data.
&lt;/p&gt;

&lt;p&gt;If wishes were fishes...&lt;/p&gt;
</description>
  </item>
  <item>
    <title>On Check Constraints and Whole Value</title>
    <link>http://www.cmdev.com/buzz/index.cgi/2005/08/01#WholeValueAndCheckConstraints</link>
    <description>
&lt;p&gt;
When a business object has setters for attributes that are interdependent,
one way of ensuring that those attributes maintain the required
relationship is to use check constraints on the setters. But there is a
better way, using &lt;a href=&quot;http://fit.c2.com/wiki.cgi?WholeValue&quot;&gt;Whole
Value&lt;/a&gt;.
&lt;/p&gt;


&lt;p&gt;
An example first. Suppose the attributes are &lt;tt&gt;startDate&lt;/tt&gt; and
&lt;tt&gt;endDate&lt;/tt&gt;, where the rule is that &lt;tt&gt;startDate&lt;/tt&gt; must always
be before or the same as &lt;tt&gt;endDate&lt;/tt&gt;. A naive implementation, the
kind that usually comes to mind for developers used to breaking things
up into itty-bitty pices for primitives and database columns, is to have
the two separate properties on the larger object.  The setters for each
attribute each check the new values against the constraint on the other
value, to ensure the business object's state is always sane.
&lt;/p&gt;


&lt;p&gt;
A &lt;em&gt;better&lt;/em&gt; way to handle this is to code the properties
in a way that eliminates the possibility of the business
object ever being in an inconsistent state.  An immutable &lt;a
href=&quot;//c2.com/cgi/wiki?ValueObject&quot;&gt;Value Object&lt;/a&gt; can be the solution.
&lt;/p&gt;


&lt;p&gt;
A &lt;tt&gt;Duration&lt;/tt&gt; object can encapsulate the startDate and endDate
into a single object with no setters, only a constructor that takes
two arguments, for the start and end dates, and does the check in the
constructor, throwing an exception if the required relationship is
violated by the supplied values.  The business object that formerly had
both attributes instead has the single attribute with stters and getters
for an immutable &lt;tt&gt;Duration&lt;/tt&gt;.
&lt;/p&gt;
</description>
  </item>
  <item>
    <title>Why Code Reviews Aren't Popular</title>
    <link>http://www.cmdev.com/buzz/index.cgi/2005/07/31#WhyNotCodeReviews</link>
    <description>
&lt;p&gt; Code reviews are almost universally recognized as the most effective
way to improve the product. Why are they done so rarely? Short answer:
the participants don't get sufficient immediate, concrete payback
proportional to the cost and effort involved.  Sure, the &lt;em&gt;system&lt;/em&gt;,
the &lt;em&gt;team&lt;/em&gt; benefits, but the individuals involved calculate the
equation as a net negative.  &lt;/p&gt;

&lt;p&gt;Harnessing the value of code reviews will take developing new practices
that balance the cost to the developer with greater individual benefits.&lt;/p&gt;
</description>
  </item>
  <item>
    <title>Fit For Developing Software Released</title>
    <link>http://www.cmdev.com/buzz/index.cgi/2005/07/19#FitBook</link>
    <description>&lt;p&gt;The new book on &lt;a href=&quot;http://fit.c2.com/&quot;&gt;Fit&lt;/a&gt;,
titled, appropriately enough, &lt;em&gt;Fit for Developing Software:
Framework for Integrated Tests&lt;/em&gt; and written by Rick Mugridge
with Ward Cunningham, has been released. It's available at &lt;a
href=&quot;http://www.amazon.com/exec/obidos/ASIN/0321269349/cratermoondev-20&quot;&gt;Amazon,
ISBN 0321269349&lt;/a&gt; &lt;/p&gt;


My software-developer's appreciation for Fit comes from three areas of
importance to me:

&lt;ol&gt;
 &lt;li&gt;Fit tests express business logic, as guided, or even written,
 by the business experts. They lay out the functionality as seen by
 the customers.&lt;/li&gt;

 &lt;li&gt;The test fixture code itself belongs to the developers. By that I
 mean, they are not QC, integration or system tests. Developer ownership
 is a big win because in the process of writing fixture to pass the tests,
 developers come to understand the system better.&lt;/li&gt;

 &lt;li&gt;Fit tests are larger in scope in than unit tests. While unit tests
 are critical in software development, they are not sufficient to ensure
 that the business functionality is implemented in ways that satisfy
 the users of the system.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This book has been called &quot;two books in one&quot;, and I definitely
agree. The first two parts are for customers and other non-programming
team members. The latter parts are aimed at developers and have the
technical topics. Ward said that as he and Rick were working on the
book it started to get confusing, switching back and forth between the
business-facing discussions and the technical discussions. Ward felt it
best to cover the basics first, so they agreed to separate the book to
speak to the two audiences one at a time. The resulting organization
allows the book plenty of breathing room to address the needs of both
audiences.&lt;/p&gt;

&lt;p&gt;The &quot;Questions &amp;amp; Answers&quot; sections scattered throughout the book
contain some of the most valuable gems. Here are a couple of examples
related to ActionFixture:

&lt;ul&gt;
 &lt;li&gt;From Chapter 10, p 73, &quot;Some action rows have a keyword in the last cell. Is that optional?&quot;&lt;/li&gt;
 &lt;li&gt;From Chapter 22, p 193, &quot;Why does the &lt;em&gt;actor&lt;/em&gt; have to be a subclass of &lt;code&gt;fit.Fixture&lt;/code&gt;?&lt;/li&gt;
&lt;/ul&gt;
You'll have to buy the book to see the answers, though!
&lt;/p&gt;

&lt;p&gt;For my part, I am hoping to bring my own &lt;a
href=&quot;http://fit.c2.com/wiki.cgi?ObjectiveCeePlatform&quot;&gt;Objective-C
implementation&lt;/a&gt; up to compliance with the 1.1 specification before
the start of &lt;a href=&quot;http://www.agile2005.org/&quot;&gt;Agile 2005&lt;/a&gt;, where
the community of Fit implementors is planning to congregate for a FIT
Unification Summit on the last day of the conference.  &lt;/p&gt;
</description>
  </item>
  <item>
    <title>Compensation Fallacy</title>
    <link>http://www.cmdev.com/buzz/index.cgi/2005/04/17#CompensationFallacy</link>
    <description>&lt;p&gt; If the going rate for the average developer with skill in the technology
is N, it doesn't follow that offering 2/3N will get you a developer
2/3rds as good as average.  Experience and anecdotal evidence suggests
to me that you're not going to hire anyone who has any ability in the
technology at a rate below some floor.  If that floor is 3/4N, paying
2/3N will get you no skill at all.
&lt;/p&gt;
&lt;p&gt;
From a practical standpoint, as a project manager you can't expect to complete
on time with a product of lesser quality with a team of underpaid developers.  You can simply expect the project to fail.  If you happen to be the one well-compensated developer on a team of cheap programmers? You're not going to do just
a larger share of the work, you're going to do &lt;em&gt;all&lt;/em&gt; the work. If
you're unlucky, you'll get to re-do the work of the other team members
as well.
&lt;/p&gt;
</description>
  </item>
  </channel>
</rss>
