From: Patrick Hurley Date: 2005-09-27T00:24:34+09:00 Subject: Re: Relative speed of Ruby vs Java for a large compiled app like Freenet > William Morgan wrote: > > > Probably the best idea for this type of thing is to write a base Freenet > > library in C (if one doesn't exist already!), and do the higher-level > > behavior in Ruby. As long as you're smart about how you divide things, > > you can have the best of both worlds: the speed of C and the > > maintainability of Ruby. > This sounds like premature optimizations. Write the whole thing in Ruby (or whatever language you find most productive). Test it (and write test cases), verify its correctness. Then _if_ it is too slow profile it, locating the bottlenecks. Last step is then to speed up that small portion of critical path code (located by profiling, not guessing) and optimize the algorithm and/or the implementation (possibly rewriting a portion in C). I started programming on machines that were orders of magnitude slower than todays PC's. It has taken me years to train myself not to optimize while writing code, but for the vast majority of work I do now it is rarely an issue and when it is, optimizing well designed correct code is generally not too difficult. There are exceptions to every rule, but try it for a while. Patrick