Jump to content

  • Log In with Google      Sign In   
  • Create Account


Java vs C#


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • This topic is locked This topic is locked
18 replies to this topic

#1 SoCow   Members   -  Reputation: 100

Like
0Likes
Like

Posted 05 August 2009 - 07:59 PM

I understand it's always difficult to choose between languages, I also understand one is probably better off learning more than one. C# and Java seem so similar- I'm studying them parallel to one another but, when it comes down to it which one will be around longer? Everything comes to an end. Java is older by a bit but, there seems to be far more support for it. C# is younger but, it has far less literature on the subject. What are the pros and cons of each language (Besides the obvious)? Why does Java have so much support and literature? Is C# just taking off? And what about Sun suing MS over Java? I couldn't fully grasp that.. Please enlighten me. And no convincing and converting- I'm gonna learn both regardless. This is simply to gain perspective.. I've already come so far with Java and will continue until I'm very fluent, the similarities make it easy to hop to C# whenever I want.

Sponsor:

#2 DpakoH   Members   -  Reputation: 902

Like
0Likes
Like

Posted 05 August 2009 - 08:45 PM

hi,
i am sure this is not the first post about java vs c#, please use the search functionality for this forum :) now, this being said, i want to state my own opinion, the only major difference for me between the languages is that java is multiplatform. so, i think the question is if you are looking for a job as a programmer, are java programmers more wanted or C# programmers.

one more thing from my own exp, Visual Studio is a better IDE than Eclipse, again it's my own opinion, dont spit on me , you java-gurus (:

have a nice day!

#3 demonkoryu   Members   -  Reputation: 976

Like
0Likes
Like

Posted 05 August 2009 - 09:01 PM

I haven't used neither C# nor Java at work (apart from a few quick C# utilities) but I'd say the current situation is as follows:

