From: Alan Burch Date: 2006-03-12T02:26:52+09:00 Subject: Re: Help me understand why the Ruby block is slower than wit James Gray wrote: > On Mar 11, 2006, at 9:58 AM, Alan Burch wrote: > >>> >>> This sounds like premature optimization. Remember, you start >>> worrying about speed when the code gets too slow. Not before. >>> >>> James Edward Gray II >> >> James: >> I'm going to have to respectfully disagree. > > Well, I'm pretty darn sure you are in the minority on that one: ;) > > http://www.google.com/search?q=%22premature+optimization%22 > > James Edward Gray II James: I'm going to make a leap of faith here and guess that we're in agreement on this one--it's just a difference in where we are in understanding the language. I'm just learning it and need to run the profiler, debugger, take timing measurements, and read lots of examples to fully understand it still. I wouldn't peddle my (lack of) Ruby skills to any client at this time, but it's by taking these steps that I will become a good Ruby software developer. Others may be able to make the transition from a developer who can make the code work to one who is actually good at it (accurate, maintainable, resource appropriate code done quickly) without taking these steps, but I cannot. From your google search I have: http://www.cookcomputing.com/blog/archives/000084.html Premature Optimization....suggests the famous quote originating from Tony Hoare and restated by Donald Knuth: "Premature optimization is the root of all evil". I've always thought this quote has all too often led software designers into serious mistakes because it has been applied to a different problem domain to what was intended. The full version of the quote is "We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil." and I agree with this. Its usually not worth spending a lot of time micro-optimizing code before its obvious where the performance bottlenecks are. But, conversely, when designing software at a system level, performance issues should always be considered from the beginning. A good software developer will do this automatically, having developed a feel for where performance issues will cause problems. An inexperienced developer will not bother, misguidedly believing that a bit of fine tuning at a later stage will fix any problems. Knowing the language well enough, will cause me as an experienced software developer to automatically build the best code, while the inexperienced developer will continue to write code that gives people like me a well above average income :) Take care, Alan -- Posted via http://www.ruby-forum.com/.