Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > [1.4] argv[] doesn't understand size() and iterator()??

Reply
Thread Tools

[1.4] argv[] doesn't understand size() and iterator()??

 
 
=?ISO-8859-1?Q?Thomas_Gagn=E9?=
Guest
Posts: n/a
 
      07-03-2003
Ian McCall wrote:
<snip>
>
> Am I coming across a bit better? Or is my foot still in my mouth...?
>
>


Reads fine.



--
..tom
remove dashes in email for replies
http://isectd.sourceforge.net

 
Reply With Quote
 
 
 
 
Jon Skeet
Guest
Posts: n/a
 
      07-03-2003
Ian McCall <(E-Mail Removed)> wrote:
> Hmm. I'm going to plead poor phrasing here, but I still believe that arrays
> in Java are quite odd. My description as 'essentially primitive' was poorly
> chosen, but Java arrays still behave more like C arrays (or more accurately,
> like Ada arrays with their attributes) rather than exhibiting object-like
> behaviour.
>
> I fully accept that you're right within the language spec, but in
> actual -usage- an array feels like a hack into the language design. If they
> truly behaved in an object-like fashion, then why are there so many static
> utility classes to deal with them (Array, ArrayUtils, converting to
> ArrayLists etc.) rather than methods off the object itself?.


Because the Array class came to the party late (1.2), and it was
probably seen as too late to start adding methods to arrays themselves
- that would have involved a JLS and JVM spec change.

> I meant my
> description to reflect the fact that trying to use collection-style routines
> on them is pretty meaningless, even though in reality they -are-
> collections.
>
> Am I coming across a bit better? Or is my foot still in my mouth...?


The above is certainly accurate, yes

--
Jon Skeet - <(E-Mail Removed)>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
 
Reply With Quote
 
 
 
 
Jonathan Oexner
Guest
Posts: n/a
 
      07-03-2003
"Ian McCall" <(E-Mail Removed)> wrote in message news:<rdTMa.1545$(E-Mail Removed)>...

> I fully accept that you're right within the language spec, but in
> actual -usage- an array feels like a hack into the language design. If they
> truly behaved in an object-like fashion, then why are there so many static
> utility classes to deal with them (Array, ArrayUtils, converting to
> ArrayLists etc.) rather than methods off the object itself?.


Well, it's a good idea to have _some_ kind of access to arrays or
array-like structures in a language, or a great many programming
techniques will have to be rethought. The designers of Java decided
to expose array functionality through a thin Object wrapper, so that
programmers could pass 'em around by reference without having to roll
their own wrapper class. It's not a perfect fit, but if you really,
REALLY want pure OO, go talk to the Smalltalk folks. And, one more
thing: ArrayUtils? Where's this class defined? Is it a Java 1.5
thing?
 
Reply With Quote
 
=?ISO-8859-1?Q?Thomas_Gagn=E9?=
Guest
Posts: n/a
 
      07-03-2003
Jonathan Oexner wrote:
>
> Well, it's a good idea to have _some_ kind of access to arrays or
> array-like structures in a language, or a great many programming
> techniques will have to be rethought.


I missed the spot where anyone advocated against the existence of arrays. On
the contrary, it was only pointed out that they should have been a subclass of
a collection class.

> The designers of Java decided
> to expose array functionality through a thin Object wrapper, so that
> programmers could pass 'em around by reference without having to roll
> their own wrapper class.


Objects are already passed around by reference. What would require a wrapper?

> It's not a perfect fit, but if you really,
> REALLY want pure OO, go talk to the Smalltalk folks.


It's too bad more people haven't.

> And, one more
> thing: ArrayUtils? Where's this class defined? Is it a Java 1.5
> thing?



--
..tom
remove dashes in email for replies
http://isectd.sourceforge.net

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Read all of this to understand how it works. then check around on otherRead all of this to understand how it works. then check around on other thelisa martin Computer Support 2 08-18-2005 06:40 AM
endless loop and i dont understand why Alexandre Java 4 04-12-2005 07:20 PM
how to read and understand long written VHDL code? walala VHDL 6 09-03-2003 07:49 PM
any good book to learn and understand design patterns Abhijit Mhatre Java 2 07-23-2003 04:15 AM
Can you help me understand this javascript example that runs on IE and Opera and crashes under Mozilla? Jerry Asher Javascript 0 07-15-2003 06:12 AM



Advertisments