News for hackers. Stuff that matters.
Re:Ruby 3.4.0 by tyre on Wednesday December 25, 2024 @03:51AM (#42507750)
Not really a niche language. Fantastic web server development. A more flexible and powerful language than python—the metaprogramming can be ridiculously powerful (when done well)—without the nonsense of white space sensitivity. ActiveRecord is perhaps the best ORM out there. Rails has tons of functionality to get running.

Overall, a pleasant and expressive language with an incredible community. Python ends up "winning" because of pytorch + pandas, but is (imo) a worse language to work in + with.

Re:Ruby 3.4.0 by codesnik on Wednesday December 25, 2024 @08:18AM (#42508650)
...but ruby is whitespace sensitive too. It's hard to notice, because rules mostly follow intuition, but there're cases when not only a missing newline, but absense or addition of a space changes resulting syntax. Currently I remember only difference in parsing unary vs binary operators, like + and *, and ternary operator ? : vs : in symbols, but there're certainly more other cases.
Re:Ruby 3.4.0 by psychoslave on Wednesday December 25, 2024 @10:58AM (#42509373)
Sure, like `a ?b :c` is nothing like `a ? b : c` (I guess the former is actually invalid), but that's obviously not what the previous message was referring to when speaking of Python which uses spaces as main facility to determine block scope.
Re:Ruby 3.4.0 by mdaniel on Thursday December 26, 2024 @03:12PM (#42517432)
There was a recent thread about parsing Ruby wherein I learned that the % quoting character accepts any character following it as the opening/closing delimiter <https://news.ycombinator.com/item?id=42032212> Crazypants.
Re:Ruby 3.4.0 by codesnik on Thursday December 26, 2024 @09:41PM (#42519528)
yeah, you can combine it with % formatting operator to do stuff like `% %% % %%%`