Jump to content

Talk:Comparison of C Sharp and Java

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Svick (talk | contribs) at 18:40, 21 September 2013 (the peer review request was not completed; removing template). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
WikiProject iconJava Start‑class Low‑importance
WikiProject iconThis article is within the scope of WikiProject Java, a collaborative effort to improve the coverage of Java on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
StartThis article has been rated as Start-class on Wikipedia's content assessment scale.
LowThis article has been rated as Low-importance on the project's importance scale.

Platform Support

The table regarding platform support states "Yes" in the C# column for Linux, Mac OS X, and Android. We all know that Microsoft who created and continue to create the C# language have not officially made the .NET runtime work on any of those, but rather it is an open source project named "Mono". At present there is merely a reference to the Mono project page, but I propose actually specifying that it is a third-party implementation, thus not one offered by Microsoft. Hence, I propose that for those platforms it should state: "Yes, but third-party". I already made this change already, but it was reverted because it supposedly doesn't make sense since Java support is third-party. This is absurd. The Java referred to in the article and in Wikipedia in general is that distributed by Oracle, and for C# it is that which is distributed by Microsoft.

Can you please leave your favouritism towards C# alone and please just provide useful information for readers. I am sure it is in the interests of the readers to know that C# does not run on those operating systems without additional third-pary software. Kupraios (talk) 04:09, 26 November 2012 (UTC)[reply]

Is Java on Android supplied/supported by Oracle? No! Oracle actually sued over that. I am sure it is in the interests of the readers to know that Java does not run on that operating system without additional (and controversial) third-party (Google Dalvik) software. See how that argument can be used against Java as well?. I ask just that you use the same standard and don't use loaded phrases ("but" is a loaded word implying a reservation - your personal reservation, not a reservation that should be put forward in the voice of WP). Please also keep in mind that these are the programming languages and not the platforms (Java and .NET). The "platform support" section is already a stretch in that regard, but if it has to mean anything in an article about the programming languages it must be that you can use the language to code for the platform. That's why Android has a "yes". Just use the same standard for C#. If you believe that the way through which a platform is supported is important then put it in a note - like {{yes}}<ref>through Mono</ref> and {{yes}}<ref>through Dalvik</ref> - or something to that effect (with links). That way WP does not make judgement calls but allows the reader to come to his/her own conclusions. Useerup (talk) 11:57, 26 November 2012 (UTC)[reply]
Then change the column value for Android support on Java. I don't oppose doing so whatsoever, I just am not aware of Java support on Android. You seem to assume that I am pro-Java and am attempting to attack C#, but I actually prefer to use C# over Java, so your argument is unfounded. If the word "but" bothers you then "using" may be used, thus it may read: "Yes, using third-party software". You seem to be offended at the fact that these languages require third-party software to run on other platforms and are attempting to hide this fact, but this information is useful to the reader and is very relevant to the topic of platform support. Kupraios (talk) 17:39, 26 November 2012 (UTC)[reply]
WP:AGF. I reverted your edit and in the very summary I pointed out how it would be unbalanced to not use the same standard for Java. You were actually the one accusing me of favoritism towards C#, so let's not go there. And yes, I do have a problem with "but" because it is a value judgement. Some may even believe that it is a "good thing" that it's 3rd party support. Rather than saying "3rd party" why not just point out how in a ref? For the record, I do believe that the entire section is problematic because you can always find some way to use a programming language for a given platform through cross compilation. It is meaningless when comparing languages. It was put there by someone who mistook language for platform. I would prefer we just delete the section. Useerup (talk) 18:07, 26 November 2012 (UTC)[reply]
I tried to work in the specific references. Is that better? I have reservations about the in-the-box link. I'm not convinced that you can actually run Java on a non-jailbroken iOS device. in-the-box does not seem to be a cross compiler, but rather a VM. Apple does *not* allow VMs on iOS devices. Also, there's a blog post ref in there. Useerup (talk) 18:22, 26 November 2012 (UTC) In-the-box seems to be dead, is undocumented, there is no evidence that it can be used to create App Store compliant apps, and in any case it would not allow you to code to the iOS SDK, severely limiting its usefulness.[reply]
I'd argue to keep it in because although it is true that the programming language itself is separate to the platform with which it runs on, this information conforms to what people would expect to find in this article. We have to find a balance between political correctness and usefulness. People reading the article will infer that it is the native platform being referred to, otherwise they most likely don't understand the rest of the article. Also, what about running virtual machines on an OS? Should we take those into consideration too? I think not, it's best we just assume native support as a default. Otherwise the articles regarding software made to run on a specific OS could be argued as being able to run on all OSs even though that isn't exactly true.
The changes you've made are better in that it is clearer that there is no native support on those platforms, but I wouldn't put specifics (referring to Mono) the way you have. I would just refer to it as third-party and have a reference to Mono because otherwise it could suggest favouritism towards using Mono and not some other software that could exist (if it does). It suggests that Mono is an officially used platform for running C# rather than a community project. It's best to just be generic and have the reference be specific, hence: "Yes, using third-party software<ref>Mono</ref>". That way more references can be added in the future without disrupting the visual appeal of the table, and also it contains more information in a smaller space. Kupraios (talk) 21:12, 26 November 2012 (UTC)[reply]
As for Android, it is called Java but it is really not Java as defined in this article. A lot of Java base library is different on Android, or works differently, and Android has stalled to part of Java 6, meaning that all Java 7 evolutions of the language are not supported. Hervegirod (talk) 09:27, 20 December 2012 (UTC)[reply]

