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

Content deleted Content added
Line 415:
:::::: I think you are under a misconception. Even Microsoft, when comparing how C# and Java do with event handling, do not consider java events as second class citizens[http://msdn.microsoft.com/en-us/library/ms228499%28VS.90%29.aspx]. I don't think that you will find a lot of reliable sources explaining that events are second class citizens in Java. However, if you can find those, I'm OK with that. This is not about how we feel it shluld be, for you and of course also for me. [[User:Hervegirod|Hervegirod]] ([[User talk:Hervegirod|talk]]) 23:44, 7 December 2010 (UTC)
:::::::Could you please try and read my statement again, Hervegirod? You were the one who brought in AWT. My above statement was against including AWT in this article. Note how my statement doesn't say anything about including Java event handling (it is after all not in AWT but in java.util), only about presenting it as a ''language feature''. In C#, event definition and handling is clearly a language feature: The compiler will implement event subscription (adding/removing and combining multicast delegates) for you when you use the ''event'' keyword. C# does so at the language level without assuming anything else about events (like signatures, interfaces etc). C# developers can build upon this ''direct language support'' to build a specific event model. Building a specific event model involves deciding how/if event arguments are specified, how/if the source is identified, deciding if the subscribers and/or publishers must implement specific interfaces or derive from specific base classes etc. The BCL developers did this in System.* where you'll find the ''EventArgs'' class. Note how this latter part is analogous to java.util.* where you find the ''EventListener'' interface, ''EventObject'' class (akin to .NET ''EventArgs''). Because both languages are object oriented then of course the observer/observable pattern ''can'' be implemented. This does not make it a language feature, though. One language (C#) provides standard infrastructure for building any number of event models, all of which will benefit from the language feature - i.e. they will not need to build multicast containers. ''One'' such model is found in the System.* namespace. In Java you lack this infrastructure. You can still build ''any number'' of event models, but ''all'' of them will need to implement multicast containers (subscription lists) specifically for '''each event''' exposed by an object. The implementation in java.util (used by AWT) does not solve this, you still need to build event listener collections for all events exposed by all objects. This is a significant and interesting difference between the languages and certainly noteworthy in a comparison article. Now, whether the comparison table should be green or red depends on how much of the BCL we consider ok for inclusion in this article. If this is just the languages (the syntax and the semantics) then Java has a "no; but the BCL offer specific implementation". If we consider the "core" parts of the BCLs ok for inclusion then Java has a "yes; library feature" and C# has a "yes; language feature". The differences I outlines above can then be explained in the associated prosa. [[User:Useerup|Useerup]] ([[User talk:Useerup|talk]]) 07:48, 8 December 2010 (UTC)
 
== Proposal for Deletion ==
 
I believe this article should be removed.
 
First, I believe it is meaningless to try to compare the languages separately from the run-time libraries. Indeed, the article does not, and makes arbitrary choices about whether to include or exclude library features. Both languages are fundamentally useless without at least some library, and are designed to work with library support.
 
Second, the cited sources are either opinion, or relate only to one language or the other. As such, I believe this article is a synthesis of published material, and therefore contravenes the policy on [[Wikipedia:No original research|original research]].
 
[[User:Spockwithabeard|Spockwithabeard]] ([[User talk:Spockwithabeard|talk]]) 14:39, 19 February 2011 (UTC)