Talk:Comparison of C Sharp and Java: Difference between revisions

Content deleted Content added
Paercebal (talk | contribs)
Value types: answer.
SineBot (talk | contribs)
m Signing comment by Paercebal - "Value types: answer."
Line 163:
:Response: Value types are not a language feature,end of story, your wrong , give it up. Nobody outside Redmond and MS Fanboys cares about value types. They are not defined in any computer science literature, they are an invented type by MS. Not once in programming in C/C++/python/ruby/java/ADA/perl have I ever heard someone say 'geez wiz I wish I had value types'. You really need to stop arguing with everyone on this page. You keep reverting peoples changes, pretty much disagreeing with everyone where they are saying there is bias. How are we suppose to get rid of bias if you are allowing any real changes? <small><span class="autosigned">—Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[User:Bongey|Bongey]] ([[User talk:Bongey|talk]] • [[Special:Contributions/Bongey|contribs]]) 14:46, 26 October 2010 (UTC)</span></small><!-- Template:Unsigned --> <!--Autosigned by SineBot-->
 
::"Value types" is a kind of language feature.<br /><br />In Java, they are called primitives.<br />In C++, the difference can be summed as "Do I own the object directly, or through a (smart of not) pointer?". The difference is very important, as in C++, the last thing you want is to allocate everything through a new, if only because of performance reasons. But I should not have to explain you this, as you claim extensive experience in C++.<br /><br />Anyway, this is exactly the reason why in Java primitives are not objects (I was told they tried having all primitives being true objects at first, but turned back because of performance).<br />In C#, they made Value Types derived from Object, but still made them "primitives" as understood by Java.<br /><br />So Value Types are, as primitives, a language feature.<br /><br />Fact is, Value Types as understood by C# are a first-class citizen of C#, when their equivalent (primitives) are not in Java:<br />C# handles boxing/unboxing when needed, and does not impose boxing/unboxing when it is not needed, for example.<br />Java is unable to handle primitives correctly without always boxing them first (for example, in generics).<br /><br />Thus, the difference in handling Value types/primitives by the two languages is very important, and should be explicit in the current article. <small><span class="autosigned">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[User:Paercebal|Paercebal]] ([[User talk:Paercebal|talk]] • [[Special:Contributions/Paercebal|contribs]]) 12:59, 23 April 2011 (UTC)</span></small><!-- Template:Unsigned --> <!--Autosigned by SineBot-->
 
== Decimal types ==