Re:Why I am Not a Professor, or The Decline and Fall of the ...
by Retric on Tuesday August 04, 2009 @11:37AM
(#741394)
Yea, the advantage of Java over C is the second program.
for (int x = 1; x <= 100; x++){ System.out.println("Hello World! " + x); }
vs
for (int x = 1; x <= 100; x++){ printf("Hello World! %d! \n", x);
PS: How do you include readable code snippets on HN?
For example, unless you're concerned with specific performance issues, you're not likely to care how a string is implemented in Java. It's difficult to use strings in C without understanding memory. Without understanding when strings are mutable and when they aren't, what null-terminated means, how "%s" works, and such you will quickly run into some unexpected behavior and will likely just trial and error until you get something that seems to work. When you understand that C is a syntax for allocating and manipulating memory, it tends to make a lot more sense.