From: Robert Klemme Date: 2011-03-08T01:58:22+09:00 Subject: Re: Ruby - Missed some core computer science world ? On Mon, Mar 7, 2011 at 3:28 PM, Mike Stephens wrote: > Robert > > Surely, when you elect to use objects, and you are inclined to use > things like .each or .sort, you are making a choice to move away from > worrying about data structures and algorithms? No, I don't think so. I worry about DS&A all the time. When I have a frequent lookup to do I choose a Hash over an Array even though I can use Array for lookups as well (unless the key is an integer in which case an Array may work as well or better). It's true, I take Array#sort for granted and rely on the fact that it is implemented efficiently - much the same as when using qsort() in a C program. > There are of course still data structures and algorithms -rather like > the AI book mentioned above - but what people used to talk about in data > structures and algorithms were much more prosaic things which I suggest > are not of the same interest nowadays. This could be true (less interest in DS&A) but I really regret it. Because this is one cause for bad software - I believe too many people writing code are unaware of complexity theory, graph theory etc. and pick inefficient data structures or algorithms (or both). > When someone says "Why aren't there more things about Ruby array > searches etc?" I think there is a case for saying we treat these more as > implementation details nowadays and typically only investigate the > details if  a performance issue crops up, so look for a higher level of > abstraction when you move to Ruby. I'm not sure. It may also well be that the type of software written in Ruby isn't just that demanding with regard to complexity of calculations. When did we last discuss the most efficient algorithm to solve a graph connectivity problem here? So, finally it seems the original statement ("[...] the whole world of datastructures and algorithms, seems to have much lower importance on a ruby programmer's mind.") very well could be true - but the question remains: why is it so? And: what do we learn from this? Does the overall importance of DS&A diminish? Or is this a specific development in the Ruby community? etc. Interesting discussion nevertheless. Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/