Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!mailrus!iuvax!ux1.cso.uiuc.edu!ux1.cso.uiuc.edu!m.cs.uiuc.edu!johnson From: johnson@m.cs.uiuc.edu Newsgroups: comp.software-eng Subject: Re: recap so far Message-ID: <39400111@m.cs.uiuc.edu> Date: 8 Jul 90 03:09:00 GMT References: <4235@<268462df> Lines: 31 Nf-ID: #R:<268462df:4235:m.cs.uiuc.edu:39400111:000:1660 Nf-From: m.cs.uiuc.edu!johnson Jul 7 22:09:00 1990 kandt@ai-jupiter.JPL.NASA.GOV said: >Automatic data structure selection was a hot topic in the 70s because >people realized that there were tremendous pay-offs (in terms of >efficiency) by optimizing data storage and manipulation algorithms for >the expected data. Although automatic data structure selection would be nice, it is not really all that important. I program in Smalltalk using sets, sequences, and mappings (i.e. Sets, OrderedCollections, and Dictionaries) and almost never use arrays directly. Once a program works, I profile its performance. Sometimes I find that using a too-general data structure is causing a bottleneck, and I will then rewrite a few classes. However, very few of the uses of the general collection classes are bottlenecks, so it doesn't matter when they are used when a more specialized one could be used. To generalize, arguments against software reuse because it will result in systems that are too slow are wrong. Only the bottlenecks need to be optimized. I save a lot of time reusing components and am happy to spend some of it rewriting working code to make it faster. Another interesting fact is that the standard Collection classes are really fairly efficient, considering what they do. The average programmer who would try to write a linked list routine in C is likely to write something that is slower, and is likely to make a mistake or two. There are a few people who are really good at making programs fast. Once you have a library of reusable components, you should have one of them take a look at it and share their skills with others. Ralph Johnson -- University of Illinois at Urbana-Champaign