Programming - C# vs Java

charlieharper

Expert Member
Joined
Jun 1, 2007
Messages
3,862
Reaction score
1,977
Location
South Coast, KZN
I'm still a complete n00b when it comes to software development. I'm really interested in getting a bit of knowledge before hitting Uni/College next year. I'm very interested in maybe investing in a book to increase my knowledge and maybe get the hang of it.

Now the question is - Which should I rather do as a first language - Java or C#?
We all know C# is Mircosoft's attempt on Java, but which is more future proof?

And which books would be recommended to teach myself these Languages?

Any other languages I should consider?

Thanks!
 
Last edited:
Judging by Microsoft's former behaviour I would say C# is at risk.
 
Well from what I realized after a lot of reading, Visual Studio is great compared with any other IDE's. NetBeans is the IDE for Java Development?
 
Well from what I realized after a lot of reading, Visual Studio is great compared with any other IDE's. NetBeans is the IDE for Java Development?

Either should be a good bet, once you learn to program and design algorithms, the language isn't really an issue. I haven't done much C#, so can't comment about it but Java is very simple and very powerful. I hear C# is just as good.

With regards to IDEs for Java the two biggest free ones are Netbeans and Eclipse. Alternatively there is intellij which more and more developers I chat to are buying and moving to.

But do not choose a language based on IDEs, they are designed to assist you write code, you should always learn in a basic highlighting only word editor imo :)
 
I'd do neither to be honest... C++ is probably the best place to learn fundamentals. But be sure to distiguish between software dev and languages.
And the IDE is just the environment with some cool tools, Notepad works the same, if you know how to use a console. There is no "right" way, or "single" language.
What I suggest is spend very little time choosing the right place to start, and waaay more time getting stuck in. In fact, spend the next 20 days writing a
Hello World piece of code in a different language every day. Then pick one that you liked the most.
 
You have some valid points regarding the IDE's, but lets face it, they help you so much, when figuring out where the bugs are when debugging the software.

I know C++ is a great language - Hence its powerful -, but isn't it one of the hardest languages to learn?
 
Hello World comparison

C++
Code:
#include <iostream>
using namespace std;
void main()
{
  cout << "Hello World!" << endl;   cout << "Welcome to C++ Programming" << endl; }

C#
Code:
using System;
 
class Program
{
    static void Main()
    {
        Console.WriteLine("Hello world!");
    }
}

Java
Code:
class HelloWorldApp {
    public static void main(String[] args) {
        System.out.println("Hello World!"); // Display the string.
    }
}

By comparison, C++ is the long way......
 
Oracle seem intent on killing java through their court cases, but it looks like MS seem to be moving away from .Net with Windows 8. So I guess neither is future proof. Both have lots of sample code websites. Both are similar in structure. Both achieve their designated purposes, so I guess, that as someone who still has to go to college, cost counts. Which books are the cheapest. On the other hand, I can send you some PDF textbooks for Java, as I do teach it at high school. I'm guessing you might want to go this way until you get to college. Plus Java teachers are more readily available as Java is part of the NCS. So that will help if you have questions.
 
C++ isn't going to be taught in a tertiary institution he's going to attend, I'm willing to bet. Odds are he'll be faced with C#. These days Java seems to make the most sense career-wise though.

OP, I'd suggest doing a couple of quick tutorials on whatever language you choose, and then grab a good reference manual like Visual C# 2010 Step by Step, by John Sharp, which I happen to have snatched from work the other day, purely out of interest. It's not great if you're completely new to programming, but if you know the basics, it's pretty nifty to scan through.
Also, Head First Design Patterns is a must-have in my opinion, if you're going into OO programming.
 
Well currently i'm studying software development and we learn C++, its mainly to implement basics and how to program. I have done all from Java to C# to C++ to Visual Basic to PHP(Java look a like in web programming) and some other languages. I would say Java is very nice to learn as it runs on almost every device from Windows to Linux to most cell phones and is very powerful. When I start a project or anything I see which language has the best API's and features for the task I need. If you need to make apps for fun and to use I would suggest Java over C++ so you can run on so many devices unlike C# or other languages which use the .Net Framework
 
