From: Florian Frank Date: 2002-12-18T03:30:12+09:00 Subject: Re: help -- persuade my boss to adopt ruby On 2002-12-18 02:05:16 +0900, Dan Sugalski wrote: > >I make these errors from time to time in C++. > How often is time to time, though? Daily? Weekly? Monthly? It's just > not a common error, so the argument that it's useful just doesn't > wash. (And the warning in your provided code is disingenuous as it is > a valid comparison in at least some of the cases, though worth proper > checking) In most cases static typing isn't useful for the programmer but useful for the compiler because it is simpler for the compiler to optimize the code. In most statically typed languages the programmer has to correct more errors and sometimes use stupid tricks to correct the false positives the compiler outputs as error. Even worse: There are false negatives, too. A strong typed language (which can't go wrong) is hard to get right and there are only few that achieve that goal, e.g. Miranda, ML&Co. or Haskell, and they usually have to pay a runtime-price. It's stupid to argue for static typing because it helps to detect errors: You end up having MORE UNNECESSARY errors and it won't detect any semantic errors either, so you have to write unit tests anyway. It's additionaly stupid to include typing in Ruby to gain more speed, because you can rewrite speed critical parts in Ruby programs in C and use the wonderful Ruby-C-API to interface your C-Functions. C is a portable assembler, so it's the right tool for this job. There are four important points why Ruby rules without beeing the fastest language in existance: 1. Development time shrinks and programmer's time is more expensive than hardware. 2. Program LOCs shrink => Less lines = Less possible errors. 3. If you really need the speed you can easily use Ruby's C-API. (Compare Perl XS to get the difference.) 4. It's more fun to program in Ruby than to search errors in bad strongly typed languages. => Better code quality. BTW: A very interesing talk concerning the typing topic an be found here: http://perl.plover.com/yak/typing/notes.html -- Don't worry about people stealing an idea. If it's original, you will have to ram it down their throats. -- Howard Aiken