Path: news.cs.au.dk!news.net.uni-c.dk!uninett.no!newspump.monmouth.com!newspeer.monmouth.com!newsxfer.itd.umich.edu!gumby!newspump.wustl.edu!rice!not-for-mail From: Shriram Krishnamurthi Newsgroups: comp.lang.beta Subject: Re: Beginner at work: two dimensional value-based array generic Followup-To: poster Date: 09 Jan 1999 11:45:55 -0600 Organization: Rice University, Houston, Texas Lines: 38 Message-ID: References: NNTP-Posting-Host: southamerica.cs.rice.edu Mime-Version: 1.0 (generated by tm-edit 7.108) Content-Type: text/plain; charset=US-ASCII X-Newsreader: Gnus v5.5/XEmacs 20.3 - "Vatican City" Xref: news.cs.au.dk comp.lang.beta:11783 [Note followup redirection.] Jean-Louis Leroy writes: > Java, OTOH, is a near-total failure in that respect. The language includes > fixed-size typesafe arrays, but doesn't have typesafe extensible arrays. > You can't make them yourself either. As a result, you put an Apple in the > basket, and you retrieve an Object...which you are forced to cast first > thing. In some respects Java marries the disadvantages of C++-style strong > static typing with the disadvantages of Smalltalk-style typelessness. Sorry that this thread is moving so far off Beta, but this comment only applies to raw Java. There are numerous, upwardly-compatible extensions to Java that are working around this problem. They compile to standard JVM code, so you can use them without losing the benefits of distribution and so on. Two that are implemented and freely available are Pizza and GJ. Pizza is at http://www.cs.bell-labs.com/who/wadler/pizza/ and there's a link to GJ from there. I simply can't imagine a Beta programmer wanting to shift to C++. While templates have some benefits, they are far from the last word in type parameterizations (which is one reason why Java left them out -- to explore the problem through research rather than diktat), and the rest of the language is sufficiently awful to negate these benefits. Java at least has some of the benefits of Beta, such as a safe implementation, garbage collection and portability. Losing all three for the sake of templates? I don't intend to start a language war here, so if you want to argue with me, please direct it to personal email. I'm just trying to say that if you find templates seductive, give Java's extensions a chance before you plump for C++. If you can stick to Beta, though, so much the better. In some ways I find it a much nicer language than both. 'shriram