Live data from Hacker News

An Ode to Ruby

blog.yboulkaid.com

81–90 of 204 posts

Re: An Ode to Ruby

#81

Started a new job in the past year and it's 50% rails, 50% react. Thought I would chafe after returning to ruby after ten years of nothing but JS and TS, but I quite like it. I only wish there was slightly less magic and a bit more declaration. It always weirds me out that Ruby just finds stuff without me having to 'import' or 'require' it. I have a love/hate relationship with much of the DSL stuff too (more 'magic')…

> Ruby just finds stuff without me having to 'import' or 'require' it.

That's either bundler (which `require`s every dependency you specify unless you tell it not to) or the Rails autoloader[1] (which goes hunting for a file that might define the constant, which also allows hot-reloading to work). Ruby itself requires you to `require` everything.

[1]: https://guides.rubyonrails.org/autoloading_and_reloading_con...

Re: An Ode to Ruby

#82

Managing different projects with different Ruby versions with rbenv has been the bane of my existence the past couple weeks. Why isn’t this experience fleshed out better by now?

Personally I get very good mileage out of the ruby-install/chruby/rv trifecta. RVM and rbenv tried to do too much for my liking.

Re: An Ode to Ruby

#83
post #67

Here's my hot take on Ruby (as a big Ruby fan): Ruby libraries in general have bad documentation. Some other languages I've worked with in the same time frame that typically have better docs are node.js/regular js, Python, Golang and Elixir. For many gems, all you're going to get are a couple of examples in the readme. If you're lucky, there will be some generated rubydocs, but quite often that isn't helpful either,…

> Here's my hot take on Ruby (as a big Ruby fan): Ruby libraries in general have bad documentation. Some other languages I've worked with in the same time frame that typically have better docs are node.js/regular js, Python, Golang and Elixir. JS libraries, IME, are often very bad, though there are some good ones. But, on Ruby, I would go further and say that, especially compared to Python which is so similar in many…

I agree, JS is kind of all over the place.

Re: An Ode to Ruby

#84
post #72

Very well done, esp. the nokogiri bit :D That said if you're in Ruby land and do want something "shiny", I'd encourage you to look at Jeremy Evans work (Roda and Sequel in particular) and some of the broader ecosystem beyond Rails. There's a lot of good stuff beyond just Rails :) https://github.com/jeremyevans

I'd also suggest Jeremy's book Polished Ruby[1]. It's excellent IMHO. 1. https://www.oreilly.com/library/view/polished-ruby-programmi...

I no longer write Ruby professionally but in my last 18-24 months of Ruby work I leaned heavily on some of Jeremy's excellent work with roda, sequel, and others (forme, erubi, rack-unreloader, etc.). Top notch work, truly. I had no idea that he had written a book, thanks for pointing that out, and I'll definitely be picking a copy up.

Re: An Ode to Ruby

#85
post #46
post #8

I used to joke about Nokogiri dependency troubles for many years, but to be honest the experience in macOS lately has been straightforward for me.

Just curious, what's the issue with Nokogiri for some people? It always installs just fine for me...

I've lost countless hours to "works on my machine but not coworkers" which turned out to be issues compiling nokogiri with native extensions. It broke all the time between macOS updates. Vagrant / docker were a godsend to removing that element of uncertainty.

Re: An Ode to Ruby

#86

Earlier quoted context omitted.

Having tried both Node and Rails, Rails was a horrible experience. I hated every minute of it and will ignore any job listings including it. Your whole project is in a billion files and everything works by "magic." There is so much complexity and different flies that it sucks to work with. Meanwhile with Node you can start with a simple index.js and work your way up.

So you come from the Node ecosystem and your main complain about Rails is that the project has a lot of dependencies and files? lol

I hear your point but the quantity of files produced by initializing a new rails project is very large, larger than an equivalent node project with server and framework. These aren't transient build artifacts either, they will live in the repo and may occasionally need attention.

Re: An Ode to Ruby

#87
post #6

It's too bad Ruby isn't seen as 'cool' anymore, it's just so easy to be productive in it. And now MJIT, YJIT and TruffleRuby are making some very impressive performance gains. Rails is also better than ever and I still can't think of a better language for scripting.

I love the fact that Ruby is no longer cool anymore and has finally matured enough that one can build a stable system on top of it. It now has been battle tested and powers some of the biggest platforms on the web.

I couldn't be happier with the direction that Ruby 3.0 and Rails 7.0 are taking at the moment. We have businesses to run and Ruby allows just for that. It's boring, it's stable and will deliver results.

I wouldn't pick it to build the next Discord though.. One must use the right tool for the job.

Re: An Ode to Ruby

#89
I am a newbie to Ruby. I hadn't touched it before a few months ago, after coming to Shopify. But I really think Ruby is a fantastic language, I would much rather program in Ruby than in Python, JS or Java right now. It reminds me of small talk and is just nice to write. And Rails, wow Rails is such a good web framework, there's no surprises, and its opinionated nature makes it really easy to come up to speed in even a big code base.

Tech trends are weird, and the "hot new thing" is usually based off of some blog post or tech company saying its cool. Plus with things like TruffleRuby and Sorbet and JITs, there's some interesting development in the ecosystem.

Re: An Ode to Ruby

#90
post #12
post #6

It's too bad Ruby isn't seen as 'cool' anymore, it's just so easy to be productive in it. And now MJIT, YJIT and TruffleRuby are making some very impressive performance gains. Rails is also better than ever and I still can't think of a better language for scripting.

"I still can't think of a better language for scripting." Python I find equally if not more simple. Would you agree?

They are surprisingly different.

Ruby has a focus on developer joy and productivity. In some cases this comes to the detriment of language simplicity, and existing features can complicate language evolution.

Surprisingly with this complexity Ruby has had a bit more success with optimized implementations than Python, such as Truffle Ruby.

Ruby is a bit more multi-paradigm than Python IMHO, and has been jokingly called a "language for connecting adults". One can monkey-patch override division to return fractions, with the person maintaining the project deciding if this is a good idea or not. This can potentially make projects with a large number of dependencies harder to debug, which interestingly seems to have created some push-back on importing lots of arbitrary dependencies.

With both Python and Ruby, you wind up having divisions between dependencies because of the poor mismatch between different paradigms - for instance, libraries built to work with Python Twisted or Ruby EventMachine for I/O, or libraries built to work generically or to integrate into say Django on Python's side or Rails on Ruby's side.

Interestingly the communities seem to have different key focus areas - Ruby has historically been very focused on testing (cucumber and selenium for instance) while Python has had a lot of focus on documentation (pydoc and sphinx). Oddly, neither really has had a noticeable literate programming push.

Post reply on HN