Live data from Hacker News

Ruby 3.4.0

ruby-lang.org

11–20 of 282 posts

Re: Ruby 3.4.0

#11

What does ruby do well that other languages don't? What is the niche it's trying to fill?

It's the language with the highest ratio of (useful work / LOC), so it's the least verbose language. This makes it very suitable to write and understand complex scripts, because the reduced boilerplate means less cognitive overhead for the programmer. As a result, experienced programmers can be extremely productive with it.

The well-known Rails framework uses this to great effect, however, some people argue that the choice of "convention over configuration" and extensive use of meta-programming, derisively called "magic", make it less suitable for inexperienced teams because they get too much rope to hang themselves and the lack of explicitness starts working against you if you're not careful.

Re: Ruby 3.4.0

#13

What does ruby do well that other languages don't? What is the niche it's trying to fill?

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

#14

Why did NodeJS take off on the backend while Rails was still popular? I'll never understand it.

Using the same language to write your frontend and backend is desirable for many people / teams.

Re: Ruby 3.4.0

#15

What does ruby do well that other languages don't? What is the niche it's trying to fill?

Rails has some very, very good features that make standing up a CRUD app with an administrative backend _very easy_.

It's also got a bunch of semi-functional-programming paradigms throughout that make life quite a bit easier when you get used to using them.

Honestly, if it had types by default and across all / most of its packages easily (no. Sorbet + Rails is pain, or at least was last I tried), I'd probably recommend it over a lot of other languages.

Re: Ruby 3.4.0

#16
post #2

I am most excited about the parser change, previously discussed here: https://news.ycombinator.com/item?id=36310130 - Rewriting the Ruby parser (2023-06-13, 176 comments) I remember being taught to use yacc in our compiler course because "writing it by hand is too hard". But looks like Ruby joins the growing list of languages that have hand-written parsers, apparently working with generated parsers turned out to be e…

Number of line is as any metrics, it gives you a quick idea of some amount, and that's it. To start having a sense of what it means, you need to be more acquainted with the topic at end.

It's not that uncommon to have an implementation with code that is lengthier but with an obvious pattern, while the smarter compressed implementation whose understanding is not necessary trivial to grab even for people seasoned to metaprogramming, reflexivity and so on.

Not to say that is what happen here, the point here was to recall that number of lines is not an absolute linear metrics.

Re: Ruby 3.4.0

#17

What does ruby do well that other languages don't? What is the niche it's trying to fill?

It was a niche for a time, but now it's way more a general purpose lang.

Where it shines now is in it's width and depth. There are thousands of well documented libraries built by millions of dev's.

If you want to do something; near anything, ruby has a gem for it. It's power today is that it is omni.

Re: Ruby 3.4.0

#18

Why did NodeJS take off on the backend while Rails was still popular? I'll never understand it.

Using the same language to write your frontend and backend is desirable for many people / teams.

To add, front-end developers and other people that learned in Javascript (because a web browser is something everyone has, turns out it's a pretty great runtime environment, has live editing with dev tools, etc. It's honestly a fantastic way to 'get into programming) could write the icky backend code to make their slick websites, SPAs and games have internet-based savestate
Post reply on HN