C++ isn't going to be taught in a tertiary institution he's going to attend, I'm willing to bet. Odds are he'll be faced with C#. These days Java seems to make the most sense career-wise though.

Indeed!

Even for the BSc in IT degrees, you will only be taught C# and Java.
I'm going the BTech route though.
 
Indeed!

Even for the BSc in IT degrees, you will only be taught C# and Java.
I'm going the BTech route though.

AFAIK, UCT still teached C++ in 2nd year. Worst year of my Com Sci degree ;)

I learned Java in first year, then taught myself C# in honours. Honestly (I've done this) you can take a simplish Java program, copy and paste it into Visual Studio, change one or two salient lines and, boom, compile it as C#. They're so similar it's scary (but awesome).

Long story short, Java or C#. Personally, I'd take C# since it's easier to make .exe files which you can give to your friends if you want to show off your work :D. I know you work around it with Java, but it's easier with C#.
 
C++ is not "hard", its just much more explicit coding. C++ does not by default have a garbage collector ect.. Java has a lot more stable and supported libraries. Creating basic GUI applications is a breeze compared to C++, purely due to the Java API and straight forward libraries.

As a beginner who really wants to have a intensive knowledge of programming, I'd start with C/C++. Java won't learn you the skills that are crucial in other languages such as memory management, pointers, operator overloading, inheritance and abstract classes. It is very easy to learn a new language if you are proficient in C++, it's purely syntax change, the basic ideas remain the same.

For online help C++ is much better, as the people posting solution are generally a more experienced group. Every second egghead on the internet seems to think they know Java and the amount of absolute crap code posted is ridiculous.
 
Java won't learn you the skills that are crucial in other languages such as memory management, pointers, operator overloading, inheritance and abstract classes.

Java does have inheritance and abstract classes, not sure what language you are referring to.
 
Yip, I think SLAQ hit the nail on the head. OP, if you're looking for the "quick" root, then sure, go ahead with something other than C++. And while you're at it, go ahead with a WYSIWIG designer too. I mean, you can create apps in seconds with Qt or Delphi or make a website in less than 3 minutes with Google sites! yay - setup your online shopping site before midnight!

The reason I suggested C++ is for extensive online help and more fundamental coding requirements. C# has some awesome shortcuts, for industry - which, you're a few years off of. Sure, start with C# or Java today, but well IMHO LEARN the basics (and by basics I don't mean easy stuff, I mean the 1010101010101111000s). You asked where to start. If you're actually serious, start with machine code. That's a real way to learn HOW things work. Learning what's going to be used today because it's "easy" and "simple" is pretty pointless.

I say again: the language you learn is irrelevant. Software Dev has nothing to do with the language or IDE. So spend less time picking these and more time learning what goes on behind the code.
 
Well, my 2c worth, I hated (and still do hate c / c++ ) they feel "awkward" to a beginner. I have also taught high school CS classes, and Java was FAR easier for students to get into.
I kinda agree with some of the posters that it seems like Oracle is trying to "kill" Java, but I still think that its the way to go.
To pick up Java as a beginner, it really is simpler.
With IDEs again, my preference for Java development is Netbeans. I do not like the way that eclipse does things, for example, I found that the Debugger in netbeans is easier to figure out. Eclipse seems to go into "modes" where you have a "creation mode" then a "debugger mode" I prefer that Netbeans keeps the code on screen and simply steps through it.
It "feels" far more natural to me than eclipse.
 
Java does have inheritance and abstract classes, not sure what language you are referring to.

Inheritance in Java is possible but not nearly as powerful as in C++. Having to resort to methods to emulate multiple inheritance in not really efficient. Due to not being able to apply multiple inheritance in Java as in C++ means you rarely make use of abstract classes. But apologies for my not technically absolute correctness in original post.
 
Java's designers chose to allow multiple interface inheritance through the use of interfaces.

In the designers' opinion, multiple inheritance causes more problems and confusion than it solves. So they cut multiple inheritance from the language (just as they cut operator overloading). The designers' extensive C++ experience taught them that multiple inheritance just wasn't worth the headache.
http://www.javaworld.com/javaworld/javaqa/2002-07/02-qa-0719-multinheritance.html

It's a deliberate omission.
 
Top
Sign up to the MyBroadband newsletter
X