Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Ruby's nice and compact too:

    (1..100).each do
      puts "Ruby"
    end


Maybe it's just me, but I like doing it this way in Ruby:

   100.times { puts "Ruby" }
Not that there's anything wrong with your approach, but I just like the way that my code reads almost like English.


Eleven characters! Beats Fortran by four. We have a winner!

(Counting only the loop-related characters, leaving out whitespace.)

Unless anyone has a shorter way of doing something one hundred times?


I think if you want to talk about advantages though, with Fortran you're going to want to talk about the speed, not the brevity. Ruby is quite poky by comparison.


Oh, for sure, but I'd hate to get drawn into the world's Nth general discussion of the advantages and disadvantages of programming languages. That would be dull.


Actually, compared to batty discussions of economics or "politics!!!!!!", it's kind of soothing.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: