News for hackers. Stuff that matters.
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?

Re:Why I am Not a Professor, or The Decline and Fall of the ... by Goladus on Tuesday August 04, 2009 @01:16PM (#741625)

    Prefix four spaces to a line to format code.  
Also, you're missing a right curly brace in the second example.
Re:Why I am Not a Professor, or The Decline and Fall of the ... by philwelch on Tuesday August 04, 2009 @04:20PM (#742055)
Perl:

  for (1 .. 100) print "Hello World! $_\n";
Ruby:

  100.times { |i| puts "Hello World #{i}" }