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?
Prefix four spaces to a line to format code.
for (1 .. 100) print "Hello World! $_\n";
100.times { |i| puts "Hello World #{i}" }
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?