Java:
- mature cross-platform library support
- popular in the enterprise field due to many large-scale frameworks
- popular in the server field for various reasons (among these, because it runs on non-Windows nodes (no, Mono doesn't cut it))
- runs on many cellphones.

C#:
- great
- but only really on Windows
- I like it more than Java (partly because I got fed up with Java buzzword-complient bloatware frameworks).
- .NET apps feel more natural on the desktop than Java apps. Wouldn't think twice about using it in Windows-only environments.

Wikipedia:
C# vs. Java
.NET vs. Java

[Edited by - Konfusius on August 6, 2009 3:01:20 AM]

#4 cignox1   Members   -  Reputation: 723

Like
0Likes
Like

Posted 05 August 2009 - 09:39 PM

A few more personal opinions:
-C# (and the whole .Net API) is growning amazingly fast, while Java was kind of in a fronzen state untill c# came out.
-C# is usually used with .Net, wich is a powerful api. One of the best things about it is that it can be programmed against many languages seamlessy.

I think that C# and .Net are designed better than Java (of course, C# creators were able to learn pros and cons of Java choices).
There are also things where I prefer java:
-I never used Java in the last few jears, but I think I like Swing more than WinForm, from what I remember.
-It is supported by many (most?) enviroments. Mono is not bad, but in my experience it still has problems with .Net 2.0, and now is going to be released 4.0. So for a true multiplatform too I would most probably use Java.

Today I'm under the impression that .Net developers have more chances to find a job, so I suppose that if you know C# you know at least part of .net, then I bet that if you learn C# you have more job options :-)

Of course, those are my personal opinions...

#5 demonkoryu   Members   -  Reputation: 976

Like
0Likes
Like

Posted 05 August 2009 - 09:51 PM

Quote:
Original post by cignox1
Today I'm under the impression that .Net developers have more chances to find a job, so I suppose that if you know C# you know at least part of .net, then I bet that if you learn C# you have more job options :-)


It depends on the work field. I (personally) would favor .NET for homogenous Windows environments and Java get's the rest.

#6 Sc4Freak   Members   -  Reputation: 643

Like
0Likes
Like

Posted 05 August 2009 - 10:37 PM

If I were to argue for which is "better" according to each language's own merits and framework, I would prefer C#. .NET as a whole is a pleasure to use.

Java's strength comes from its ubiquity. There's a Java VM written for practically every platform under the sun, whereas .NET is fairly limited in where it can run.

#7 magic-mouse   Members   -  Reputation: 100

Like
0Likes
Like

Posted 06 August 2009 - 12:08 AM

As educated in both Java and C# i would like to say:
I rather drive a taxicap than working with java.
Enough said now you guys allready figured out that im a regular fanboy and it would require a great deal of bribe to make me change my mind.

Now to the reasons why:
* C# is being compiled in to CIL, which can be run by any .Net interpretator. (A bit like the java language) Many Linux products have beta versions of CIL interpretators that you can run allso with mac. So no reason to praise java because of Cross Platform. Though the .Net is still on a beta stage on most platforms it is there.

* C#'s editor can be downloaded for free. Though in a light version it is good enough for making fun small home projects. Where you would feel a bit cut off with the free editor if you have been using the enterprise you will still figure out that you got the most basic. This is specially handy if you are making visual apps, as the eclipse visual editor is close to crap.

* I should fill a table from a database once using both languages. The C# code took me 3 lines and 15 minutes on google to figure out how to do. The Java i spent 2 weeks, several classes and i dont know how long time to make.

* "But your friend is a java freak and he promised to help", Good bring him along. There is something called J# that is a close to be java. Any java users can use the editor, and language without sitting down and having to relearn everything. And it conmpiles in to CIL, guess what. You can use the same DLL's for the same project. (Same counts for VB.Net.)

* But java is more safe! Nope (and then again), would be the same statement as saying linux or mac OS would be safe. Noone cares about linux or mac. As 85% of all computer users use Windows you hit a bigger target. JSF is more safe though because as soon as you fiddle with the documents the server crashes. Noone can hack a crashed server :)

Just my pow of java vs. C#

#8 demonkoryu   Members   -  Reputation: 976

Like
0Likes
Like

Posted 06 August 2009 - 12:36 AM

Quote:
Original post by magic-mouse
* C# is being compiled in to CIL, which can be run by any .Net interpretator. (A bit like the java language) Many Linux products have beta versions of CIL interpretators that you can run allso with mac. So no reason to praise java because of Cross Platform. Though the .Net is still on a beta stage on most platforms it is there.

Yeah but Java support is much more mature. Also, .NET doesn't run on many smartphones.

Quote:

* C#'s editor can be downloaded for free. Though in a light version it is good enough for making fun small home projects. Where you would feel a bit cut off with the free editor if you have been using the enterprise you will still figure out that you got the most basic. This is specially handy if you are making visual apps, as the eclipse visual editor is close to crap.

It's not crap. Visual C# Express is nice though.

Quote:
Noone cares about linux or mac.

I'm a web developer and we deploy about 10% of our apps to Windows vs 90% Linux. It's not only about the desktop (though probably it's the context here). In any case you can't ignore Mac, it's very profitable to develop for.

#9 daviangel   Members   -  Reputation: 600

Like
0Likes
Like

Posted 06 August 2009 - 12:52 AM

Having and currently programming in both these languages the most obvious things that pop off the top of my head are:
Java by default comes installed on all Mac computers and used to on Windows until the lawsuit thing. Also that's why J#(Microsoft's version of Java) development stopped and I wouldn't use it since it's not supported anymore.
C# has way easier GUI programming support via winforms. It's just drag and drop almost like VB was. Haven't seen anything as easy with Java.
Otherwise, alot more is the same between the languages than differnt than most care to admit so I don't know why all the hate against Java?
Oh the other big difference is that C# actually let's you use pointer directly using unsafe code unlike Java so Java seems more protective of the programmer kinda like your mom telling you what to do so maybe that's where the hate comes from LOL?
Both should be around for a while since Microsoft and Oracle(I think they own Java now?) have quite a bit of resources to pour into their future if they care to.


#10 Plasmana   Members   -  Reputation: 151

Like
0Likes
Like

Posted 06 August 2009 - 01:14 AM

The Java vs. C# question isn't really about languages. It's about the frameworks/platforms.

My opinions...

As far as Java vs. C# for GUI programming, forget comparing Swing to WinForms. Check out .Net's WPF/XBAP/Silverlight technologies. They are XAML based and blow Swing and WinForms out the water. Microsoft's upcoming Visual Studio 2010 is a WPF app. It's kind of a HTML meets Flash meets WinForms kind of thing.

As far as games go I'd say XNA has no match, and it looks like Microsoft is serious about evolving it moving forward.

For server-side programming it's probably a wash right now. Perhaps a little easier on the Microsoft side.

For multi-platform, it's Java ahead by a mile.

For careers in programming, I would pick C# at this point.



#11 agm_ultimatex   Members   -  Reputation: 191

Like
0Likes
Like

Posted 06 August 2009 - 03:48 AM

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.

#12 Chadwell   Members   -  Reputation: 130

Like
0Likes
Like

Posted 06 August 2009 - 03:54 AM

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.

#13 phresnel   Members   -  Reputation: 949

Like
0Likes
Like

Posted 06 August 2009 - 04:17 AM

Quote:
Original post by magic-mouse
Noone caresI don't about linux or mac.

Fixed that for you.



#14 DvDmanDT   Members   -  Reputation: 784

Like
0Likes
Like

Posted 06 August 2009 - 04:21 AM

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.

#15 CosmicSpore   Members   -  Reputation: 100

Like
0Likes
Like

Posted 06 August 2009 - 04:58 AM

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.

#16 Mike.Popoloski   Crossbones+   -  Reputation: 2853

Like
-1Likes
Like

Posted 06 August 2009 - 05:38 AM

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

#17 Josh Petrie   Moderators   -  Reputation: 2954

Like
-1Likes
Like

Posted 06 August 2009 - 05:40 AM

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.

Josh Petrie | Core Tools Engineer, 343i | Microsoft C++ MVP


#18 CosmicSpore   Members   -  Reputation: 100

Like
0Likes
Like

Posted 06 August 2009 - 06:08 AM

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.

#19 Josh Petrie   Moderators   -  Reputation: 2954

Like
-1Likes
Like

Posted 06 August 2009 - 06:14 AM

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.

Josh Petrie | Core Tools Engineer, 343i | Microsoft C++ MVP





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS