Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Feb 27, 2009, 10:19 AM   #1
Augusta
macrumors newbie
 
Join Date: Feb 2009
Which Is Better C# or Java

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?
Augusta is offline   0 Reply With Quote
Old Feb 27, 2009, 10:53 AM   #2
Gelfin
macrumors 68020
 
Gelfin's Avatar
 
Join Date: Sep 2001
Location: San Francisco, CA
Quote:
Originally Posted by Augusta View Post
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.

Quote:
Originally Posted by Augusta View Post
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.

Quote:
Originally Posted by Augusta View Post
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 that gets a lot of neophyte traffic.
__________________
Reality is that which, when you stop believing in it, doesn't go away.
--Philip K. Dick
Gelfin is offline   0 Reply With Quote
Old Feb 27, 2009, 12:20 PM   #3
ChrisA
macrumors G4
 
Join Date: Jan 2006
Location: Redondo Beach, California
Quote:
Originally Posted by Augusta View Post
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/
ChrisA is offline   0 Reply With Quote
Old Feb 27, 2009, 12:33 PM   #4
lee1210
macrumors 68040
 
lee1210's Avatar
 
Join Date: Jan 2005
Location: Dallas, TX
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 is offline   0 Reply With Quote
Old Feb 27, 2009, 12:41 PM   #5
xyzeugene
macrumors newbie
 
Join Date: Feb 2009
Major difference

I would say that having no pointers in Java is deficiency. Akin to being a chef without having knives.

Quote:
Originally Posted by lee1210 View Post
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
__________________
13" White MacBook, 2.4 GHz, 4 GB RAM, 500 GB HD ; OsX 10.5; VMs: Ubuntu 8.10, WinXP Pro SP3, OsX 10.5; IDEs: XCode 3.12, Delphi 2009, VS.net 2008 SP1
xyzeugene is offline   0 Reply With Quote
Old Feb 27, 2009, 12:46 PM   #6
lee1210
macrumors 68040
 
lee1210's Avatar
 
Join Date: Jan 2005
Location: Dallas, TX
Quote:
Originally Posted by xyzeugene View Post
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
lee1210 is offline   0 Reply With Quote
Old Feb 27, 2009, 01:17 PM   #7
aratio
macrumors member
 
Join Date: Feb 2009
Location: Cochabamba
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.
aratio is offline   0 Reply With Quote
Old Feb 27, 2009, 01:38 PM   #8
pikester
macrumors newbie
 
Join Date: Feb 2009
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).
pikester is offline   0 Reply With Quote
Old Feb 27, 2009, 02:22 PM   #9
EmperorDarius
macrumors 6502a
 
Join Date: Jan 2009
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.
EmperorDarius is offline   0 Reply With Quote
Old Feb 27, 2009, 02:57 PM   #10
aratio
macrumors member
 
Join Date: Feb 2009
Location: Cochabamba
Quote:
Originally Posted by EmperorDarius View Post
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.

Quote:
Originally Posted by EmperorDarius View Post
-Java programs load faster than C# ones.
Where do you get that from?

Quote:
Originally Posted by EmperorDarius View Post
-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.


Quote:
Originally Posted by EmperorDarius View Post
-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)

Quote:
Originally Posted by EmperorDarius View Post
-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.

Quote:
Originally Posted by EmperorDarius View Post
For Mac apps, Obj-C rules.
Agreed.
aratio is offline   0 Reply With Quote
Old Feb 27, 2009, 03:31 PM   #11
Zortrium
macrumors 6502
 
Join Date: Jun 2003
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.
Zortrium is offline   0 Reply With Quote
Old Feb 27, 2009, 04:17 PM   #12
chewietobbacca
macrumors 6502
 
Join Date: Jun 2007
Quote:
Originally Posted by EmperorDarius View Post
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
chewietobbacca is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Some apps prompt to install Java 6 even when Java 7 is installed MacMan988 OS X Mavericks (10.9) 1 Apr 18, 2014 07:56 AM
Java 6 or Java 7 for OSX Mavericks for your Macbook Pro? Starfyre MacBook Pro 3 Dec 22, 2013 03:49 PM
Java 6.x security risk (?) vs Java 7.x and broken apps w/ v7.x installs? mgiamo Mac Basics and Help 1 Dec 15, 2013 03:48 PM
Chrome on OS X -- Java plugin / Java 7 vs Java 6 Issue booyahbooyah Mac Applications and Mac App Store 4 May 31, 2013 09:13 AM
Installed Java 7.07 but doesn't show up in Java preferences? -mattias- OS X 10.8 Mountain Lion 21 Aug 31, 2012 04:49 PM

Forum Jump

All times are GMT -5. The time now is 03:46 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps