Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #3227
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail |
|---|---|
| From | Lew <noone@lewscanon.com> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Initializing from context passing |
| Date | Sat, 23 Apr 2011 20:32:16 -0400 |
| Organization | albasani.net |
| Lines | 31 |
| Message-ID | <iovr28$4la$1@news.albasani.net> (permalink) |
| References | <91ga4tF38vU1@mid.individual.net> <iouv3r$5ls$1@dont-email.me> <91gnv8F6ooU1@mid.individual.net> <iovk75$jdp$3@news.albasani.net> <91h8hcFlmbU1@mid.individual.net> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Trace | news.albasani.net Ol7Ayo/kJoPj0H6YVmvQb2itsUo7SQAXg7Hn6wDRMYxsbnoIzJdKa8jnjGfIx9VUkSztEicT3FqrZuT2C/I2Eg== |
| NNTP-Posting-Date | Sun, 24 Apr 2011 00:32:08 +0000 (UTC) |
| Injection-Info | news.albasani.net; logging-data="Ns0JTatjmZwoNSqT2UCU7KhAvcTAGH6G1KJ4WTVbWWDzGEtqo5Y8Mg6LQTaOSVxdwKnZjIlU2LHl7vTZkkZQyeebTcSQh6x5JKtLPUclESeOZrRubcFg5aqiqNCqd33G"; mail-complaints-to="abuse@albasani.net" |
| User-Agent | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 |
| In-Reply-To | <91h8hcFlmbU1@mid.individual.net> |
| Cancel-Lock | sha1:S1C8L2Rq8LDovLhkwUl+P/vzFBs= |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:3227 |
Show key headers only | View raw
Dirk Bruere at NeoPax wrote: > But having said that, all the examples I have seen use ArrayList and not List I will assume you mean for the declared type of the variable and not the runtime instantiated type, since the latter cannot be 'List' as such. The question is why they do. Several possibilities exist, including but not limited to: - The API with which they interact is so poorly designed as to specify 'ArrayList' arguments or return types. - You are going to really, really poor sources for examples. - The pedagogical purpose of the examples has nothing to do whatsoever with the best practice of declaring the wider type, therefore they disregarded it. Regardless, only the first reason is compelling, and in the case of 'android.widget.ArrayAdapter<T>', inapplicable. Just because the examples you saw used 'ArrayList' as declared variable types, the fact that the API library only requires 'List' should have tipped you off. Programming is an art that requires thinking. The other red flag is that the declaration of 'ArrayList' variables is a violation of a best practice, and should send one scurrying about looking for why it was done, not unquestioningly following cattle to the slaughterhouse. -- Lew Honi soit qui mal y pense. http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar
Initializing from context passing Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-04-23 16:39 +0100
Re: Initializing from context passing Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2011-04-23 18:35 +0200
Re: Initializing from context passing Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-04-23 19:12 +0100
Re: Initializing from context passing Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2011-04-23 21:47 +0200
Re: Initializing from context passing Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-04-23 20:34 +0100
Re: Initializing from context passing Lew <noone@lewscanon.com> - 2011-04-23 18:35 -0400
Re: Initializing from context passing Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-04-24 01:17 +0100
Re: Initializing from context passing Lew <noone@lewscanon.com> - 2011-04-23 20:32 -0400
csiph-web