Java vs C#

Started by
17 comments, last by jpetrie 14 years, 8 months ago
If you are going into school, i suggest picking up c#. If you're looking for a job, want to start learning, i suggest java. Ive seen jobs for both C#/asp.net and Java/various web frameworks. But there are much more for java currently. However, as C# progresses, I think it will increase on use, hence why if you're starting up an academic career, perhaps you should pick up on some.
Advertisement
Java and C# are very similar, and knowing one makes picking up the other very easy. My school teaches almost everything in Java, and I decided to pick up C# on my own a couple of months ago. Even though they are really similar, they feel different. I can't explain it, but for some reason using Java is like chewing on broken glass for me, but I really love using C#. No idea why.
Quote:Original post by magic-mouse
Noone caresI don't about linux or mac.

Fixed that for you.

We had this career day or whatever at school few months ago. There were several (~10) IT companies there, and I think all of them were looking for C#/.NET developers while I'm not sure there was even one looking for Java developers. Some of them was also looking for C/C++ devs.

I'm not sure when I last heard of a new project being started in Java, while I see C# or other .NET based projects start every day.

Java is multiplatform, but I'm not sure how much that actually matters. Most apps are intended to run on a single platform anyway, except possibly GUI apps. I'm not sure I can name a single GUI app written in Java (or in C#), most of them seems to be written in C/C++ with multiplatform GUI libraries such as GTK or WxWidgets.. Should you still require a multiplatform app, then I guess Java wins, at least for now. Novell and the Mono team are working hard on multiplatform C#/.NET implementations though.

Java can be used on cellphones. C# can be used to program Windows mobile based devices (truly wonderful to code for btw) but let's face it, just about noone has a windows mobile so Java wins bigtime in that field.

For the web.. Well, there are indeed some Java based web services of which I can name none, but if you're looking for work in this area, you should probably go for ASP.NET (C#) or PHP.

The game development companies I've spoken to looked for C/C++/ASM coders for their games and C# for tools. One of them also named Lua and Python for game logic. When it comes to hobby or indie development, C# has XNA. Java does not seem to be very big at all in the gamedev world, but I know of projects using it.

When it comes to existing stuff and libraries.. .. Well, Java has been around longer, so I'm guessing it has more of these things, but at the same time, what is available for C# is more than enough. I'm not really sure about Java, but C#/.NET has great tools for porting existing code bases, writing libraries in all sorts of languages and writing .NET bindings to existing code (think C++/CLI).

My impression from what little I know is that Sun, or nowadays Oracle, is trying to push Java for cellphones and those really heavy enterprise web and intranet solutions. When I comes to C#, it seems Microsoft is trying to push it (and .NET) just about everywhere, except for cellphones.

Those are my views and opinions. In case I wasn't clear about it, I'm a C#/.NET fanboy.
I don't see a single good answer in this topic yet, so I'll give you one.

C# is very similar to Java because Microsoft designed it in an attempt to replace Java. Which would probably explain any lawsuits and etc. involving the two.
It is Microsoft's attempt at patenting something that was already created. (YES, that is one reason why a lot of people hate them!)
(Not only that, but they made more than one attempt at it! i.e. J# and Visual J++!)

However, the factors that make up the basics of the two languages are completely different.

Because C# is a proprietary language developed by Microsoft, they of course wanted everything involving C# to also use Windows and Visual Studio to produce it.
In that sense, on the Windows platform C# becomes a lot more flexible and powerful.

HOWEVER.

Java has two strengths that could not be taken advantage of by Microsoft.
1. Java can be ported to ANY computer, no matter what OS, hardware, etc. This includes portable devices such as cellphones & smartphones, and also computers much bigger than the average PC, like servers and mainframes and even supercomputers.
It can literally be run on anything, because Java code is compiled on the spot by the computer running it, by using Sun Microsystem's "Java Virtual Machine".

In short, Java is a cross-platform environment.

2. Java is also now an open-source and highly-documented language to use.


ANYWAYS -
Both are versatile languages fit for their specific purposes.
C# being made for Windows systems and has a few benefits over Java, such as not having to run a Virtual Machine to run code.

Java having portability over almost every single type of computer.

Both are still being used today, in a wide variety of applications and there is no foreseeable end to either one.

But which one will probably last longer?
Well if you ask me - Java will certainly last longer.

But again, there is no site of an end to either one.
It is all about languages and what you want to do with it.
Quote:Original post by CosmicSpore
I don't see a single good answer in this topic yet, so I'll give you one.

There may not yet have been a good answer, but yours certainly is not one either.

Quote:C# is very similar to Java because Microsoft designed it in an attempt to replace Java. Which would probably explain any lawsuits and etc. involving the two.
It is Microsoft's attempt at patenting something that was already created. (YES, that is one reason why a lot of people hate them!)
(Not only that, but they made more than one attempt at it! i.e. J# and Visual J++!)

Visual J++ was at one time Microsoft's implementation of Java. Sun sued Microsoft because it did not fully implement the language specification, and after an agreement was reached Microsoft was not allowed to continue development of the language beyond the standard Java specification. This is essentially when they started on their own competitor (C# and .NET) which would draw language features not only from Java, but also heavily from C++, Delphi/Pascal, and a few others.

Quote:Because C# is a proprietary language developed by Microsoft, they of course wanted everything involving C# to also use Windows and Visual Studio to produce it.
In that sense, on the Windows platform C# becomes a lot more flexible and powerful.

C# is not a proprietary language. The C# Language Specification is an ECMA standard and can be viewed online and implemented by anyone. In fact, somewhat ironically, the Java standard was not quite so open, and had to be licensed from Sun for a long time (I believe they have since opened up that restriction, although my history on this subject isn't so good). As well, the C++ standard requires money to view.

Quote:Java has two strengths that could not be taken advantage of by Microsoft.
1. Java can be ported to ANY computer, no matter what OS, hardware, etc. This includes portable devices such as cellphones & smartphones, and also computers much bigger than the average PC, like servers and mainframes and even supercomputers.
It can literally be run on anything, because Java code is compiled on the spot by the computer running it, by using Sun Microsystem's "Java Virtual Machine".

There's no reason why C# can not also be ported to *any* computer, and in fact runs on a very wide variety of platforms, from Windows to Mac, Linux, mobile devices through the compact framework, the Xbox360, Zune, and even the Wii and the iPhone. Josh Petrie, a member of these forums, is even working on a CLR for the Sony PSP.

Quote:2. Java is also now an open-source and highly-documented language to use.

C# is also highly-documented, and you can even get the source code for the .NET framework.

Quote:Both are versatile languages fit for their specific purposes.
C# being made for Windows systems and has a few benefits over Java, such as not having to run a Virtual Machine to run code.

I think you are confused as to the meaning of 'virtual machine'. Both C# and Java run using a JIT compiler these days (for performance reasons), so the distinction isn't very relevant.

In essence, almost all of your points have been subjective, or factually incorrect. Posting such misinformation here on the For Beginners forum is a very bad thing to do, because you can mislead a beginner who is unable to distinguish the good information from the bad. This is why these sorts of topics are discouraged, since they rarely provide sound advice or guidance, and very often contain factual inaccuracies that can lead those who are new to programming astray.
Mike Popoloski | Journal | SlimDX
Quote:
It is Microsoft's attempt at patenting something that was already created. (YES, that is one reason why a lot of people hate them!)

The language isn't patented; I am aware of no attempts to patent the related patentable things either. In any case, I think it's foolish to assume -- in this day and age, that somebody patenting anything makes them "evil." Look rather at what they do with the patent -- with the glut of companies that exist only to patent things and try to make money collecting on those patents, other more morally grounded companies need to start patenting things purely as a defensive measure.

Quote:
1. Java can be ported to ANY computer, no matter what OS, hardware, etc. This includes portable devices such as cellphones & smartphones, and also computers much bigger than the average PC, like servers and mainframes and even supercomputers.

This is true of any language for which some kind of standardization, even a de-facto one, is available.

Quote:
As well, the C++ standard requires money to view.

You can, however, find drafts online... and for most people's needs those are pretty good.

Quote:
Josh Petrie, a member of these forums, is even working on a CLR for the Sony PSP.

And it does Hello World like crazy awesome.

Quote:
In essence, almost all of your points have been subjective, or factually incorrect. Posting such misinformation here on the For Beginners forum is a very bad thing to do, because you can mislead a beginner who is unable to distinguish the good information from the bad. This is why these sorts of topics are discouraged, since they rarely provide sound advice or guidance, and very often contain factual inaccuracies that can lead those who are new to programming astray.

Agreed. This thread is dangerously close to being completely useless, so let's all be very careful about what we post, hm? Think long and hard before you hit the button. Misinformation, derailing, and FUD makes my moderation trigger finger twitch.
Mike.Popoloski, what I said is correct.
Some of what you added is merely technicalities that I didn't really have time or the patience to get to.
I can't sit here typing away all day. No one can.

Sure you can port C# to a lot of things, but not as easily, quickly, or efficiently as java can.
C# requires 'work' on most platforms to "port", Java doesn't.
Albeit, C# is more portable than many other languages.

But, that is the key point of Java being a useful language and why it is so widely used.
To merely say that C# can do the same thing is underrating all benefits of all languages.

AND I don't worry about the past of Java - currently it IS open source... all but a few sections of code that were licensed by Sun Microsystems for the Java environment.
Open Source software is highly more documented and useful than proprietary.
Again, to merely suggest that C# has those capabilities is underrating all open-source software...

Also, you say that C# is not proprietary... but it is.
Microsoft holds many patents for the C# language. You can't argue that at all.
It is fact.

Also, again, you do not seem to understand what a virtual machine is. Yet you seem to think I'm the one that doesn't.

FYI - The Java Virtual machine must be run on ANY computer to use compiled Java code. The virtual machine is a binary instruction set that reads the compiled Java byte-code and interprets it to the machine in it's native environment... which is what makes Java so portable.

Sorry to upset you, but that's just how things are.

I was only giving perspective to what the two languages do, how they came to be, in order to backup my belief of which one will last longer, and to answer the original post.

But for future reference, if you think someone's wrong... please backup your statements with a little evidence, rather than just simply saying "you're wrong" about things.
Quote:
But for future reference, if you think someone's wrong... please backup your statements with a little evidence, rather than just simply saying "you're wrong" about things.

You mean like you just did with all those links supporting statements concerning the plethora of C# patents and how much harder it is to "port C#" versus Java?

We're done here.

This topic is closed to new replies.

Advertisement