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

Re: [TDD] Testable Languages

Expand Messages
  • Manuel Klimek
    I would definitely want expressions/closures as first-class citizens like in assertThat { assertThat(false) } abortsWith TestFailedException Doing such things
    Message 1 of 98 , Nov 14, 2007
      I would definitely want expressions/closures as first-class citizens like in

      assertThat { assertThat(false) } abortsWith TestFailedException

      Doing such things in C++ results in ugly Macro-Magic... Ruby
      allows such things to some extent via closures, but they're limited
      (http://innig.net/software/ruby/closures-in-ruby.rb)

      And I'd like a strongly and statically typed imperative language where
      the IDE was able to infer types while I'm typing, somehow magically
      visualizing interfaces that are inherent in the design, or automatically
      detecting and marking "pure" functions.

      Manuel
    • Donaldson, John (GEO)
      Well, here s a coda to this thread. Lots of good and thoughtful replies - for which thanks. I ve blended a couple together and here s what I ve got. By the
      Message 98 of 98 , Nov 19, 2007
        Well, here's a coda to this thread. Lots of good and thoughtful replies - for which thanks. I've blended a couple together and here's what I've got. By the way, I have a data structure which is document->parts->checkableAttributes, so a composite makes sense.

        I've got a composite which is CheckDocument. That loads several CheckParts, each of which in turn load different CheckAttributes.

        Then a call to CheckDocument.IsValid descends through all the Part checkers and attribute checkers.

        In each level I loop through the checkers (the loop is in the base class), and use the "&=" operator - it works fine in C#.

        Which has definitely reduced the scope of the memorized condition!

        Before I started, it looked like a scary refactoring - but TDD made it not scary, pretty fast, more-or-less error-free. A joy to do really, because now the code is much better.

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