PDA

View Full Version : Which Is Better C# or Java




Augusta
Feb 27, 2009, 10:19 AM
I am new to this coding world. Recently I have started with Turbo C/C++. What next should I go for c# or java? Are their any online tutorials available through which I can start by myself?



Gelfin
Feb 27, 2009, 10:53 AM
I am new to this coding world. Recently I have started with Turbo C/C++.

Turbo C++ is ancient. C++ in particular has been revised in several important ways over the last fifteen years, and is about to be revised again. You'll eventually find yourself learning things that just won't be true when you get to a modern compiler. Try to find something newer if you can.

What next should I go for c# or java?

Just get comfortable with programming generally before you start asking things like that. That's a little like asking, "what sort of vehicle should I buy next, bicycle or a rowboat?"

Actually, between Java and C# it's a little more like asking, "should I buy a bicycle or a Microsoft DuoWheel™ that looks suspiciously like a bicycle in all important respects, but only operates well on Microsoft-branded bike paths." That's not really relevant, though.

The point is, it depends on what you want to accomplish, and what you want to accomplish right now is getting comfortable with the idea of solving problems in code, not the syntax of any one language. Those are skills you'll be able to take with you to learn any language, which you will be able to select later on the basis of how well it helps you get something specific done.

Are their any online tutorials available through which I can start by myself?

There are online tutorials for every language. I won't point you at them because I'd have to Google for them, same as you can. :)