Speed/performance comparison

Microsoft bans benchmarking .NET Framework without their written permission: Microsoft .NET Framework Benchmark Testing Terms. And Mono is not the official .NET implementation to compare with Oracle Java. That's why adding speed/performance comparison to this article is not correct. So, based on above facts remove this section, please.69.18.50.2 (talk) 10:07, 2 December 2012 (UTC) cs_student[reply]

I still think performance would be an aspect readers would find relevant. I agree that the section as it stands now is misleading. We could remove it, but we could also try to work in the caveats you mention. Would you care to try? Useerup (talk) 11:29, 2 December 2012 (UTC)[reply]
The only implementation where its allowed to benchmark results for C# is Mono. Yet C# is shown supported on a variety of platforms in this article because of Mono. Plus the paragraph (at least now) shows clearly that the comparison is made with Mono. I don't know why it should be removed. Hervegirod (talk) 09:31, 20 December 2012 (UTC)[reply]
As I wrote, I absolutely believe the issue is relevant. There are some (very) old perf tests showing that .NET is faster than Java on Windows. They are dated and are probably not representative of the current state, and I'm not comfortable mentioning that in the paragraph. I would prefer that the article explain that there very well could be differences between the 1st party implementation and Mono but that there's no comparison data available because of the licensing terms. Useerup (talk) 12:11, 20 December 2012 (UTC)[reply]
A contractual ban on benchmark publishing seems like an antitrust violation that Microsoft could easily use to ensure that the only benchmarks that get published are ones that favor the .NET framework. That said, we have no reason to submit to their will. 68.173.113.106 (talk) 20:50, 21 July 2013 (UTC)[reply]

I updated this section to match the current link, Microsoft has changed their position on benchmarking should someone want to try to find references, seems they are mostly comparable from what I can tell.


5/24/2013: I removed this sectionEvolvedmicrobe (talk) 21:18, 24 May 2013 (UTC). Although I believe this is HIGHLY relevant to a comparison between the two and would love to see someone put it back in with a more thought out section. I thought it suffered from the following problems.[reply]

1 - The style and content of the opening paragraph was not up to par. This statement came off as pretty vacuous: "Comparing language speed is tricky. It depends on the virtual machine and the environment used. It can also depend on whether the benchmark code was written in an idiomatic or an optimised style."

2 - The benchmark tests given are not useful. Java and C# are such similar languages that it should have been possible to directly compare them by essentially writing the same program line for line. However the algorithms/code used in these benchmarks differs substantially (for example, encoding things as bytes versus unicode characters, writing multi-threaded versus single threaded applications, optimization switches, etc.). The largest difference between Mono/Java (Binary trees test) is entirely an artifact of mono being run with an outdated version of the garbage collector, and the more common microsoft implementation shows essentially no difference at all for that test.

I would love to see a more rigourous section developed here. This article: http://www.itu.dk/~sestoft/papers/numericperformance.pdf seems like it could be a good start, though it only focuses on numeric computations, and it seems comparing garbage collectors, native interopt, memory usage, etc. would all be important.

Unless the article can say something meaningful, well supported, and useful, I think this section should remain out. — Preceding unsigned comment added by Evolvedmicrobe (talkcontribs) 21:15, 24 May 2013 (UTC)[reply]

Addendum: Just noticed the article title says it is only comparing Microsoft to Oracle, I think we should expand that to Mono and IBM so we can add this performance section. — Preceding unsigned comment added by Evolvedmicrobe (talkcontribs) 21:44, 24 May 2013 (UTC)[reply]

