From: Chad Perrin Date: 2006-01-09T08:36:59+09:00 Subject: Re: Ideas on "Why Living Dangerous can be A Good Thing" in Ruby? On Mon, Jan 09, 2006 at 07:52:05AM +0900, Steve Litt wrote: > On Sunday 08 January 2006 05:42 pm, Gregory Brown wrote: > > On 1/8/06, Steve Litt wrote: > > > Compare them to C :-). Or Perl. > > > > I'm really not sure at all on this but could well written C or Perl be > > safer than Ruby? > > I'm thinking the answer to that is 'yes', but I'm not sure at all why > > (and what expense it would come at ) > > C is like using a punch press without safety interfaces. A very careful person > could use it safely, but an inattentive person would lose his thumb. > > Ruby is like a punch press with a safety interface. You'd need to try very > hard to lose your thumb. > > Now it just might be that a very careful and attentive C punch press operator > could operate more safely than a drunk and depressed Ruby punch press > operator, but that's not a fair comparison IMHO. Interesting analogy. Let's expand on that a bit: C is a punch press with no particular safety features, and in fact it has just barely enough integrated structure to do its job. You can create guides and the like, but you have to manhandle them into place yourself. Java is a punch press operator that has a bunch of guides, protective flanges to prevent your fingers getting too close to the business end, and so on. It has little levers to move stuff in and out of place easily for different jobs. The downside is that it allows certain job types, and for anything else you have to start redesigning and modifying the machine. Of course, you could always reach a hand in there and hit the button if you really want to lose a thumb, but you might have to tie a string around the dead-man switch. Ruby lets you define what "safety" means, and configures itself accordingly. It has sane defaults. It's also a programmable punch press, so it can pretty much do the work on its own without your interference. If you program it well, you don't have to be anywhere near the thing, and thus don't have to worry about your thumbs. If you program it poorly, it might suddenly start shuddering across the floor in its hungry quest for your thumbs. -- Chad Perrin [ CCD CopyWrite | http://ccd.apotheon.org ] "Real ugliness is not harsh-looking syntax, but having to build programs out of the wrong concepts." - Paul Graham