Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: unchecked conversion warning. Date: Thu, 31 May 2012 17:18:18 -0700 (PDT) Organization: http://groups.google.com Lines: 36 Message-ID: <64c9f2b0-d58b-4efb-9d2d-a967348afdcd@googlegroups.com> References: <3s7cs7hd18l0ffci55ns0286n4lc4cutlu@4ax.com> <24hfs7hqsr75jmqgk87jcpfg85kif7nhuo@4ax.com> NNTP-Posting-Host: 69.28.149.29 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1338510018 28420 127.0.0.1 (1 Jun 2012 00:20:18 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 1 Jun 2012 00:20:18 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=69.28.149.29; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T User-Agent: G2/1.0 Xref: csiph.com comp.lang.java.programmer:14968 Eric Sosman wrote: > There's nothing fundamentally wrong with Vector. People will > moan and wring their hands over the cost of its synchronized methods, > but I haven't heard of any actual measurements. For me the cost is measured by the Javadocs. Synchronization - unnecessary for the 99%. Why have it? This is a logical cost, not a temporal one. Why include features you won't ever use? The burden of proof is on the decision to use 'Vector', not the one to eschew it. 'Enumeration' and the other legacy methods and members: Unnecessary except for legacy code that relied on 'Vector' to start with. Same argument. The cost is in features you don't need and never will. 'ArrayList' is simpler, less decorated with unnecessary features, and therefore better except when you need 'Vector'. Wrapped in it's equivalent in all collections-compatible respects to 'Vector'. So for new code 'Vector' is never necessary and always has stuff you don't need. It's redundant. So just pick the one equivalent choice with respect to stuff you do need, that is better with respect to the stuff you don't need. There's your measurement. -- Lew