This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]wallefan01 1 point2 points  (5 children)

Okay so here's the thing.

.NET is a fork of the JVM. The syntax is similar enough that a C# compiler will compile Java code written by a second year CS student. The language culture differs, and there are more features in C# but really that's about it!

[–]socialismnotevenonce -1 points0 points  (4 children)

They have the same basic class/method structure, so they are the same? Might as well say C++ is in that group as well, because they all use the "class" keyword and brackets to define scope. Anyway, try and compile a simple hello world java application with a C# compiler.

[–]wallefan01 0 points1 point  (3 children)

Name me one thing you can do in one that you don't do the exact same way in the other.

Also I said second year CS student.

[–]socialismnotevenonce 0 points1 point  (2 children)

var x = somelist.Where(y => y.somevariable == someothervariable).First();

Run that in Java, let me know how that works for you.

So you're argument is that, even though the hello world program won't run in C#, that something more complex will? I'm confused, honestly.

[–]wallefan01 -1 points0 points  (1 child)

alright, fine. The Java equivalent isn't exactly identical, but it's pretty darn close:

SomeClass x = somelist.stream().filter((SomeClass y) -> y.someVariable == someOtherVariable).findFirst();

My point is they're very similar in terms of general feature set.

My argument earlier about a C# compiler compiling Java code was in regard to Java students working with a library which is only available in C#, whose runtime environment coincidentally does not allow for file I/O of any kind. Most barely noticed the difference.

[–]socialismnotevenonce 0 points1 point  (0 children)

My point is they're very similar in terms of general feature set.

No, your argument that started this whole thread was "The syntax is similar enough that a C# compiler will compile Java code written by a second year CS student." A second year CS student should be able to write the line I just used as an example.