From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,a3736685ef876ab2 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!p69g2000hsa.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: OO Style with Ada Containers Date: Wed, 21 Nov 2007 07:59:44 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <1195082906.420079.195000@d55g2000hsg.googlegroups.com> <1s27rv0gt4ujj$.3e2k326rp54d.dlg@40tude.net> <60e46dc9-d8ca-4f47-9e8a-f90a7d45e752@w28g2000hsf.googlegroups.com> <0319d921-4457-4b47-87f2-3f310aaa3d93@o6g2000hsd.googlegroups.com> <5076f153-d879-43dd-b2c8-ad61eeea241d@d61g2000hsa.googlegroups.com> <4182086a-2968-4c42-b08a-1a30b05fcf63@c29g2000hsa.googlegroups.com> <400347d7-aa93-4175-a3dc-e415ad0d9ca3@i29g2000prf.googlegroups.com> <4743f801$0$16661$9b4e6d93@newsspool3.arcor-online.net> NNTP-Posting-Host: 137.138.37.241 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1195660785 25490 127.0.0.1 (21 Nov 2007 15:59:45 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 21 Nov 2007 15:59:45 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: p69g2000hsa.googlegroups.com; posting-host=137.138.37.241; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.12) Gecko/20071019 Red Hat/1.5.0.12-0.7.el4 Firefox/1.5.0.12 pango-text,gzip(gfe),gzip(gfe) Content-Disposition: inline Xref: g2news1.google.com comp.lang.ada:18550 Date: 2007-11-21T07:59:44-08:00 List-Id: On 21 Lis, 10:18, Georg Bauhaus wrote: > At the other end of the argument is a hint from Code Complete > (McConnell 1993), adding heresy++ > > 'Think of arrays as sequential structures. Some of the brightest people > in computer science have suggested that arrays never be accessed > randomly, but only sequentially (Mills and Linger 1986). Good luck with sorting or binary search. :-) Using arrays as maps can be tricky as well... On the other hand, sequential access is more cache-friendly and benefits from modern optimizations (prefetch and such) at the hardware level. > At least when used by average programmers (like me) who rarely > invent quicksort for slices and such. What about array-organized maps/dictionaries (note that the array index might be an enumeration type as well)? Looking something in the dictionary is not something exotic, I hope? -- Maciej Sobczak * www.msobczak.com * www.inspirel.com