So, my official opinion on Java
After two weeks in my Comp Sci class that for whatever reason uses Java, I've come to a conclusion.
Java feels fairly easy to pick up, but is retarded as a programming language. For example, it's insanely long strings to to simple things are easy to memorize, but retarded to type.
A hello world program in C++:
Code:
#include <iostream>
int main() {
std::cout << "Hello, world!";
return 0;
}
Compared to:
Code:
class HelloWorld
{
public static void main ( String[] args )
{
System.out.println("Hello, world!" );
return 0;
}
}
Why does the Java one have to be so ridiculously long?
Or take user input for example.
C++:
Code:
#include <iostream>
int main() {
cout << "Enter your name: ";
cin >> name;
cout << "Your name is " << name << ".";
return 0;
}
Java:
Code:
import java.io.*;
public class GetUserInput {
public static void main ( String[] args ) {
System.out.print("Enter your name: " );
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String name = null;
try {
name = br.readLine();
} catch (IOException e) {
System.out.println("Error!" );
System.exit(1);
}
System.out.println("Your name is " + name );
}
}
Of course, the Java one includes an error check too, but seriously - why is it so ridiculously long?
Also, for games and large programs and stuff, Java is slower because of how high-level it is and the fact that it's run in a virtual machine.
Overall, I prefer C++ because of it's extreme variety of things you can program with it (For example, Xbox games) compared to Java, where the only good game ever programmed in it takes a gaming computer to run, when it has 10-bit graphics. (Read: Minecraft)