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

We're using both Java and Ruby. We started out with Ruby and Rails, which worked great for the prototype but we have some very processor-intensive operations and the Ruby code won't scale. Rewriting these in Java produced an instant 100-fold performance improvement, so going forward we're doing that stuff in Java. On the other hand, we have some text-processing stuff where Ruby really shines. Having used Ruby for that I'd never go back to Java for such tasks.


I actually like the regexp implementation of Java, and it is more complete than in most other languages. There are also many options for XML parsers. Where does the advantage for Ruby lie?


Ruby is terser, and yet still very readable. In addition, you will not be getting any performance gain by using a JAVA regex over a ruby regex unless you are using a DFA implementation (if there is one for JAVA), in which case you won't get text capturing.

How many lines of Java code would it take you to read a file given on the command line and print out the prefixes of words ending in 'ing'

ARGF.readlines.each do |line| puts m[1] if( m = line.match(/(\w+)(?:ing)$/) ) end




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: