Loading ...
Sorry, an error occurred while loading the content.

Re: [XP] Digest Number 118

Expand Messages
  • DAVID LUCAS
    I will be out of the office until June 12, 2000. If this is urgent, please contact Kevin Dunlap. Thank you, Dave ... To Post a message, send it to:
    Message 1 of 1 , Jun 2, 2000
    • 0 Attachment
      I will be out of the office until June 12, 2000.
      If this is urgent, please contact Kevin Dunlap.

      Thank you,
      Dave


      >>> "extremeprogramming@egroups.com" 06/02/00 10:26 >>>

      To Post a message, send it to: extremeprogramming@...

      To Unsubscribe, send a blank message to: extremeprogramming-unsubscribe@...

      Ad-free courtesy of objectmentor.com
      ------------------------------------------------------------------------

      There are 25 messages in this issue.

      Topics in this digest:

      1. Re:New kid in the block
      From: Josu Oyanguren <josu@...>
      2. Re: SCM
      From: "Steve Freeman" <steve@...>
      3. Re: Where's the traffic?
      From: Till Schümmer <schuemme@...>
      4. Re: What are you reading guys?
      From: "mohammad iqbal" <mi368@...>
      5. Re: Re: Testing asserts in C++
      From: "mohammad iqbal" <mi368@...>
      6. RE: SCM
      From: "Martin Fowler" <fowler@...>
      7. AW: Re: Name for a Rule
      From: jerome.mueller@...
      8. RE: Re: Tracking User Stories
      From: "Morris, Chris" <chrism@...>
      9. OT: Implementing Design by Contract
      From: "Morris, Chris" <chrism@...>
      10. Re: Where's the traffic?
      From: William Tozier <bill@...>
      11. RE: Re: Tracking User Stories
      From: Ron Jeffries <ronjeffries@...>
      12. Roles for specialists?
      From: Russell Gold <russgold@...>
      13. Re: Roles for specialists?
      From: Ron Jeffries <ronjeffries@...>
      14. Re: What are you reading guys?
      From: "Alan Francis" <alanf@...>
      15. Re: What are you reading guys?
      From: "Alan Francis" <alanf@...>
      16. Re: OT: Implementing Design by Contract
      From: "Phlip" <phlip@...>
      17. Re: What are you reading guys?
      From: "Alan Francis" <alanf@...>
      18. Re: Re: What are you reading guys?
      From: "Joshua Macy/Towers Perrin" <macyj@...>
      19. Re: New kid in the block
      From: "Phlip" <phlip@...>
      20. Re: SCM
      From: Eric Rizzo <eric.rizzo@...>
      21. Re: Re: Where's the traffic?
      From: "Frank Gerhardt" <fg@...>
      22. Re: What are you reading guys?
      From: "Phlip" <phlip@...>
      23. Re: Re: Where's the traffic?
      From: Eric Rizzo <eric.rizzo@...>
      24. Re: Where's the traffic?
      From: "Susan Johnson" <susan.johnson@...>
      25. Re: OT: Implementing Design by Contract
      From: Dave Thomas <Dave@...>


      ________________________________________________________________________
      ________________________________________________________________________

      Message: 1
      Date: Fri, 2 Jun 2000 11:07:49 +0200
      From: Josu Oyanguren <josu@...>
      Subject: Re:New kid in the block

      > From: larocha@...
      >My Name is Luis Arocha. I live in Canary Islands, Spain. I've


      >Nobody in 2000 miles knows what XP is! I'm alone.
      >

      How many miles are there from Canary Islands to Bilbao?


      Josu.



      ________________________________________________________________________
      ________________________________________________________________________

      Message: 2
      Date: Fri, 2 Jun 2000 10:28:31 +0100
      From: "Steve Freeman" <steve@...>
      Subject: Re: SCM

      From: Ron Jeffries <ronjeffries@...>
      > At 09:06 AM 6/1/2000 -0500, Gareth Reeves wrote:
      > >Does anybody have recommendations/experiences for team source code control
      > >using Visual Age for Java professional edition?
      >
      > - Have an ID per programmer, not a single ID for everyone. Single ID
      > confuses the code manager, makes it hard to separate work in the rare cases
      > where you need to.
      > - Don't require passwords.
      > - Programmer who owns the task logs in when working on that task.
      > - Version classes and methods with initials of BOTH programmers, and the
      > version number, e.g. rjgr 1.13.
      > - Make as few Applications as you can. Wait until you know what you want
      > before making them.
      >
      > I'm sure others will chime in, those are just what popped into my mind.

      There are discussions on the C2 wiki, look for VisualAge and VisualAgeGripes, if I remember correctly.

      In my last job, we found that the user ID stuff was too annoying for the team to deal with, given all the other things they had to learn, and went to one ID. It bites most when you're starting up and creating/renaming classes a lot -- the VisualAge model for managing classes within a package is a bit broken (you don't notice it so much in Smalltalk because you work more with class extensions). If you have a smaller team, the training issue would be easier.

      One option would be to have a release ID that owns packages and projects. That way, you get warned when you're going to do anything that would affect other people immediately, such as deleting a class, and it's a good way to refocus when switching from coding to releasing.

      There's no direct equivalent of a VA Smalltalk Applications in VA Java, they provide a structure for extending a bunch of classes dynamically. It would have been really cool, but I guess that's the price of time to market.






      ________________________________________________________________________
      ________________________________________________________________________

      Message: 3
      Date: Fri, 02 Jun 2000 11:41:43 +0200
      From: Till Schümmer <schuemme@...>
      Subject: Re: Where's the traffic?

      Hi,

      it seems that the people mailing to the eGroup do not like newsgroups.
      Maybe, this is becaus of that many off-topic mailings, we can find in
      this newsgroup. I personally don't like having 50 XP-eGroups mails in my
      Inbox every day, but it is better than having to read so much news about
      broken Scanners (mybe use comp.perips.scanners) or Java programming
      problems (-> comp.lang.java).
      Everyone should switch from eGroups to the Newsgroup, to give the
      newsgroup a content profile. This would probably avoid too many off
      topic mailings.

      So, as common to XP: Refactor often and switch to the newsgroup...

      Till.

      > Hi,
      >
      > I left the egroups-hosted XP mailing list because of the completely
      > overwhelming traffic, hoping that this group would provide a better
      > way of channeling the discussions. Unfortunately it seems there's
      > not much going on - how comes? Since I'm on via UUNet I hope I don't
      > miss everything (other groups are fine). Occasionally, postings by
      > Phlip or Ron Jeffreys appear but they're very rare.
      > Anybody else with this problem?
      >
      > Holger



      ________________________________________________________________________
      ________________________________________________________________________

      Message: 4
      Date: Thu, 1 Jun 2000 21:45:56 +0300
      From: "mohammad iqbal" <mi368@...>
      Subject: Re: What are you reading guys?

      > What are you reading guys?

      Your message.

      Mohammed Iqbal



      ________________________________________________________________________
      ________________________________________________________________________

      Message: 5
      Date: Fri, 2 Jun 2000 09:52:38 +0300
      From: "mohammad iqbal" <mi368@...>
      Subject: Re: Re: Testing asserts in C++

      >
      > > I'm still a little vague on how to test classes which are
      > > very-black-boxes, you can never see the data behind the interface so
      > > your test case class can't get at it. I could add some get*()
      > > methods, but keeping my classes as black as possible is important,
      > > get
      > > *() methods can turn them grey. I guess you could also make the test
      > > case a friend class, but that could get messy. I could also #define
      > > away the "private:".... ick.
      >
      I have an article with source code of a replacement of asserts. In other
      words, it overcomes the problems of assert by building an Eiffel-like
      assertion mechanism.

      Mohammed Iqbal



      ________________________________________________________________________
      ________________________________________________________________________

      Message: 6
      Date: Fri, 2 Jun 2000 06:36:44 -0400
      From: "Martin Fowler" <fowler@...>
      Subject: RE: SCM

      But beware, you have to be connected to the network to do anything and you can't
      put anything other than Java source under source control.

      Martin

      -----Original Message-----
      From: kentbeck@... [mailto:kentbeck@...]
      Sent: Thursday, June 01, 2000 12:51 PM
      To: extremeprogramming@egroups.com
      Subject: RE: [XP] SCM


      "Can the extra cost be justified by the built in SCM?"

      Yes. It's fast, robust, and integrated with the IDE. Might you ever lose a
      day tracking down problems with external SCM? If yes, put a crowbar in your
      wallet.

      Kent




      To Post a message, send it to: extremeprogramming@...

      To Unsubscribe, send a blank message to:
      extremeprogramming-unsubscribe@...

      Ad-free courtesy of objectmentor.com



      ________________________________________________________________________
      ________________________________________________________________________

      Message: 7
      Date: Fri, 2 Jun 2000 13:55:39 +0200
      From: jerome.mueller@...
      Subject: AW: Re: Name for a Rule

      > This might not be serious enough.
      >
      > For some reason Yogi Berra came to mind, but nothing I recall he said
      > seems to fit.

      The only one I can think of is:

      "It's deja vu all over again"

      Jerome


      ________________________________________________________________________
      ________________________________________________________________________

      Message: 8
      Date: Fri, 2 Jun 2000 07:09:34 -0500
      From: "Morris, Chris" <chrism@...>
      Subject: RE: Re: Tracking User Stories

      > (This also addresses the danger of losing cards --
      > we had a couple
      > of scares at first, but no longer.)

      What about backup of cards? I backup everything else I do, code, database,
      etc... Anyone ever lose a whole set of cards? Did that derail the process?
      Was it not really a big deal since the customer still knows what he wants?

      Chris


      ________________________________________________________________________
      ________________________________________________________________________

      Message: 9
      Date: Fri, 2 Jun 2000 07:32:37 -0500
      From: "Morris, Chris" <chrism@...>
      Subject: OT: Implementing Design by Contract

      In the July 2000 issue of Software Development - they have an article on
      Design by Contract in Java. I've not read much about DbC prior to this
      article - but I'd assumed DbC involved using asserts or exceptions at the
      top of a method to ensure inputs were correct.

      The article says the following:

      "[DbC] essentially serves as a set of coding standards for code comments."

      ... then they have an example with the DbC in the comment header of a
      method. According to this article, DbC is implemented in comments, not code.
      What does that buy me?:

      "Because the comments are now standardized, tools can actually understand
      the contract and enforce it, essentially performing automatic black-box
      testing ... Design errors can also be caught by testing tools, which can use
      the contract information to test the classes more thoroughly and
      efficiently."

      This makes a little more sense, I suppose - but requires another tool to
      interpret the comments and act on them to enforce the contract. Do any tools
      exist that do this? The article seems to say no, but isn't the clearest
      article, IMHO.

      The author then makes some stunning predictions:

      "If a tool existed that could output a contract from design tools, we could
      automate everything from design to testing."

      Huh - automated design. I would have figured that would involve some sort of
      Borg-like interface to the customer's brain.

      Is it just me...?


      Chris Morris
      Snelling International
      800-411-6401 x1320
      chrism@...




      ________________________________________________________________________
      ________________________________________________________________________

      Message: 10
      Date: Fri, 2 Jun 2000 08:54:20 -0400
      From: William Tozier <bill@...>
      Subject: Re: Where's the traffic?

      At 11:41 AM +0200 on 6/2/00, Till Schümmer wrote:

      >it seems that the people mailing to the eGroup do not like newsgroups.
      >Maybe, this is becaus of that many off-topic mailings, we can find in
      >this newsgroup. I personally don't like having 50 XP-eGroups mails in my
      >Inbox every day, but it is better than having to read so much news about
      >broken Scanners (mybe use comp.perips.scanners) or Java programming
      >problems (-> comp.lang.java).
      >Everyone should switch from eGroups to the Newsgroup, to give the
      >newsgroup a content profile. This would probably avoid too many off
      >topic mailings.

      Sorry -- we have just the opposite reaction here. Mail filters don't
      work for newsgroups, so you need to eke signal from the noise every
      time you visit. Emails don't expire from your local server and
      disappear, leaving the context and heads of threads missing, like
      news does for many of us in the low-bandwidth newsgroups.

      On the other hand, all those messages from the XP mailing list
      shouldn't *be* in your Inbox every morning -- they should have been
      automatically shifted into your XP mailbox where you can read them at
      your leisure. Still better, go to eGroups web and turn off the
      setting in your prefs that mails you the messages directly. Then go
      at your convenience to the website and read the threads in newsgroup
      form! It's not a mailing list, but an eGroup, after all.

      Now shall we try MacVsWintel, EuropeVsAmerica, EmacsVsVi, JavaVsCobol
      or equivalent? ;-)

      Regards,
      BillTozier

      --------------
      William Tozier
      bill@...


      "Betty Field, of Bognor Regis, West Sussex, believes a ritualistic
      ceremony was carried out on her pet rabbit, Bunkins."
      -- wire service account of alleged Satanic occurrences, June 1997


      ________________________________________________________________________
      ________________________________________________________________________

      Message: 11
      Date: Fri, 02 Jun 2000 08:56:18 -0400
      From: Ron Jeffries <ronjeffries@...>
      Subject: RE: Re: Tracking User Stories

      At 07:09 AM 6/2/2000 -0500, Morris, Chris wrote:
      >What about backup of cards? I backup everything else I do, code, database,
      >etc... Anyone ever lose a whole set of cards?

      no, not that I know of.

      >Was it not really a big deal since the customer still knows what he wants?

      That's what I'd expect.

      C3 scanned the cards for a while. Never looked at the scans. After a while
      they optimized the process.




      Ron Jeffries
      www.XProgramming.com


      ________________________________________________________________________
      ________________________________________________________________________

      Message: 12
      Date: Fri, 02 Jun 2000 09:06:30 -0400
      From: Russell Gold <russgold@...>
      Subject: Roles for specialists?

      XP appears to have no particular role for "specialists" often found on
      projects - so what do you do with these people? For example,
      if we have a number of "data analysts" and DBAs, none of whom are or want
      to be coders, what would happen to them if we fully transitioned to
      XP? These people have skills that nobody else on the team has. How can we
      continue to take advantage of their abilities?



      ________________________________________________________________________
      ________________________________________________________________________

      Message: 13
      Date: Fri, 02 Jun 2000 09:14:40 -0400
      From: Ron Jeffries <ronjeffries@...>
      Subject: Re: Roles for specialists?

      At 09:06 AM 6/2/2000 -0400, Russell Gold wrote:
      >XP appears to have no particular role for "specialists" often found on
      >projects - so what do you do with these people? For example,
      >if we have a number of "data analysts" and DBAs, none of whom are or want
      >to be coders, what would happen to them if we fully transitioned to
      >XP? These people have skills that nobody else on the team has. How can we
      >continue to take advantage of their abilities?

      Please explain for each a bit about what they do now.

      Ron Jeffries
      www.XProgramming.com


      ________________________________________________________________________
      ________________________________________________________________________

      Message: 14
      Date: Fri, 02 Jun 2000 13:15:37 -0000
      From: "Alan Francis" <alanf@...>
      Subject: Re: What are you reading guys?

      --- In extremeprogramming@egroups.com, Ron Jeffries
      <ronjeffries@a...> wrote:
      > At 11:42 AM 6/1/2000 -0500, Marco Dorantes wrote:
      > >What are you reading guys?
      >
      > The complete Sandman series by Neil Gaiman.

      Cool.

      Are you comics fan, a Gaiman fan, or just trying it out ?

      AlanFrancis (a comics fan, and a Gaiman fan :-)





      ________________________________________________________________________
      ________________________________________________________________________

      Message: 15
      Date: Fri, 02 Jun 2000 13:19:14 -0000
      From: "Alan Francis" <alanf@...>
      Subject: Re: What are you reading guys?

      --- In extremeprogramming@egroups.com, "Joshua Macy/Towers Perrin"
      <macyj@t...> wrote:
      >
      >

      I think that this:

      > The Pragmatic Programmer, Hunt & Thomas

      is what I hoped that this:

      > The Practice of Programming, Kernighan & Pike

      would be.

      I was *so* disappointed in the K&P book. Despiote their claims of
      multi-language coverage, it was really a C book.

      Imagine my surprise when I bought the Pragmatic Programmer and
      learned got what I was looking for :-)

      AlanFrancis


      > The Inmates are Running the Asylum, Cooper
      > Python Programming on Win32, Hammond & Robinson



      ________________________________________________________________________
      ________________________________________________________________________

      Message: 16
      Date: Fri, 2 Jun 2000 06:21:15 -0700
      From: "Phlip" <phlip@...>
      Subject: Re: OT: Implementing Design by Contract

      From: Morris, Chris

      > ... then they have an example with the DbC in the comment header of a
      > method. According to this article, DbC is implemented in comments, not
      code.
      > What does that buy me?:

      That and USD $ 3.50 will get you a tall latte.

      Phlip
      ======= http://users.deltanet.com/~tegan/home.html =======



      ________________________________________________________________________
      ________________________________________________________________________

      Message: 17
      Date: Fri, 02 Jun 2000 13:25:34 -0000
      From: "Alan Francis" <alanf@...>
      Subject: Re: What are you reading guys?

      --- In extremeprogramming@egroups.com, "Marco Dorantes"
      <marcodorantes@h...> wrote:
      > What are you reading guys?
      >

      Get Big Fast : The Story of Amazon
      Sex Tips for Girls - Cynthia Heimel (thanks Kent)
      Principles of Scientific Management - FW Taylor (thanks again, Kent)
      Love & Rockets book 4 - Los Bros Hernandez
      Fire in the Valley- Mike Swaine
      A History of Modern Computing - Ceruzzi
      Cerebus - Dave Sim (since 1977 :)
      Killer Content - Tomsen

      --AlanFrancis




      ________________________________________________________________________
      ________________________________________________________________________

      Message: 18
      Date: Fri, 2 Jun 2000 09:25:55 -0400
      From: "Joshua Macy/Towers Perrin" <macyj@...>
      Subject: Re: Re: What are you reading guys?




      I liked The Pragmatic Programmer better than The Practice of Programming, but I
      thought the latter had a lot of keen insight as well. One of my favorite quotes
      from it could be right out of XP: "A fast program that gets the wrong answer
      doesn't save any time."
      I didn't mind the examples in C; even though I don't write it anymore, I can
      still read it (and many of the examples were repeated in Java anyway).


      Alan Francis wrote:

      I think that this:

      > The Pragmatic Programmer, Hunt & Thomas

      is what I hoped that this:

      > The Practice of Programming, Kernighan & Pike

      would be.

      I was *so* disappointed in the K&P book. Despiote their claims of
      multi-language coverage, it was really a C book.

      Imagine my surprise when I bought the Pragmatic Programmer and
      learned got what I was looking for :-)

      AlanFrancis




      ________________________________________________________________________
      ________________________________________________________________________

      Message: 19
      Date: Fri, 2 Jun 2000 06:29:20 -0700
      From: "Phlip" <phlip@...>
      Subject: Re: New kid in the block

      From: <larocha@...>

      > Nobody in 2000 miles knows what XP is! I'm alone.

      So you own the XP franchise on tens of thousands of square miles. The
      possibilities are endless!

      > Well, here is my question:
      >
      > I use gcc as my C++ compiler and I have some problems with the
      > framework. I've read in the archive that other people has had
      > this problems too.

      What framework?

      Read this:

      http://c2.com/cgi/wiki?UnitTestsDefined

      Now download any of the zillions of GNU-tools projects that use a
      Makefile-based test rig just like that page defines. Mozilla comes to mind.

      > Is there a port of the framework to gcc(Linux/Intel)?

      You are violating YAGNI. XP is not a program written by Mike Feathers that
      will make all your dreams come true. Start by writing the simplest test rig
      you can think of: Open a new project with 'main()' in it, make 'main()' call
      one of your classes, send it fake data, and check the output is expectable.

      As you need more, refactor it into place.

      If there were a GNU-ready build of CppUnit, then you'd have a BuyDon'tBuild
      situation, not YAGNI.

      Phlip
      ======= http://users.deltanet.com/~tegan/home.html =======



      ________________________________________________________________________
      ________________________________________________________________________

      Message: 20
      Date: Fri, 02 Jun 2000 09:31:30 -0400
      From: Eric Rizzo <eric.rizzo@...>
      Subject: Re: SCM

      Martin Fowler wrote:
      >
      > But beware, you have to be connected to the network to do anything

      Not necessarily true. You can set it up at install so that you have a local
      repository in addition to the server one, and switch to it at any time. Moving
      code from one repos to the other is pretty easy, so you just download the stuff
      you need from the team repos to your local before you disconnect, then continue
      to work without the plug, and re-sync with the team repos when you plug back
      in. We had a number of notebook users who did this on a regular basis.

      > and you can't
      > put anything other than Java source under source control.

      That's a limitation I still don't understand the reason for (in VAJ). I've been
      told that ENVY (the repository) is capable of holding non-code, so I'm not sure
      why the ability to do so has continued to be left out of VAJ.

      Eric
      --
      Eric Nicholas Rizzo
      eric.rizzo@...
      The Technical Resource Connection, Inc. Perot Systems
      http://www.trcinc.com
      ---------------------------------------------------------------
      "A man talking sense to himself is no more insane than
      a man talking nonsense not to himself...or just as insane."
      -Rosencrantz and Guildenstern Are Dead


      ________________________________________________________________________
      ________________________________________________________________________

      Message: 21
      Date: Fri, 02 Jun 2000 06:35:33 -0700
      From: "Frank Gerhardt" <fg@...>
      Subject: Re: Re: Where's the traffic?

      -----Original Message-----
      From: Till =?iso-8859-1?Q?Sch=FCmmer?=
      schuemme@...
      Sent: Fri, 02 Jun 2000 11:41:43 +0200
      To: extremeprogramming@egroups.com
      Subject: [XP] Re: Where's the traffic?
      <<<I personally don't like having 50 XP-eGroups mails in my
      Inbox every day,>>>

      Move them to a XP mail folder automatically.

      <<<Everyone should switch from eGroups to the Newsgroup, to
      give the newsgroup a content profile. This would probably
      avoid too many off topic mailings.>>>

      No! Many people who read the mailing list are behind
      corporate firewalls that prevent NNTP from going through.
      Moving everything to newsgroups would be saying good-bye to
      those folks. Or they would have to read it on deja.com.
      Worse than anything if you have to download a webpage for
      each individual message.

      Frank.


      ________________________________________________________________________
      ________________________________________________________________________

      Message: 22
      Date: Fri, 2 Jun 2000 06:34:43 -0700
      From: "Phlip" <phlip@...>
      Subject: Re: What are you reading guys?

      > > What are you reading guys?

      The World According to Garp...

      Rabbit is Rich...

      The Hotel New Hampshire...

      Beauty's Punishment...

      Bag of Bones...

      NOT

      Phlip
      ======= http://users.deltanet.com/~tegan/home.html =======




      ________________________________________________________________________
      ________________________________________________________________________

      Message: 23
      Date: Fri, 02 Jun 2000 09:46:48 -0400
      From: Eric Rizzo <eric.rizzo@...>
      Subject: Re: Re: Where's the traffic?

      Till Schümmer wrote:
      >
      > Hi,
      >
      > it seems that the people mailing to the eGroup do not like newsgroups.
      [snip]
      > So, as common to XP: Refactor often and switch to the newsgroup...

      I'd like to, but unfortunately our news feed (from UUNet, IIRC) has yet to make
      the newsgroup available to us. or so I'm told by our network/firewall/web admin
      here that controls the news server. Is anyone else experiencing this, or should
      I call him on being lazy?

      As for the post about not being able to filter news messages, I'd say that a
      good news client would go a long way towards making it as easy as reading
      email. I use Netscape Messenger and, although not the best by most people's
      measure, it lets me filter news just like email, block certain authors and/or
      threads, etc.

      Eric
      --
      Eric Nicholas Rizzo
      eric.rizzo@...
      The Technical Resource Connection, Inc. Perot Systems
      http://www.trcinc.com
      ---------------------------------------------------------------
      "A man talking sense to himself is no more insane than
      a man talking nonsense not to himself...or just as insane."
      -Rosencrantz and Guildenstern Are Dead


      ________________________________________________________________________
      ________________________________________________________________________

      Message: 24
      Date: Fri, 02 Jun 2000 09:24:08 -0500
      From: "Susan Johnson" <susan.johnson@...>
      Subject: Re: Where's the traffic?

      The newsgroup isn't available to me, either.

      >>> eric.rizzo@... 06/02/00 08:46AM >>>
      unfortunately our news feed (from UUNet, IIRC) has yet to make
      the newsgroup available to us. or so I'm told by our
      network/firewall/web admin
      here that controls the news server. Is anyone else experiencing this,
      or should
      I call him on being lazy?




      ________________________________________________________________________
      ________________________________________________________________________

      Message: 25
      Date: 02 Jun 2000 09:26:00 -0500
      From: Dave Thomas <Dave@...>
      Subject: Re: OT: Implementing Design by Contract

      "Morris, Chris" <chrism@...> writes:

      [I swapped the order of these two paragraphs for dramatic effect-dt]

      > This makes a little more sense, I suppose - but requires another
      > tool to interpret the comments and act on them to enforce the
      > contract. Do any tools exist that do this? The article seems to say
      > no, but isn't the clearest article, IMHO.

      The example shown was for iContract, which will take those comments
      and generate the code to enforce them.

      > .. then they have an example with the DbC in the comment header of a
      > method. According to this article, DbC is implemented in comments,
      > not code. What does that buy me?:


      DbC is "Design" by Contract. The article mentioned this in passing,
      but didn't really drive the point home.

      DbC is _not_ simply assertions on steroids. Instead, it's a way of
      thinking about the coding process that leads to cleaner interfaces and
      more consistent semantics. Having the contracts actually enforced at
      runtime is really no more than icing on the cake.

      I personally feel that the most bang for the buck comes from
      considering class invariants. Often, explicitly stating an invariant
      guides the design of a class.

      As a trivial example, say I'm writing an accounting system. It uses
      double-entry bookkeeping, the debits must equal the credits. For class
      Accounts, that's my invariant:

      sum(credits) == sum(debits)

      So, I start to think about the external interface of my class.

      public Accounts(...);
      public recordCredit(amount, account);
      public recordDebit(amount, account);

      Put there's a problem with this. The invariant says that debits must
      equal credits, but here we've provided two routines that break the
      invariant, unless they are guaranteed to be called in pairs. Why
      should we take that risk, and why should we trust our class's
      invariant to third party code? Let's just refactor so that the
      invariant simply can't be broken:

      public recordTransaction(amount, debitAccount, creditAccount);

      [OK - I know that this is weak in real life, as the real routine would
      ned to take a list of account/amount pairs to allow for splits, but
      the important thing is how the invariant led to an improved
      interface.]

      In other cases, thinking this way also eliminates the infamous
      multi-step class constructor, where a call to 'new' is followed by a
      slew of attribute setters. Why should the rest of the world have to
      take responsibility for that class's invariant?

      DbC isn't magic, nor is is reliant on fancy preprocessors. It's simply
      a formalism describing what good developers do instinctively already.


      Just another two cents.


      Dave


      ___________________________________________________________________________
      | The Pragmatic Programmers, LLC | http://www.pragmaticprogrammer.com |
      | Read "The Pragmatic Programmer" | www.pragmaticprogrammer.com/ppbook/ |
      ---------------------------------------------------------------------------


      ________________________________________________________________________
      ________________________________________________________________________
    Your message has been successfully submitted and would be delivered to recipients shortly.