<?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>Norman Richards   </title>
    <link>http://members.capmac.org/~orb/blog.cgi</link>
    <description>I want my two dollars</description>
    <language>en</language>

   <item>
    <title>Code generation isn't evil </title>
    <link>http://members.capmac.org/~orb/blog.cgi/tech/coding/code_generation_is_good.html</link>
    <description>
&lt;p&gt; One man's &lt;a
href=&quot;http://jroller.com/page/objectcountry/20040222&quot;&gt;trash&lt;/a&gt; is
another man's treasure.  This weekend I've been working on an article
on code generation for &lt;a href=&quot;http://www.theserverside.com&quot;&gt;The
ServerSide&lt;/a&gt;.  (hopefully I'll get it wrapped up tonight)  The goal
of the article is to make the case that code generation isn't evil.  
To the contrary it's a very legitimate, and often overlooked, development
technique.  
&lt;/p&gt;

&lt;p&gt;I'll save the arguments for the article, but I do want to leave one
point out their for the code generation doubters.  Don't think that
because the examples of code generation you see are often band aids
around inflexible or poorly designed systems that code generation is
necessarily a sign of a poorly designed system.  &lt;/p&gt;
</description>
  </item>
   <item>
    <title>Embracing good formatting</title>
    <link>http://members.capmac.org/~orb/blog.cgi/tech/coding/more_braces.html</link>
    <description>
&lt;p&gt; I've already chimed in &lt;a
href=&quot;http://members.capmac.org/~orb/blog.cgi/tech/coding/brace_war.html&quot;&gt;on
the relgious issue of braces&lt;/a&gt;, but &lt;a
href=&quot;http://tim.littlebluefrog.com/archives/000023.html&quot;&gt;these
comments&lt;/a&gt; motivated me to describe my brace philosophy.
&lt;p&gt;


&lt;p&gt; You should always write code that is the clearest to parse
visually.  I think newline braces make the code less readable when the
preceding line is a single line statement.  For example:

&lt;/p&gt;

&lt;pre&gt;
if (test)  {
   doSomething();
}
&lt;/pre&gt;

&lt;p&gt;
is more readable than:
&lt;/p&gt;

&lt;pre&gt;
if (test)
{
    doSomething();
}
&lt;/pre&gt;

&lt;p&gt; The opening brace doesn't doesn't do anything but imbalance the
structure of the code and distract the visual flow of the code. &lt;/p&gt;

&lt;p&gt;
On the other hand, consider a method declaration:
&lt;/p&gt;

&lt;pre&gt;
public void doSomething()
    throws SomeKindOfException
{
    // ...
}
&lt;/pre&gt;

&lt;p&gt; The newline brace here DOES add value, marking the beginning of
code section as separate from the complex declaration before it.
Although I see it done, I don't see any way you could argue that
either of the following is clearer: &lt;/p&gt;

&lt;pre&gt;
public void doSomething()
    throws SomeKindOfException {
    //...
}

public void doSomething() throws SomeKindOfException {
    //...
}
&lt;/pre&gt;


&lt;p&gt; The former is ugly.  It's imbalanced and distracting no matter how
you indent the the throws.  The latter is too cluttered.  There's too
much information on the line, making it more difficult than it needs
to be to parse.
&lt;/p&gt;


&lt;p&gt;
I realize matters of style are a subjective matter, but I couldn't 
resist putting my personal preferences out there.  
&lt;/p&gt;</description>
  </item>
   <item>
    <title>Averting the coming brace war</title>
    <link>http://members.capmac.org/~orb/blog.cgi/tech/coding/brace_war.html</link>
    <description>
&lt;p&gt; I too am worried about &lt;a
href=&quot;http://www.jroller.com/page/zoonabar/20031023&quot;&gt;the coming brace
war&lt;/a&gt;.  Given that the new-liners can't accept the obvious flaws in
their brace style, the only alternative to all out war is to alter the
languages to eliminate braces or disallow the heretical usages.  &lt;/p&gt;

&lt;p&gt; Tcl was an interesting player in the move to eliminate incorrect
bracing.  Tcl was line oriented, so braces had to be placed on the
same line to cause the Tcl interpreter to parse correctly.  &lt;/p&gt;

&lt;p&gt;
&lt;pre&gt;
    proc test {} {
        for {set i 0} {$i&lt;10} {incr i} {
            puts $i
        }
    }
&lt;/pre&gt;
&lt;/p&gt;


&lt;p&gt; This was nice in that enforced the one true brace positioning, but
those of the the new-line cult were obviously disenfranchised.  Python
introduced another brace solution, eliminatings braces.  In python,
whitespace dictates nesting.  &lt;/p&gt;

&lt;p&gt;
&lt;pre&gt;
    def test():
        for i in range(0,10):
            print i
&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;
Eliminating braces is a fair compromise, but the unpleasantness of 
making whitespace this significant really makes the entire language nothing 
more than a curious programming diversion.  
&lt;/p&gt;

&lt;p&gt; The final brace killing solution is to use non-symbolic tokens to
indicate the end of blocks.  This is the solution taken by ruby. 
&lt;/p&gt;

&lt;p&gt;
&lt;pre&gt;
    def test() 
        for i in 0..9
            puts i
        end
    end
&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt; Although the keywords are a bit bulkier than a simple braces, they
aren't excessively cumbersome.  A key to the simplicity here is the
single end marker as opposed to older scripting &quot;solutions&quot; like fi,
od and esac.  Since there is no additional block open marker, it's
very difficult for even the most persisitent new-line cult member to
place incorrectly.  &lt;/p&gt;

&lt;p&gt; Of the three solutions, ruby seems to be the best and most
readable solution.  Hopefully we will reach a more ruby-like future
some day and avoid the bloody brace war.  Ruby: our last, best hope
for peace.  &lt;/p&gt;</description>
  </item>
   <item>
    <title>SQL is horrible</title>
    <link>http://members.capmac.org/~orb/blog.cgi/tech/coding/no_sql.html</link>
    <description>
&lt;p&gt;
&lt;a href=&quot;http://www.codegeneration.net/lth_archives/000073.html&quot;&gt;Jack Herrington writes&lt;/a&gt;:
&lt;b&gt;&quot;I'm still appalled at how engineers with five years of experience are telling me that SQL is horrible and should be hidden or ideally replaced.&quot;&lt;/b&gt;
&lt;/p&gt;

&lt;p&gt; I've got 10 years of experience programming, and I'll say it.  SQL
is horrible.  Actually, it's SQL as much as it is relational
databases.  Relational database do have their strong points, and if
you need a solid transactional datastore you don't have that many
options.  But, I think relational databases really should be
modernized a bit.  It's really quite sad that we accept such horribly
backwards technology in modern systems.  &lt;/p&gt;

&lt;p&gt; I think it stems from the fact that I started out my career
developing LDAP servers.  (X.500 at first, and later LDAP)
No, LDAP is NOT a replacement for relational databases.  But being introduced
to LDAP before having any serious work experience with relational databases
opened my eyes to just how bad the state of relational databases is.
So, what's wrong?
&lt;/p&gt;

&lt;p&gt; &lt;b&gt;No standard query language&lt;/b&gt;.  I do wish the &quot;S&quot; in SQL stood
for &quot;standard&quot;, but it doesn't.  There are SQL standards, but you
can't just take queries against an Oracle database and expect them to
work on MSSQL.  There is a certain base level of standardization, but
when you write SQL you have to be aware of what type of server you are
querying.  That's bad.
&lt;/p&gt;


&lt;p&gt;&lt;b&gt;No standard network protocol&lt;/b&gt;. 
In LDAP, any LDAP client can hit any LDAP server.  Compatability
at the protocol level.  What a concept!  Think about it.  Why should
we need database drivers?  We shouldn't.  After all these years,
we still don't have a standard protocol for talking to databases
and getting results back.  Of course you need the standard query 
language to make use of a standard network protocol.  
&lt;/p&gt;

&lt;p&gt;&lt;b&gt;No standard way to create or query schema&lt;/b&gt;.
In an LDAP server, there is a standard representation of the schema
and standard ways to query, add or remove schema.  While table creation
and update has some base level of consistency between servers, it's 
a far cry from being standardized.
&lt;/p&gt;

&lt;p&gt; The conclusion: after all these years of usage, relational
databases have completely failed to provide a reasonable level of
standardization or interoperability.  What is worse is that most
programmers I meet have never worked with better technologies and
don't seem to realize how bad off the situation is.  They complain
about maintaining SQL queries for each server and bang their head
making sure they have the right drivers and configuration files in
place to work with their databases.  Yet, despite all of this, they
don't think to yell and scream and demand something better.  &lt;/p&gt;

&lt;p&gt; Despite all of this, relational databases do work.  There's really
no accepted, viable replacement, so there's really no incentive for
relational vendors to unite and provide a modern, transparent,
interoperable database solution.  Unless database users demand it,
we've got many more years of bloated, legacy, proprietary relational
to look forward to.  Uggghhh...
&lt;/p&gt;</description>
  </item>
   <item>
    <title>Friends don't let friends write singletons</title>
    <link>http://members.capmac.org/~orb/blog.cgi/tech/coding/no_singletons.html</link>
    <description>
&lt;p&gt; The question of &lt;a
href=&quot;http://www.magpiebrain.com/archives/000084.html&quot;&gt;singleton or
static class&lt;/a&gt; reminds me that it's time for another rant against 
the evil that is the singleton anti-pattern.  I don't have a problem
with the points made, instead I want to again ask why one would
ever use a singleton.
&lt;/p&gt;

&lt;p&gt; Well, because you want to make sure only one instance of an object
exists in the system, silly.  But why?  Why should anyone ever care to
enforce a rule that only one instance can exist in the system? 
&lt;/p&gt;

&lt;p&gt; I've yet to see a compelling example of a non-system level case
where a singleton was actually required.  Normally the real need is
simply for cached instance that is easily locatable.  The application
doesn't actually REQUIRE that only one instance be created.  Instead,
it simply only wants one instance and using the singleton pattern
provides an easy way to do the cached lookup.  Most of the time, it
doesn't matter (performance and memory issues aside) if multiple
instances of the object existed.  It's just that the static getInstance()
is so easy.  And hey, look it's a &quot;Design Pattern&quot;, so it must be right.
&lt;/p&gt;

&lt;p&gt; Of course, the singleton is nightmare to to test.  The truth is
that most singleton objects depend on context information.  (and you
have my pity if you have to interact with a singleton configuration
context) That context information might be set in stone for a single
run of the application.  But in testing, you want to have multiple
contexts.  Good luck trying to get your singletons to do what you
want. But, my goal isn't to identify the singleton pain points.
(besides, you've probably already felt them yourself)&lt;/p&gt;

&lt;p&gt; Instead, I'd like to offer some advice for working without
singletons.  First, keep in mind what your goals are.  If you need a
cached instance, then simply provide a cached instance.  Don't
restrict the usage of your class in ways that aren't absolutely
necessary.  &lt;/p&gt;

&lt;p&gt; Decouple object creation policies from your class.  If you
have a need to provide for controlled instantion of a class, don't put
the logic on the class in a static method.  Put that logic in some
other place, (think factory or builder) allowing your application to
choose/extend/override the creation policy as needed.  Let the object
worry about providing it's functionality and let some other object
worry about managing instances of objects.  Mixing the two causes pain.
&lt;/p&gt;

&lt;p&gt; Avoid hardcoded lookup strategies in your code.  Instead of seeing
singletons in your design, see managed components.  When you see
managed components, think about inversion of control.  I've tried to
avoid jumping on the IoC bandwagon, but the solution is extremely
elegant.  Instead of having your components do hardcoded getInstance()
lookups, let a manager object tell you what the object is.  You can
still have one shared instance for all your components if you want.
But you can do it without the restrictions that the singleton brings.
&lt;/p&gt;


&lt;p&gt; Avoiding singletons isn't always easy.  Singleton's are great
replacements for global variables and they keep you from having to
create and manage a context for your application.  It's easy to choose
present conveniece at the expense of future pain, especially when you
are following a well known design pattern.  After all, if it's in &lt;a
href=&quot;http://www.amazon.com/exec/obidos/ASIN/0201633612/ref=nosim/orb-20&quot;&gt;GoF&lt;/a&gt;, it must always be a good thing, right?
Just think through your goals.  There may be times when a singleton
really is he best choice, but in my experience it's usually the wrong
solution.  &lt;/p&gt;</description>
  </item>
   <item>
    <title>Use cases are not requirements</title>
    <link>http://members.capmac.org/~orb/blog.cgi/tech/coding/usecase_requirements.html</link>
    <description>
&lt;p&gt; Rick Lutowski gave the technotizer at this months &lt;a
href=&quot;http://www.austinjug.org/&quot;&gt;AustinJUG&lt;/a&gt; and talked a bit about
the &lt;a href=&quot;http://www.jreality.com/freedom/&quot;&gt;&quot;Freedom&quot;
Service-Oriented Methodology&lt;/a&gt;.  I'll talk about Freedom at some
other point, because, frankly, I'm not exactly sure I understand it.
Nonetheless, Rick said one thing that caught my attention.  &lt;b&gt;Use
cases are not requirements&lt;/b&gt;.  &lt;/p&gt;

&lt;p&gt; Rick compared designing an application to designing the dashboard
of a car.  Use cases are to the application design what a drivers ed
manual is dashboard design.  They both explain how the user will use a
system but you can't design software around use cases any more than
you can design a dashboard around a drivers ed manual. &lt;/p&gt;

&lt;p&gt; That was a powerful analogy to me.  Use cases can help you
understand a system and can help you understand what the requirements
for the system are, but they aren't in any way, shape or form a
substitute for real requirements.  We only got the 20 minute version
of the talk, so I can't really do justice to what Rick thinks real
requirements should be.  Nonetheless, I do think that the methodology
that he is promoting is worth looking into. 
&lt;/p&gt;

</description>
  </item>
   <item>
    <title>eXtremely disappointed in scrum</title>
    <link>http://members.capmac.org/~orb/blog.cgi/tech/coding/bad_scrum.html</link>
    <description>
&lt;p&gt;
I thought 
&lt;a href=&quot;http://www.controlchaos.com/&quot;&gt;scrum&lt;/a&gt; was supposed an agile
process, but after being a week in the scrum, I want out. I really am trying
to keep an open mind, but I seem to be spending much more time than I 
used to worrying about process.  We have daily meetings in the morning
where we all have to estimate our hour and tasks and basically give a status
update.  This takes 15-30 minutes of time that I could be using to 
actually do my work.
&lt;/p&gt;

&lt;p&gt; What is worse is that to have anything interesting to say that
early in the morning, I need to get in half an hour before that, look
over the sprint backlog at my tasks and try to spend a lot of time
thinking about how much time I have left on the task.  I estimate that
scrum costs me 45 minutes to an hour of development time a day that I
could be using to actually do something productive.
&lt;/p&gt;

&lt;p&gt; I find myself being so burdened by the process rather depressing
and I am having a hard time being motivated to write good code.  Scrum
definitely isn't having a positive effect here. But, what would make it
better?
&lt;/p&gt;

&lt;p&gt; &lt;b&gt;Kill the daily meetings&lt;/b&gt;.  Daily meetings are a burden.
Ideally, a good process should have 0 scheduled meetings and 0 process
related meetings.  Occassional on the spot meetings to discuss a
particular issue or brainstorm solutions to a problem are cool.  I 
could live with a weekly team meeting if we really had to, but daily
scheduled meetings are too heavy.
&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Don't estimate in terms of hours&lt;/b&gt;.  I mentioned before that I
was skeptical about the need to break tasks down to N hour chunks.
Even my initial skepticism turned out to be too mild.  I've been
watching everyone's time estimates.  I've discovered that not only is
it nearly impossible for me to accurately estimate time, nobody else
can either.&lt;/p&gt;

&lt;p&gt; Extreme programmers say that estimates become more accurate with
time.  Perhaps that's true when you are using more abstract time
measures.  If I can handle 5 &quot;units&quot; of work in a week, everything
sort of works out.  Maybe one task took longer because I was tired and
another was faster because it was a sunny day and I was happy.  I
don't really get bogged down in the details. I estimate wrong it
doesn't feel &quot;wrong&quot;.  &lt;/p&gt;

&lt;p&gt; But 4 hours is 4 hours.  If I saw 4 hours and it takes 8 hours, I
was &quot;wrong&quot;.  If I only shave 2 hours off a task in an 8 hour day, I
was &quot;wrong&quot;.  You can say it doesn't matter.  It's just an estimate.
It's supposed to change.  Maybe so, but I was still wrong, and I don't
like to be wrong.  &lt;b&gt;Being wrong makes me unhappy, and when I am unhappy
I don't code well&lt;/b&gt;.  &lt;/p&gt;

&lt;p&gt;
I've only been doing this for a week.  I'm sure it will get better.  
But, I'm honestly not optimistic about it.

&lt;/p&gt;</description>
  </item>
   <item>
    <title>First impressions of scrum</title>
    <link>http://members.capmac.org/~orb/blog.cgi/tech/coding/scrum_starting.html</link>
    <description>
&lt;p&gt; I mentioned a few days ago that we've adopted &lt;a
href=&quot;http://www.controlchaos.com/&quot;&gt;scrum&lt;/a&gt; as our development
process.  Until this week I didn't really know much about it.  (and I
still don't) Scrum shares a lot with other agile methodologies like
extreme programming.  There is a focus on quick 30 day iterations
(called sprints) which are bigger in focus than XP iterations but not
really by much. The goal is to always deliver a working product with
features lists (the backlog) based on customer input.  &lt;/p&gt;

&lt;p&gt; Scrum doesn't dictate controversial practices like pair
programming.  Instead, the particular practices seem to be up to the
group (the scrum team) to work out in the context of their own
organization.  So, you could employ XP techniques inside of scrum, if
you want.&lt;/p&gt;

&lt;p&gt; I think it's an interesting approach.  I'm not looking forward to
the daily 15 minute status meetings. But I'm pretty sure we won't keep
with that practice long.  Engineering is very small and communicates
well.  The goal of the meetings is to find out what has been done and
what is in people's way.  But we communicate well that this meeting
won't really add any value.&lt;/p&gt;

&lt;p&gt; It looks like scrum has task estimates tracked in terms of hours.
I'm skeptical of this.  I liked the XP practice of measuring tasks in
terms of some abstract unit.  For me a 4 hour task might take 2 hours
one day and 6 hours the next, depending on how I feel on any given
day. I'd prefer just call it &quot;1 unit&quot; and know that my speed on a unit
is variable but that it all averages out.  If we have to talk in terms
of clock time, I'm afraid that it will be difficult for me to really
get good estimates out.  In other words, I believe that the time it
takes me to do a task is highly variable and only meaningful in
aggregate terms.  I'll try and keep my mind open though.  &lt;/p&gt;

&lt;p&gt; We went over the initial product backlog and will start our first
sprint soon.  I'm sure it will be an interesting journey.  &lt;/p&gt;</description>
  </item>
   <item>
    <title>Scrumdiddlyumptious</title>
    <link>http://members.capmac.org/~orb/blog.cgi/tech/coding/scrum1.html</link>
    <description>
&lt;p&gt; We are starting a new round of development at work tomorrow and it
looks like we are going &lt;a
href=&quot;http://www.agilealliance.org/home&quot;&gt;agile&lt;/a&gt;.  (hopefully that's not like going postal)  My only real exposure to this style of development is
through the Addison-Wesley eXtreme series.
  &lt;/p&gt;

&lt;p&gt;But, the lucky methodology isn't extreme programming, it's scrum.
Besides having seen the &lt;a
href=&quot;http://www.amazon.com/exec/obidos/tg/detail/-/0130676349&quot;&gt;scrum
book&lt;/a&gt; at a local bookstore, I really don't have any idea what to
expect.  I was tempted to go read the book this weekend or at least do
some investigation on the web, but I think I'll just try and hit it
fresh with no preconceived notions of what the process is/isn't.  (or
should/shouldn't be) &lt;/p&gt;

&lt;p&gt; Hopefully the change will be a positive one.  The mere fact that
we are making it tells me that the company is serious about trying to
improve engineering and make things work better.  I *think* that's a
good sign...  &lt;/p&gt;</description>
  </item>
   <item>
    <title>topcoder kata</title>
    <link>http://members.capmac.org/~orb/blog.cgi/tech/coding/topcoder_kata.html</link>
    <description>
&lt;p&gt; I've been watching Dave's &lt;a
href=&quot;http://www.pragprog.com/pragdave/Practices/Kata/&quot;&gt;code
kata's&lt;/a&gt; with a good bit of interest.  I taught myself programming
(20 years ago on a commodore vic 20) by thinking up small little
programming challenges and trying to solve them.  Of course, it took a
while before I could really do interesting.  In middle school, I
finally mastered the breakout kata (bouncing a ball around the screen
and knocking out blocks) and the calculating pi kata. (using '4 - 4/3
+ 4/5 - 4/7 + ...')  Part of the fun of the last one was computing the
fractions to arbitrary precision and then watching the program churn, gradually getting more and more digits in place. &lt;/p&gt;

&lt;p&gt; In middle school and high school I competed in programming
contests.  We had 4 or 5 contests during the school year (the most
important being the TCEA area and state contests, which &lt;a
href=&quot;http://www.tcea.org/ContestsAwards/StudentContests/ProgrammingContests.asp&quot;&gt;appear
to still be going strong&lt;/a&gt;.  I'd sit in the computer lab working
through each problem again and again until writing them was second
nature to me.  &lt;/p&gt;

&lt;p&gt;Nobody seemed to understand why doing these same programs over and
over again amused me, but I guess it's the same reason that my son can
watch the same Yu-Gi-Oh episode over and over and not get bored.  If I
knew I was just training myself with code kata's, I probably wouldn't
have enjoyed it nearly as much.  &lt;/p&gt;

&lt;p&gt; For the last year or two, my training of choice has been &lt;a
href=&quot;http://www.topcoder.com&quot;&gt;topcoder&lt;/a&gt;.  If you have never tried
topcoder, you should check it out.  They host regular programming
contests where you face off against other coders to solve programming
problems.  The results of the competition factor into your rating and
also qualify you for contests with big cash prizes.  (they used to
offer prizes for even the smaller competitions, but sadly that stopped
some time ago)
&lt;/p&gt;

&lt;p&gt; I've been so busy that I haven't competed for quite some time, but
I'm still quite proud of my &lt;a
href=&quot;http://www.topcoder.com/?t=statistics&amp;c=member_profile&amp;Coder_Id=150940&quot;&gt;topcoder
rating&lt;/a&gt;.  If you are curious what kind of problems you see in
topcoder competitions, I have a list of &lt;a
href=&quot;http://jump.net/%7Eorb/topcoder&quot;&gt;problems and solutions&lt;/a&gt; from
some of the earlier contests.  The difficulty level of the problems
isn't marked, so you'll have to log into the arena applet to see the
problems in context. But that's something I highly recommend doing. 
&lt;/p&gt;

&lt;p&gt; Even if you aren't brave enough to put your ego on the line in a
rated competition, working through the problems is really fun.  No
matter how good of a coder you THINK you are, you'll definitely find
kata to challenge you at topcoder.  &lt;/p&gt;</description>
  </item>
</channel>
</rss>
