Re:Ruby 3.4.0
by Kwpolska on Thursday December 26, 2024 @04:16AM
(#42514081)
Creating a new thread is equally simple in Java:
[ Parent
| on HN ]
Yes, but it's a good example of how Java is about twice as verbose to do the same work. The Ruby version of that can be written as simply:
Thread.new{ ... thread code ...}.join
The extra verboseness quickly adds up if every statement takes twice as much code.
Re:Ruby 3.4.0
by lucasoshiro on Thursday December 26, 2024 @07:40AM
(#42514842)
Fair. I must admit that I'm not aware of the recent features of Java. Last time I really needed it was the time that we needed to instance an anonymous class for callbacks. I still find the block syntax in Ruby cleaner though.
Kotlin is another language that has this Ruby-style blocks for callbacks.