Page Is Irrelevent

Is Wikipedia in the business of providing competing product comparisons?

These are two proprietary products produced by competing corporations. The features in both products are subject to change based on the owners goals and marketing decisions without public input. Thus many of the details are volitile and the article will quickly go stale. There are already inaccuracies on both sides of the comparison some due to the age of the article and others intended to skew the article.

The features comparison colors the yes and no values green and red respectively. This is an immediate value judgement on the included of featues. Due to this red/green coloring a minority of the tables of features have more red boxes on the C# side than the Java side. A simple glance at this bias reveals an immediate inference that C# is better than Java, despite many of the features that are not in Java are conscious design decision by Sun/Oracle.

It could be said that Microsoft has taken a kitchen sink approach to language design while Sun/Oracle has taken a more measured approach to feature inclusion. This is implied by the discussion about keyword growth in Java vs C#. So, as a common comparing any two languages in computer science, feature count and quality of features are not relevent to language utility, inferiority, or superiority. Thus the red/green coloring is misleading and at times innaccurate.

Finally, the code samples are also misleading. All the code samples as displayed have a greater line count for Java than the 'equivelent' C# implying Java is more verbose. In the article this is true for multiple reasons. The algorithms are different. In the Input/output section the Java example uses buffered IO while the C# sample does not. The Java implementation uses a superfluous File object constructor on both input and output which is not necessary (Constuctors for FileReader and FileWriter exist with a String argument for a file path like C#). Also to make the IO buffered in the C# example would need a call to a BufferedReader and BufferedWriter constructor to bring the number of constructor calls between the two samples equal.

Similarly, the "Pass by Reference" uses style to increase the line count Java sample. First: The swap method adds a line of whitespace after the temporary variable initialization. Second: A three line comment is added above the main method in the Java example. Third: the output line at the end of the main method is split into two lines in the Java example while being syntactically identical. Finally, even more damning the example is chosen to show the differences in C# and Java while casting the Java in a bad light because it "still" has not changed the value of s. Another equally simple example can be chosen where C# does not produce the results expected.

These are just two of the examples of how code that is contended to be "equal" is used to show disadvantages in Java. There are more.

This page should be scrapped and not rewriten for the reasons stated at the top. If not scrapped is should be rewritten to remove biases noted above.

One last note, I make my living writing C# code.

The views expressed in this article are solely the views of the author and not the owner of this IP address.

Seconded - this entire article is clearly VERY biased. EboMike (talk) 20:53, 2 March 2013 (UTC)[reply]
Thirded... While something like this could be useful (and it actually did answer a question I was looking up), it is in no way encyclopedic in nature. Something like this belongs on a tech advice site like stackoverflow, not wikipedia. Potatman (talk) 16:50, 15 March 2013 (UTC)[reply]

I found it very informative though, and filled with useful information — Preceding unsigned comment added by 132.183.102.105 (talk) 23:43, 12 March 2013 (UTC)[reply]

Sure, it may have information in it, but that doesn't change the fact that it is not suitable for Wikipedia in its current form. EboMike (talk) 02:04, 22 March 2013 (UTC)[reply]


Page is very useful - An encylopedia at best is a source of useful knowledge, this page contains a great deal of useful information. In response to arguments that this is irrelevant:

  • These are two proprietary products produced by competing corporations.

Ignoring how C# and Java are open standards, why would this matter? If there was an article on advertising strategies of Coca-Cola and Pepsi it would still be interesting and useful.

  • Many of the details are volitile (sic) and the article will quickly go stale.

That what we know changes is not a reason to never teach. What is the current status of hormone replacement therapy? How about dietary recommendations of sodium levels?

  • Other issues related to colors and verbosity

Someone cleaned these up "try {" in Java versus "try\n\t{" in C#. Variable usage of white space is irrelevant, the reader will know that, ditto with colors.

  • Bias

If informations is incorrect or presented in a poor fashion, it should be removed. This is an entirely separate issue.

  • Not Encyclopedic

Admittedly, Britannica probably would not have this article. Britannica is also not as good as wikipedia. This article is a compendium recommending a lot of good information. People need to get things done with computers, C/Java/Python/C++/C#/Haskell are all ways to get stuff done, how do they compare? Many people have found this article useful. — Preceding unsigned comment added by Evolvedmicrobe (talkcontribs) 21:42, 24 May 2013 (UTC)[reply]

Err... Java is an open standard. 68.173.113.106 (talk) 21:01, 21 July 2013 (UTC) (woops, sorry! I thought it was but the oracle google lawsuit made me wonder.[reply]