Hi Everyone,

I've been following the discussion on strong encapsulation with  
interest... It's a really interesting topic.

Reading through the posts and some of the Ruby books and  
documentation, I've come across the idea that Ruby's lack of strong  
typing is less important because there is some support for a unit  
testing framework.

My attention was grabbed by Jeff's response in the original thread,  
so instead of hijacking it, I thought it might be interesting to  
start a new discussion. I thought I'd kick things off with these  
points, sort of in order of priority:

Software engineering
   o In our experience, putting well defined layers into the code has  
always helped clarify the system
   o You can never tell what your users are going to do with your  
code! More protection is usually better :-)
   o Clarity and reliability are almost always more important than speed

Testing in the real world
   o Very often, only superficial testing is done, and this only  
catches the trivial stuff
   o It's easy to catch the easy errors. To catch the hard ones takes  
a *lot* of work
   o The late-breaking bugs are the ones that hurt - especially if  
it's a silly typo that could have been caught statically

Unit testing
   o Often the problems crop up in integration rather than within a  
particular unit - having stricter checking on interfaces would really  
help
   o It's hard to push a unit into all corners of it's functionality  
without reasonably fully fledged supporting functionality
   o If the testbench suffers from the same limitations as the  
language it's testing, how do you know where the error's being  
generated?

Testing methodology
   o There's a difference between syntax checking and verification of  
functional correctness
   o Rigorous testing of software is often extremely hard to do, if  
not impossible - esp GUIs and large web apps
   o Strict type checking can really help with the readability and  
maintainability of code

Just so you know where I'm coming from, I work verifying functional  
correctness of CPUs and designing the supporting tool flows. I have a  
strong disposition towards strong encapsulation, typing and testing,  
and even then I never do enough testing!

What do you all think?

Cheers,


Nick



--

Nick Pavey
nick / skatingloons.com