Java vs. C#

[quote]Reading through C# libraries seems quite hard as well, as everything is done in unique ways.
Also, I find myself writing worse code in C#. My choices seems to be based on how short I can write things, rather than readability.
[/quote]
This is essentially my experience so far, as well.

[quote]I don’t like Java that much but I do like Eclipse. Good IDE can raise my productivity by big margin and that is all what matters.
[/quote]
There are plugins that let you work with other languages, you know.

This is exactly the thing wrong with C#, they took Java and tried to throw in all kinds of features.
Now that C# is going down, they want to do the same with features for Java because, wait for it … C# has them as well. /facepalm

Now besides that, people should take the tool best suited for their needs. If you need gui stuff, take what works best.
It makes no sense to take Java for a GUI just because your server code is based on Java! Same vice versa.

I would buy that.

Kinda agree.

Except that you do have to pay money for it.

Windows on your desktop, Windows on your server, Visual Studio, ReSharper…

Want to use more cores or more RAM? Gotta pay some more.

Another server? Pay again.

End users who already bought Windows don’t need to pay extra to run C# programs of course. That’s vendor lock-in magic.

Mostly the same. You can jump in and out of each with a minimum of fuss. It really all depends on where you’re trying to deploy. But C# being developed by a company that has its own console and actively pushes games is a big thing for us game devs. XNA and the like only get more mature, whereas Oracle/Sun have been shying away from games for years and years. It is only through the heroic efforts of individual people developing open source libraries (LWJGL, JOGL, jME) that Java can even compete.

But they’re pretty much the same at this point, for all purposes 99% of the people on this forum will care about.

Have you seen XNA recently? MS screwed it over because they decided that XNA would be the preferred platform for writing Windows Mobile apps. That means it suddenly lost a bunch of functionality because of it’s lowest-common-denominator approach.

Combine that with it’s ridiculous straight-jacketed resource pipeline that couples with Visual Studio in all the wrong ways, so you end up having to use the regular file io operations to write something sane to use instead. Which then means you can’t run on 360 or Windows Mobile, and you’ve forfeited one of the main reasons for using it in the first place.

Not to say it’s still not usable, but it’s not shiny happy wonderful gamedev land over there either.

I haven’t seen it lately, no. That’s lame to hear. I knew it was basically just a bunch of frameworks for making games, not some magic happy place, but still…

Oh, and I forgot the final kick in the teeth - MS don’t support old versions of XNA and don’t want you using them, so the SDK installs auto-destruct after certain dates to force you into using the latest and greatest. So you can’t even install the pre-windows-mobile version of XNA because it doesn’t work any more. :o

This is not widely publicised.

Why? C# is slower, .NET is less cross-platform, why would we consider it is technically superior? The languages which have the most features are not necessarily the best languages in my humble opinion. Look at C++, it has become too complicated, who really knows how to use all kind of pointers? How is able to read any C++ code?

These arguments against the “complexity” of language features were made long and loud about:

[] Type systems
[
] Garbage collection
[*] Objects

Well, it’s like there is a sweet spot in language complexity, expressiveness, and unknown magic going on behind the scenes, and Java has occupied it quite successfully since around JDK 1.4. Generics were a bit of a mixed blessing as it’s now possible to write code that nobody can figure out but it also has a few nice uses. Annotations were handy.

One thing I see in this thread here about C# is that it’s “Windows only”. It’s not at all Windows only. Mono has more or less ensured C#, “the language”, is everywhere where Java isn’t. .net, on the other hand, is Windows only. Not only that but Microsoft are seemingly deprecating .net in favour of WinRT and Javascript/HTML5 anyway. I predict C# to end up like Visual Basic in the next 10 years. Java however is likely to remain as strong as it ever was through the sheer amount of heavy systems now built on it. But ${deity} help us if we’re forced to use Javascript everywhere to do client programming.

Cas :slight_smile:

Word!

This is currently my job.

The client is in:
javascript

The server is in:
javascript

All data is in:
JSON
:emo:

I’m fine with JS (I actually do enjoy it a lot), but it doesn’t appear to be suitable for larger applications. I wouldn’t want to write anything with 10 KLOCs or more, but - to be fair - it’s very expressive. You can get a lot done with 10 KLOCs.

What gets me about Javascript is this. It’s like one day a small hegemony of browser vendors suddenly decided the entire internet was going to speak in French. You either speak French, or you’re out of a job. Now, I have nothing against French at all, and I can even speak French to an extent, but the fact is, my native language is English and I’m about 100x better at it. I don’t want to have to speak French. We didn’t vote to speak French. But where is the opportunity to protest? How can I say, “No! This will not do?” when the hegemony is not listening?

And now, insiduously, Javascript is finding its way into many bizarre locations like serverside programming*. The same bloody language everywhere. There was a time we could choose what language we wanted to use to tell computers what to do. There were a whole plethora of choices, from machine code and assembler through BASIC, C, C++, Java, C#, Pascal, Oberon, Modula, Prolog, Lisp, Scala, Python, Ruby… and then suddenly, no, the only thing that is supported on the client will be Javascript.

It is suddenly very apparent why the whole compilation phase was so important to everyone. We want to write in the language we want and then deploy binaries which we don’t have to look at.

Cas :slight_smile:

  • I wonder how long before Javascript attempts to replace SQL? Hehe.

Javascript being the only language has its advantages. Huge companies are throwing massive amounts of resources at it to make it fast. It’s gaining on Java fast. In a decade it might be where Java is now.

I realize I ignore the language-design here, but once you have a super fast JsVM, you can start running interpreters / transcoders on it, with great performance.

I specifically limited my comment to design and not implemenations to avoid very subjective comparisons. It’s superior IMHO because it contains a wealth of commonly needed features which are difficult to impossible to perform in Java. It also makes more nods to the requirements of a back-end than the java does. I’m sure that there are plenty of feature comparisons available so I’m not going to bother making a list. Thinking though the feature set of C#, the main thing “I think” that some java programmers might hate are some of the sugar related features like operator overloading (including get/set).

I would go a step further and say that they usually suck.

I strongly dislike C++. But its problem isn’t the features that it provides, but the syntax by which it provides them.

@princec - what? No love for Forth and Smalltalk…shame on you.

true, but it would been nicer if the focus was on some sort of web bytecode instead, thus allowing any languages to be compiled down to it more efficiently. The fear that it would make the web closed (ala unreadable like compiled code) is pretty much irrelevant now since obfuscated javascript is widespread anyway.

@Roquen - whoops :slight_smile: Plus a whole load of other languages like Fortran, Algol, PL/1, ADA, COBOL, and so on. Kappa has it right: a universal bytecode is what the browsers should have been supporting all along, and JS should have been compiled into that on the fly and then executed. LLVM looks like it might be the panacea we are looking for as Java bytecode has so massively failed to win the hearts and minds of everyone thanks to Sun/Oracle mismanagement. Google lead the charge with PNaCl. I really do have overoptimistically high hopes for PNaCl. If it would just completely replace Javascript we’d all be winners.

Cas :slight_smile:

Personally I’d rather see some high level language description (like an abstract sytax tree, or similar) as the transport mechanism which is lowered into LLVM (or similar) at compile time. SO many more things you can do (plus it’s smaller).