Re: Struct is slow
- From: "Robert Dober" <robert.dober@xxxxxxxxx>
- Date: Thu, 25 Oct 2007 03:50:40 +0900
On 10/24/07, Rick DeNatale <rick.denatale@xxxxxxxxx> wrote:
Funny you say that Rick, because I was thinking about the role testing
This is one example where strong typing could have made a difference.
Had the array been declared as an array of arrays or array of structs,
perhaps another language could have detected the error. I'm not
advocating for strongly typed languages, I'm just saying that some kinds
of errors could be harder to find in Ruby. What do you folks think?
What would have made a bigger difference would be to develop that code
in the contest of specifications written as tests.
This would allow you to first concentrate on making the code do the
right thing before trying to optimize it.
I usually find that it really doesn't matter how fast things run if
they produce the wrong results.
should have in this.
I kind of ponder of writing two test suits for my projects, one which
clearly is BDD (shall be) and one that kind of replaces very defensive
programming style full of assertions.
Now this is indeed a dangerous road because one might fall
into the trap of implementing a straight jacket, killing the duck ;) etc.
I still believe however that such "microtests" can be a valuable tool
and might be
more useful to find some errors than debuggers, depending on the type
of error of course.
Any thoughts, experiences about/with that approach?
Cheers
Robert
--
what do I think about Ruby?
http://ruby-smalltalk.blogspot.com/
.
- Follow-Ups:
- Re: Struct is slow
- From: Rick DeNatale
- Re: Struct is slow
- References:
- Re: Struct is slow
- From: Robert Klemme
- Re: Struct is slow
- From: Sylvain Joyeux
- Re: Struct is slow
- From: Joel VanderWerf
- Re: Struct is slow
- From: Robert Klemme
- Re: Struct is slow
- From: Rick DeNatale
- Re: Struct is slow
- From: Wayne Magor
- Re: Struct is slow
- From: Rick DeNatale
- Re: Struct is slow
- Prev by Date: Re: Ruby Certification Test
- Next by Date: Re: string method that takes in a regex
- Previous by thread: Re: Struct is slow
- Next by thread: Re: Struct is slow
- Index(es):
Relevant Pages
|