Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Robert Klemme Newsgroups: comp.lang.java.programmer Subject: Re: Single Class Object Model - new release Date: Tue, 12 Jun 2012 23:33:11 +0200 Lines: 47 Message-ID: References: <9562a637-4191-42c2-a4b2-a2db589cd820@googlegroups.com> <787f166d-488f-49fe-aa1f-bd8e227ed30e@eh4g2000vbb.googlegroups.com> <169b14d7-e43d-482d-a195-bcd20965331a@d17g2000vbv.googlegroups.com> <0527b567-b7b6-4f79-b675-08993ba77b88@x21g2000vbc.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net mPj1IFdXmBLpXcz5JY6liwwnEuWk3nuzZQ97dvSo0kZi3/o1KQGA0OcJEmNuCdy+c= Cancel-Lock: sha1:lDykj97pOzr4W6Neitudkw+snGA= User-Agent: Mozilla/5.0 (Windows NT 6.0; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 In-Reply-To: <0527b567-b7b6-4f79-b675-08993ba77b88@x21g2000vbc.googlegroups.com> Xref: csiph.com comp.lang.java.programmer:15230 On 12.06.2012 22:03, micha wrote: > Yes it's inconsistent: > - because [] and ArrayList/Collections are 2 different ways to handle > vectors/lists (while there is only 1 in Python/Lisp/Perl The term is not "inconsistency" but "variety": different situations require different list like structures for efficient handling. You make it sound like having only one data structure for an abstract concept would be a value in itself. That might be true in mathematics but not in a software developer's real life(TM) because even though some requirements are identical (ordered storage) many others might not (e.g. varying size vs. fixed size). > - because int is a primitive type (like in procedural languages) > while Integer are Objects (the bypass to put integers in a Collection > in fact) Oh, Integer can serve other purposes as well: by having an object reference you can encode more information, namely "value absent" and "specific int value X". The argument that Java is somehow deficient because it mixes primitive types with object types is not new. The fact has some drawbacks (some of which were fixed with autoboxing) but it also has advantages. > instead all entities in Scala/Smalltalk are Objects (even > functions), and scripting language (Python/Perl/PHP/Lisp) provide lazy > typing and are thus > more consistent (even if at the price of more risk to write > erroneous code which language laziness will let go through) I don't see an increased risk here. Strong typing prevents misuse. And the term used for Ruby & Co. is "dynamic typing" not "lazy typing", while also these languages have strong typing (i.e. every object has a specific type all the time). It's just that variables and expressions do not have a type which can be statically determined. I would not call these languages more consistent. It's just a different concept and mindset - dynamic vs. static typing. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/