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

Re: Programming Languages and XP (was Re: [OT] Re: [XP] Extreme Testing!)

Expand Messages
  • J. B. Rainsberger
    ... Manuel, I don t understand your reasoning here. I m not talking about the difference between having an interface and not having an interface. I m talking
    Message 1 of 111 , Jul 1, 2007
    • 0 Attachment
      Manuel Klimek wrote:

      > Joe,
      >
      > On 7/1/07, J. B. Rainsberger <jbrains762@...
      > <mailto:jbrains762%40gmail.com>> wrote:
      > > > I agree that it may be easier to code in Smalltalk than in C++ (though
      > > > I don't have much experience with Smalltalk). It may be even easier
      > > > to arrive at a simple design in Smalltalk, due to some language
      > features
      > > > that C++ lacks. But in the end, the design is either easy or not (in a
      > > > certain context, to certain people, of course), regardless of what
      > > > language it is coded in. Perhaps we have a different definition
      > > > of "design"?
      > >
      > > A simple example: when I extract an interface, C++ forces me to
      > > duplicate the method declaration in various header files. I have to
      > > declare the method in the interface definition and each of its
      > > implementations. I don't have this problem in Java, Smalltalk, Ruby,
      > > Python, and others. So here is a case where C++ forces me to duplicate
      > > code that other languages don't force me to duplicate. Since removing
      > > duplication is part of simple design, in this direction, C++ designs are
      > > more complex than, say, Java designs.
      >
      > I don't agree that the example you come up with is not controversial.
      > I admit that it introduces duplication, which is bad, but on the other
      > hand it realizes a decoupling of the interface from the implementation,
      > which is IMHO nice. We could probably argue some time here, in the
      > end I think it's a trade off for personal taste and experience.
      >
      > So: Why does this duplication make the design less simple? Do
      > you have an other example?

      Manuel, I don't understand your reasoning here. I'm not talking about
      the difference between having an interface and not having an interface.
      I'm talking about the difference between introducing an interface in
      Java and introducing an interface in C++: it's clearly simpler in Java
      than in C++. I can't compare this case to Smalltalk or Ruby, because
      introducing an interface, for the most part, doesn't make sense in those
      languages. One could introduce a module in Ruby, but I don't know what
      the corresponding idea would even be in Smalltalk. I suspect it doesn't
      exist.

      Duplication makes the design less simple because the second element of
      simple design is "minimize duplication".

      > > > For a long time I myself was on the "this language is better than
      > > > that" crusade. At the moment I believe that you can do a decent
      > > > design in any language (with the exception of brainfuck and i686
      > > > assembler - just for reference: I meant higher level languages).
      > >
      > > Ron didn't claim that Smalltalk was better than C++. That would be
      > > stupid, and Ron's not stupid, in general.
      >
      > I didn't mean to imply that Ron said that Smalltalk was better than C++
      > with my remark. I now see that it was easy to interpret it that way,
      > so I apologize.

      NP. I just couldn't, and in the one remaining case above can't, follow
      your reasoning. It feels to me like when I argue X, you counterargue
      with something that doesn't actually counter X, but is orthogonal to X,
      and that leaves me a little confused.

      Take care.
      --
      J. B. (Joe) Rainsberger :: http://www.jbrains.ca
      Your guide to software craftsmanship
      JUnit Recipes: Practical Methods for Programmer Testing
      2005 Gordon Pask Award for contribution Agile Software Practice
    • J. B. Rainsberger
      ... I understand your point. I was partly acting as the devil s advocate and partly asking a genuine question about Smalltalk as a Smalltalk novice. Take care.
      Message 111 of 111 , Jul 6, 2007
      • 0 Attachment
        Ron Jeffries wrote:

        > Hello, J.. On Thursday, July 5, 2007, at 11:44:11 PM, you wrote:
        >
        > > So is the interface an important element of the design? In Smalltalk,
        > > the interface is implicit, because we can only deduce it by noticing the
        > > same method signatures in multiple classes and looking for the client
        > > code that uses the corresponding classes polymorphically (not knowing a
        > > more proper way to express that idea). Does Smalltalk then not obscure
        > > intent in this area? If not, why not?
        >
        > It can. There are implementations of interface-like things if you
        > want them. And other ways of expressing the thing.
        >
        > On the other hand, polymorphism without all that rigidity has value
        > too.
        >
        > But my only point was that the two designs, as reflected in the
        > code, are different. I'm not making a claim as to which one is
        > better, only that the language does make a difference to the design,
        > at least as implemented.

        I understand your point. I was partly acting as the devil's advocate and
        partly asking a genuine question about Smalltalk as a Smalltalk novice.

        Take care.
        --
        J. B. (Joe) Rainsberger :: http://www.jbrains.ca
        Your guide to software craftsmanship
        JUnit Recipes: Practical Methods for Programmer Testing
        2005 Gordon Pask Award for contribution Agile Software Practice
      Your message has been successfully submitted and would be delivered to recipients shortly.