Content deleted Content added
No edit summary |
m Tule-hog moved page Talk:Boxing (computer science) to Talk:Boxing (computer programming): per old consensus |
||
(33 intermediate revisions by 18 users not shown) | |||
Line 1:
{{WikiProject banner shell|class=Start|
{{WikiProject Computing|importance=Low|science=yes|science-importance=Mid|software=yes|software-importance=Mid}}
{{WikiProject Java|auto=inherit|importance=low}}
}}
==Comments==
<pre>
int i = 9;
Line 9 ⟶ 15:
Isn't it all about 'object types' living [[Garbage collection (computer science)|garbage
I think that the part about unboxing mostly speaks about what code constructs different versions of the java compiler/language accepts, and not about the language neutral concept of boxing/unboxing. I think that part should be removed, or at least some of it. (Sorry, no wikipedia account. LarsR) 10:10, 8 Aug 2007 (CET)
Made it a little more generic, and precised that since .Net, not all value types are primitive types.[[User:Medinoc|Medinoc]] ([[User talk:Medinoc|talk]]) 11:10, 8 October 2008 (UTC)
== [[Haskell (programming language)|Haskell]] unboxing ==
[[Unboxing]] redirects here, but this is about how objects work in Java. It doesn't seem to be a suitable place to put something about unboxed types in Haskell, although there is similarity in the underlying concepts. In Haskell everything by default is 'boxed', and a boxed thing could be either the thing itself or some unevaluated expression that could evaluate to something of the correct type (because Haskell is lazy). [[User:Furby100|Furby100]] ([[User talk:Furby100|talk]]) 21:15, 12 January 2008 (UTC)
[[User:Drepnir|Drepnir]] ([[User talk:Drepnir|talk]]) 23:08, 26 November 2008 (UTC)
Found something wrong:
<blockquote>
Another example:<br />
<br />
int i = 4;<br />
int j = 5;<br />
Integer k = new Integer(i + j); // always OK<br />
Integer l = i + j; // would have been an error, but okay now - equivalent to previous line<br />
<br />
<br />
C# does not support automatic unboxing. A boxed object must be explicitly unboxed with a typecasting operator:<br />
<br />
int i = 42;<br />
object o = i; //box<br />
int j = (int)o; //unbox<br />
Console.Writeline(j); //outputs 42<br />
</blockquote>
It is assumed that the following will compile on Java, but it won't. C# does support automatic unboxing of primitives, but not objects, just like Java.<br />
<br />
int i = 42;<br />
Object o = i; //box<br />
int j = o; //unbox<br />
System.out.println(j); //outputs "42"<br />
<br />
Will not compile because it can't unbox objects of type Object.
== Def, scope, mess ==
This article is about boxing, unboxing and autoboxing. The definition of "object type" given here is dubiously narrow. See [[object type]]. I think this article should be moved to [[Boxing, unboxing and autoboxing]]. Compare with [[Covariance and contravariance (computer science)]]... [[User:Pohta ce-am pohtit|Pcap]] [[User_talk:Pohta ce-am pohtit|<small>ping</small>]] 09:26, 26 August 2009 (UTC)
:Shouldn't the solution be to rewrite the article so to include more general discussion? Boxing is simply an example. The concept is more general. -- [[User:TakuyaMurata|Taku]] ([[User talk:TakuyaMurata|talk]]) 19:57, 26 August 2009 (UTC)
:: [[Object type]] should normally redirect to [[Object (computer science)]] where the notion should be defined in context. Except that article is a mess too because it tries to do [[Object-oriented programming]] [[WP:ADVOCACY|advocacy]] instead of focusing on the technical matters. The other reason I made that ridiculous dab is the uncited definition given in this article and the (IMO, unjustifiably general) name this article had.
:: Boxing/unboxing/autoboxing are issues in the [[:Category:Programming_language_implementation|implementation]] of [[object oriented programming language]]s. These aren't issues of how objects are implemented, but of how [[primitive types]] ''relate'' to objects; in some languages like Ruby (or Scala IIRC), all primitive types are objects.
:: So, I think the best solution is to rename this article to [[Boxing, unboxing and autoboxing]] and add a [[WP:SUMMARY]] of this at [[primitive types]] and at [[object (computer science)]]. [[User:Pohta ce-am pohtit|Pcap]] [[User_talk:Pohta ce-am pohtit|<small>ping</small>]] 07:01, 27 August 2009 (UTC)
::: After a little more thought, these are not just implementation issues, but design too. Whether you force the programmer to write boilerplate code for boxing/unboxing or decide to go for autoboxing is a language design issue as well. Still, this doesn't change the fact that this article is about the relation between primitive types and object types in OOP languages. [[User:Pohta ce-am pohtit|Pcap]] [[User_talk:Pohta ce-am pohtit|<small>ping</small>]] 07:11, 27 August 2009 (UTC)
I agree that ''currently'' the content of the article is inconsistent with the title. So, the simplest solution, I guess, is to rename it. But I'm afraid the name [[Boxing, unboxing and autoboxing]] may narrow the scope of the article too much. The article starts with saying that an object type is a datatype, and so it should be about a general concept, mentioning boxing of a primitive data type as one example, not as a primary subject. The lack of a precise definition is not a good reason for not to have an article. For example, an [[interpreted language]] doesn't give a precise definition, but tries to cover context and give a lot of examples. In short, "Object type" may be too vague to be a good title. But "[[boxing, ...]]" doesn't seem a good one, either. It suggests a very concrete approach to primitive data types that are not objects. Maybe someone can propose a better title. -- [[User:TakuyaMurata|Taku]] ([[User talk:TakuyaMurata|talk]]) 11:57, 27 August 2009 (UTC)
: The first sentence in this article has little to do with the rest of it. [[User:Pohta ce-am pohtit|Pcap]] [[User_talk:Pohta ce-am pohtit|<small>ping</small>]] 12:51, 27 August 2009 (UTC)
::And that's the problem. All I'm saying is that, if possible, the article should be rewritten so that it isn't about one specific example. -- [[User:TakuyaMurata|Taku]] ([[User talk:TakuyaMurata|talk]]) 21:31, 27 August 2009 (UTC)
::: Look the first sentence is an unsourced definition. I'm undable to find a book that gives that def. How do you expect an article to be written based on that? We should salvage the rest of it, i.e. the notions of boxing, unboxing and autoboxing. "Not general enough" can mean a number of different things here, like being too Java-focused, but that's a different matter that can be addressed later. The title should describe the article's contents, not some ideal notion that ''you'' think we should have an article on, but for which there are no (obvious) sources. [[User:Pohta ce-am pohtit|Pcap]] [[User_talk:Pohta ce-am pohtit|<small>ping</small>]] 06:29, 28 August 2009 (UTC)
:The article doesn't need to have a concrete definition, unlike math articles, say. This is especially the case for computer science articles. Besides the one example I cited above, there are many more such examples. "The title should describe the article's contents". No, you got this all wrong. The article content must follow the title of the article; not the other way around. I also didn't propose the article materials to be deleted. That it is hard to definite isn't a good excuse for narrowing the scope of the article (that's basically the proposal your made) nor abandoning it at all. It's much harder to define, as a way of comparison, [[Object (computer science)]]. -- [[User:TakuyaMurata|Taku]] ([[User talk:TakuyaMurata|talk]]) 11:05, 28 August 2009 (UTC)
== Requested move 10 August 2022 ==
<div class="boilerplate" style="background-color: #efe; margin: 0; padding: 0 10px 0 10px; border: 1px dotted #aaa;"><!-- Template:RM top -->
:''The following is a closed discussion of a [[Wikipedia:Requested moves|requested move]]. <span style="color:red">'''Please do not modify it.'''</span> Subsequent comments should be made in a new section on the talk page. Editors desiring to contest the closing decision should consider a [[Wikipedia:move review|move review]] after discussing it on the closer's talk page. No further edits should be made to this discussion. ''
The result of the move request was: '''moved per request'''. [[User:Favonian|Favonian]] ([[User talk:Favonian|talk]]) 20:46, 17 August 2022 (UTC)
----
[[:Object type (object-oriented programming)]] → {{no redirect|Boxing (computer science)}} – The current title is just terrible, it is nowhere in the article and has no sources using the term. Looking at incoming links they are either from the data types template under "related topics", or to the sections boxing or autoboxing. Looking at [https://pageviews.wmcloud.org/redirectviews/?project=en.wikipedia.org&platform=all-access&agent=user&range=latest-20&sort=views&direction=1&view=list&page=Object%20type%20(object-oriented%20programming)] the redirect [[Boxing (computer science)]] gets 62 pageviews by itself compared to the this page's 250, out of a total 406. Boxing adequately describes the article; unboxing and autoboxing are derived terms so in the interest of concision do not need to be in the title. [[User:Mathnerd314159|Mathnerd314159]] ([[User talk:Mathnerd314159|talk]]) 21:02, 10 August 2022 (UTC)
*'''Support''', boxing is the established term. "Object type" refers to any type that can contain or refer to an object so it's a misleading term. [[User:JIP|<span style="color: #CC0000;">J</span><span style="color: #00CC00;">I</span><span style="color: #0000CC;">P</span>]] | [[User talk:JIP|Talk]] 08:28, 12 August 2022 (UTC)
*'''Support'''. This is a whack page title, and is quite... misleading? Incorrect? idk. [[User:SWinxy|SWinxy]] ([[User talk:SWinxy|talk]]) 21:38, 16 August 2022 (UTC)
<div style="padding-left: 1.6em; font-style: italic; border-top: 1px solid #a2a9b1; margin: 0.5em 0; padding-top: 0.5em">The discussion above is closed. <b style="color: #FF0000;">Please do not modify it.</b> Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.</div><!-- from [[Template:Archive bottom]] -->
</div><div style="clear:both;"></div>
|