Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.pionier.net.pl!news.dialog.net.pl!not-for-mail From: Arivald Newsgroups: comp.lang.java.programmer Subject: Re: Autoboxing and Performance ? Date: Thu, 22 Aug 2013 07:39:48 +0200 Organization: Dialog Net Lines: 34 Message-ID: References: <52154765$0$301$14726298@news.sunsite.dk> NNTP-Posting-Host: dynamic-78-8-15-131.ssp.dialog.net.pl Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.dialog.net.pl 1377150163 14154 78.8.15.131 (22 Aug 2013 05:42:43 GMT) X-Complaints-To: abuse@dialog.net.pl NNTP-Posting-Date: Thu, 22 Aug 2013 05:42:43 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Thunderbird/23.0 In-Reply-To: <52154765$0$301$14726298@news.sunsite.dk> Xref: csiph.com comp.lang.java.programmer:25103 W dniu 2013-08-22 01:04, Arne Vajhøj pisze: > On 8/21/2013 5:09 AM, lipska the kat wrote: >> On 20/08/13 11:15, Peter Olcott wrote: >> I think a better question might be "why have primitives in the first >> place' >> >> When everything else is an Object does it really encourage clarity of >> thought and cohesion of design to pollute the Object Oriented paradigm >> with primitives. >> >> If there were no primitives then autoboxing would be a non-issue > > We have boxing and unboxing due to the split in reference > types and value types. > > In C# an int is an object, but they still have ref and val types and > therefore boxing and unboxing. > Still, for me distinguishing reference and value types seems to be artificial. I learn OO in C++, where any type (both primitive and objects) can be passed both by reference or by value, depending on current needs. So for me all this boxing and val/ref types seems to be nuisance. Yes, I learn that objects in many languages are reference only... But still I find it inconvenient sometimes. -- Arivald