On Wed, 2005-11-23 at 18:18 +1100, Erik de Castro Lopo wrote:
> Robert Collins wrote:
> 
> > > However, Perl, Python and Ruby are also often the wrong language.
> > > [try finding variable name spellos or type parity problems quickly in
> > > these languages - in a nice polite language like C, the compiler would
> > > find it nice and quickly for you].
> > 
> > I find that test cases find these things extremely fast. And the find
> > bugs that compilers cant :)
> 
> The Python "compiler" can't even find mis-spelled variable
> names, they have to wait for the run time envronment. Personally
> I think that is a little late :-).

When you have the opportunity for that sort of error, sure.

> While I agree wholeheartedly that tests are necessay, I'm curious 
> why you are advocating writing Python tests to find bugs at run time
> that say an Ocaml compiler will find for free at compile time.

MMM. Not quite what I would advocate, I was rebutting an argument
against dynamic typing languages, which I see as 'because my code is not
known to work, the compiler should do more'.

What I would advocate is that *all* things being put into code should
have two, and only two expressions: one in a test, stating what should
occur, and one in <whatever form> in the code, to actually do it.

I see that as being unrelated to language - its important for ocaml,
python & even assembly.

The corollary is that if you are doing this, variable names, type
mismatches, and the like, are rarely if ever a problem, and also
algorithmic errors, and bugs in general are much less common.

Rob

-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.

Attachment: signature.asc
Description: This is a digitally signed message part

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to