Also, we do have a Programming Forum (http://forums.macrumors.com/forumdisplay.php?f=73) that gets a lot of neophyte traffic.

ChrisA
Feb 27, 2009, 12:20 PM
I am new to this coding world. Recently I have started with Turbo C/C++. What next should I go for c# or java? Are their any online tutorials available through which I can start by myself?

First ask yourself what you want to write. What kind of software? What are your goals?

Java is cross platform and works on the Mac. It's not a bad choice for general applications and if the goals is just to learn about software development. Java is not bad at all. The sun.com web site has all the tutorials you could ever want. All the Java documents are there. Sun does a very good job at supporting java with more material than you would read in a year.

A good place to start.
http://java.sun.com/docs/books/tutorial/

lee1210
Feb 27, 2009, 12:33 PM
This question does lend itself to simile, but i will try to avoid it. In terms of language quality... they are pretty much on par. Once you start getting into the built-in libraries... they are still pretty similar, but I'm sure people have things they like in .NET APIs that aren't in the Java libraries, and vice versa.

The only real barrier to C# is that for non-Windows machines you depend on Mono. The long-term viability of this is a question mark, but others would disagree, I'm sure.

When it comes down to it, though, they are very similar, and if you learn one it would be quite easy to pick up the other if necessary. Don't focus on the language, focus on solving problems, algorithms, data structures, etc. The syntax of any one language is not important.

-Lee

xyzeugene
Feb 27, 2009, 12:41 PM
I would say that having no pointers in Java is deficiency. Akin to being a chef without having knives.

This question does lend itself to simile, but i will try to avoid it. In terms of language quality... they are pretty much on par. Once you start getting into the built-in libraries... they are still pretty similar, but I'm sure people have things they like in .NET APIs that aren't in the Java libraries, and vice versa.

The only real barrier to C# is that for non-Windows machines you depend on Mono. The long-term viability of this is a question mark, but others would disagree, I'm sure.

When it comes down to it, though, they are very similar, and if you learn one it would be quite easy to pick up the other if necessary. Don't focus on the language, focus on solving problems, algorithms, data structures, etc. The syntax of any one language is not important.

-Lee

lee1210
Feb 27, 2009, 12:46 PM
I would say that having no pointers in Java is deficiency. Akin to being a chef without having knives.

Everything but primitives are pointers in Java, you just don't get to as much of a chance to screw them up. I guess when I'm writing OO code, i don't miss programmer-controlled pointers.

This brings up the main point i was getting at, which is that it's a matter of personal taste. The OP will likely be fine no matter which they pick.

-Lee

aratio
Feb 27, 2009, 01:17 PM
Objective-C is the first class language to develop stuff in MacOS X, but you can develop in Java, C# or C++ as well...

Asking "what is better, Java or C#?" is like asking if Coca is better than Pepsi...

Java and C# share a lot of similar concepts, features, almost identical syntax and similar frameworks to do the things but IMHO I feel C# more "modern" (actually if was born 8 eights later than Java).

Anyway, if you use Java, you can develop UI applications that behave like native MacOS X applications because Java Swing [the UI framework] emulated perfectly the native UI.

If you use C# through Mono (a very nice project), you can use Cocoa# (a .NET binding to Cocoa, the MacOSX UI framework) and build full native MacOS X apps.

pikester
Feb 27, 2009, 01:38 PM
Augusta:
It is tough to answer the question unless we know what type of development you are going to do. If you are just looking to learn another language, then either language is fine. If you are looking to develop applications for the Mac (which is what I'm assuming since you are posting to a Mac board), then I would suggest learning Java since it comes with the Mac (you'd have to install Mono to have C# on a Mac).

Here is one link to learning Java (albeit an old one):
http://www.javacoffeebreak.com/java101/java101.html

Eventually, you'll want to download a good IDE for Java, either of these is fine:
* Eclipse: http://eclipse.org
* NetBeans: http://netbeans.org
Both are good, you'll probably prefer one over the other (which one that is is up to you).

EmperorDarius
Feb 27, 2009, 02:22 PM
Obviously Java because:

-It doesn't require installing the stupid, huge, Microsoft (the worst adjective) .NET Framework. Java just asks installing the Java VM, which is smaller and it's quite common to use it for online programs like chats etc.
-Java programs load faster than C# ones.
-Java programs run on every major OS.
-Java is supported by many IDEs, C# is supported by the slow, bloated and buggy Visual Studio (which is Windows only) and some other Mac IDEs.
-C# is basically a Java copy, born after Sun Microsystems forced Microsoft to discontiune J++/J# (an even closer Java copy).

For Mac apps, Obj-C rules.

aratio
Feb 27, 2009, 02:57 PM
Obviously Java because:

-It doesn't require installing the stupid, huge, Microsoft (the worst adjective) .NET Framework. Java just asks installing the Java VM, which is smaller and it's quite common to use it for online programs like chats etc.


Do you think the Java SDK is tiny? It has a comparable number of classes than .NET framework; anyway, not because .NET framework was designed and implemented by MS, we can say it is a piece of crap... Actually, it is a nice piece of technology.


-Java programs load faster than C# ones.


Where do you get that from?


-Java programs run on every major OS.


MS .NET Framework is limited to MS OSes, but the Mono project runs on every major OS, including MacOS X, Linux and BSDs.



-Java is supported by many IDEs, C# is supported by the slow, bloated and buggy Visual Studio (which is Windows only) and some other Mac IDEs.


Sorry but Visual Studio is one of the best IDEs in the market today. But yes, it runs on Windows only and that is a limitation. Anyway, you can use KDevelop, NetBeans, Eclipse or MonoDevelop to develop in C# too (or XCode, talking about MacOSX)


-C# is basically a Java copy, born after Sun Microsystems forced Microsoft to discontiune J++/J# (an even closer Java copy).


Yes, but though C# started as a Java copy, today implements nice features (absent in Java) like LINQ. Also, the internal implementation of generics is superior in .NET than in Java [in Java the generics are implemented at compiler level only, in .NET, the full CIL understands generics, and that is a BIG PLUS].

I agree that C# is heavily based on Java, but it also implies that it learned from Java and improved in several things, including support for properties, custom attributes and more.

For Mac apps, Obj-C rules.

Agreed.

Zortrium
Feb 27, 2009, 03:31 PM
There are pros and cons of both. The chief con of C# is probably that it's an MS-pushed construct that doesn't like non-Windows OSes very much. Java is more interoperable and supported, especially on the Mac (though Apple likes telling Java users to screw off, but nonetheless).

I've heard people say that the Java libraries are more complete and polished than the .NET libraries, but I've also heard people say that they wished Java had some nice C# features (true properties and generics that don't suck being two of the biggies).

Disclaimer: I'm a Java programmer who's studied C# but hasn't actually coded anything in it.

chewietobbacca
Feb 27, 2009, 04:17 PM
Obviously Java because:

-It doesn't require installing the stupid, huge, Microsoft (the worst adjective) .NET Framework. Java just asks installing the Java VM, which is smaller and it's quite common to use it for online programs like chats etc.


Yeah, damn that .NET framework that's being used by numerous programmers out there that love using it :rolleyes: