Return-Path: Delivered-To: apmail-gump-general-archive@www.apache.org Received: (qmail 51805 invoked from network); 16 Mar 2005 22:27:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 16 Mar 2005 22:27:54 -0000 Received: (qmail 59169 invoked by uid 500); 16 Mar 2005 22:27:53 -0000 Delivered-To: apmail-gump-general-archive@gump.apache.org Received: (qmail 59055 invoked by uid 500); 16 Mar 2005 22:27:53 -0000 Mailing-List: contact general-help@gump.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Gump code and data" Reply-To: "Gump code and data" Delivered-To: mailing list general@gump.apache.org Received: (qmail 59033 invoked by uid 99); 16 Mar 2005 22:27:53 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from netlx010.civ.utwente.nl (HELO netlx010.civ.utwente.nl) (130.89.1.92) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 16 Mar 2005 14:27:52 -0800 Received: from [130.89.165.200] (paddo.student.utwente.nl [130.89.165.200]) by netlx010.civ.utwente.nl (8.11.7/HKD) with ESMTP id j2GMQW608411 for ; Wed, 16 Mar 2005 23:26:32 +0100 User-Agent: Microsoft-Entourage/11.1.0.040913 Date: Wed, 16 Mar 2005 23:31:10 +0100 Subject: Re: Gump3 or Gump 2.1 From: Leo Simons To: Gump code and data Message-ID: In-Reply-To: <0dc501c52a70$b0264910$6501a8c0@sybase.com> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-UTwente-MailScanner-Information: Scanned by MailScanner. Contact helpdesk@ITBE.utwente.nl for more information. X-UTwente-MailScanner: Found to be clean X-UTwente-MailScanner-SpamScore: sss X-MailScanner-From: mail@leosimons.com X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Brain dump :-D On 16-03-2005 22:39, "Adam R. B. Jack" wrote: >> What would you enjoy most? :-D >> > Getting insights into a worldview outside of my head, and learning from/with > others. :-) > >> /I/ would love to see you helping out with Gump3. > > I'll give it a shot. > > I don't quite share your views that Gump needs to be so componentized, but > (1) I don't object to them and (2) I do see a lot I'd do differently another > time around & would like to tinker. It doesn't have to be "components" or "plugins". Those are big words that are fun because they sound intelligent and ring a bell with many people. As long as its "KISS" I'm happy. Small testable units. Small testable functions would do just as well and I'm definitely springkling those around where it makes sense. The subwiki codebase is one example of a function table based design in python that's extremely "componentized" in many ways :-D. It's just that I'm so used to class-based programming, so that's how some of it wound up. I'll argue though that plugging in various instances in different locations is easier to understand than having lambda functions, along with apply() and eval() and lots of metaprogramming. The latter is perhaps less coding work, but a lot more thinking work :-D. As I pick a new piece of work to get started on (built the beginnings of a model verifier for example), I tend to spend a lot of time reading through a lot of the code you wrote, which really is very educational. Try it :-D. It works both ways... 1) Where is the code in Gump2 that handles the stuff that the gump.engine.modellier.Verifier is supposed to do in Gump3? How do both of them work and what's the difference? 2) Where is the code in Gump3 that handles the complete() functionality found throughout the gump.model in Gump2? Why is it there and not part of the model? 3) What are the extension points in Gump2 for adding a new build command (for example, an )? Where are they in Gump3? Which one is easier, which one more intuitive? What would be optimal? 4) How does classpath management work in Gump2 and how could that be "componentized" into the Gump3 system without leading to clutter or making the core bits "language-aware"? There are *so* many design questions like that to ask and so many answers to be devised. It would amount to a whole lot of e-mails ;-) -- Talking about "worldviews", I'm guessing that this test-based approach to development I'm advocating is also something you're not that used to along with a lot of people around here (I guess that's an assumption based on the fact that gump2 doesn't have that many unit tests in relationship to the amount of code and features it has, and gump1 was totally untestable). I admit I've not been very disciplined about full test coverage, but I'm definitely working towards it. Maybe you'd like to take a stab at that as well, it's very liberating. Really! For example, look at my last commit on the Gump3 branch. Among other things, I changed a whole bunch of assert isinstance(blah,str) to assert isintance(blah,basestring) Which I had to do because the DOM library returns unicode strings (which I found out when doing a './gump run', which I hadn't done in a while as I was cleaning up code. I got an AssertionError). When I found that problem, I scattered some new code throughout the testModel.py test suite, creating unicode() strings and feeding them to the model object. I wound up with a nice list of test failures, making it trivial to be sort-of sure I fixed all the assertions in the modelling code. Feels good! Of course, you can just run tests using './gump test' and it takes only a few seconds to run them all, which is kinda vital to productive test-based development. Now, this made me realize that we probably need an assert_string(foo) method in a utility library somewhere. test_assert_string(self): a = "blah" b = unicode(a) c = "" d = unicode(c) f = None f2 = self self.assert_(assert_string(a)) self.assert_(assert_string(b)) self.assert_(assert_string(c)) self.assert_(assert_string(d)) self.assert_(not assert_string(f)) self.assert_(not assert_string(f2)) Followed by assert_string(argument): """Raises an AssertionError if the provided argument is not an instance of a string type. String types include 'str' and 'unicode'.""" # Implementation note: unicode strings didn't exist in early versions # of python, but since we require 2.3 anyway for gump, that's not a # problem assert isinstance(argument,basestring), \ "'%s' is not a string instance!" % argument I've yet to implement that change. Anyone feel up to it? :-P It gets more fun when the problem is complex and/or more difficult to test. For example, could we figure out the test cases for our process management woes? Once we do, writing the code that satisfies the tests will no doubt be easy enough, or at least a lot easier. Its those kinds of small steps which will lead to a much cleaner and much more understandable codebase in the end. I'm sure it's worth it! Cheers, Leo --------------------------------------------------------------------- To unsubscribe, e-mail: general-unsubscribe@gump.apache.org For additional commands, e-mail: general-help@gump.apache.org