Live data from Hacker News

An Ode to Ruby

blog.yboulkaid.com

41–50 of 204 posts

Re: An Ode to Ruby

#41

> For I once again have trouble installing Nokogiri. One could consider https://rubygems.org/gems/oga , as it doesn't have any installation problems. It's not actively maintained though (mostly because the author considers it to be complete). I do think the author is a bit of a weirdo though :)

Thanks for creating oga :) I use it a lot. Bonus: it's even slightly faster than Nokogiri.

Re: An Ode to Ruby

#42

A coworker of mine is leaving for a Ruby job, which caught me off guard, so I've had Ruby on the brain a bit lately. I was a big fan of Ruby for a few years back in 2004-2006 or thereabouts. Rails was the new hot thing, but I wasn't into web dev so I didn't pay all that much attention to it. I remember blindsiding my networking professor by using Ruby for an assignment when he expected but failed to specify Java or C…

I used Ruby for my MSc thesis... which involved applying statistical approaches to reduce error rates in OCR. I did have to call out to C code for a few things (k-means in Ruby 1.8.x was not fast...).

Most of my Ruby work has been outside of web. Message brokers, cloud orchestration and assorted devops, a text editor (for my own use - it's replaced Emacs for me), financial simulations. And that means the majority of my work for the last 15 years.

Ruby has gotten more low key, but for those of us who never really liked Rails that's not really mattered much.

Re: An Ode to Ruby

#43
post #37
post #36

Earlier quoted context omitted.

Ok, that's a nicer result (obviously I don't write Python lol) but still seems inconsistent to me (putting the function before the array) considering Python is an OO language and most people are going to be writing methods for classes where you call methods with dot. I just remember list comprehensions from Coffee-script and not going to lie, I hate them. It's like reading backwards.

Python is a multi-paradigm language, of which OO is one paradigm it supports.

Ruby has map, filter, reduce and a bunch of other functional methods. It's more about the consistency of wondering what's a function versus what's a method and then things like list comprehensions and for loops. Python also doesn't have a lot of the goodies of a real functional language, it encourages for loops and seems to be even more procedural than Ruby but less OO?

Re: An Ode to Ruby

#44

One of my goals for 2022 is to write my first real web app. I want to understand things like authentication, creating an API, and security. My initial impression is that the JS/Node world is miserable. Rails looks 1000 times more pleasant.

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.

Node and Rails aren't close to the same thing. I would think a better comparison would be Node - Sinatra.

Re: An Ode to Ruby

#45
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?

Having done both professionally, I'll take Python any day of the week. The "Expressivity" lauded by Ruby fans translates into a lack of readability. But the things that drives me crazy is the optional/alternative syntax of ruby.

Re: An Ode to Ruby

#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...

Re: An Ode to Ruby

#47

Earlier quoted context omitted.

What was cool was Rails, IMHO, and Ruby was the surprise inside it. I've had my own personal Advent of Code these holidays, coding a small API for a personal need. Ruby (Sinatra) took one morning to full deployment in Heroku. Then I tried Crystal (Kemal) and it took me a couple of days to figure out how to map JSON to Crystal data structures. Then I rewrote it again in Rust (Rocket). Two weeks till I figured out, wel…

I also took a while to get used to the typing in Crystal but once you do get it, it's worth the effort IMO. I occasionally still fire up Ruby but if I have anything more to do than a quick command-line command, I use Crystal, so many less problems.

Crystal was overall a pleasant experience, which I cannot say for Rust. Although it was probably my fault: 1) for being "rusty" as a programmer myself, and 2) having zero experience with Rust. I want to believe that once you get over the learning curve in Rust development speed becomes much higher.

Surprisingly, Crystal seems to be much leaner in runtime size than Rust, with similar performance (although the use case is so simple that even good old Ruby is fast enough).

But then again, I feel you cannot beat Ruby in terms of dev productivity.

Re: An Ode to Ruby

#48

One of my goals for 2022 is to write my first real web app. I want to understand things like authentication, creating an API, and security. My initial impression is that the JS/Node world is miserable. Rails looks 1000 times more pleasant.

Elixir with Phoenix and Liveview.

I'm a Rails dev at $JOB, currently flirting with Phoenix, and while I think that both Elixir and Phoenix are really solid and even quite enchanting, I don't think they're the best choice for someone's first contact with webdev. Most people are more comfortable with imperative languages and Elixir only adds to the initial friction of not knowing the proper webdev lingo and concepts.

Re: An Ode to Ruby

#49
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...

In OS X it was usual to have your bundle explode when compiling Nokogori due to som libXml dependency, circa 2010.

Re: An Ode to Ruby

#50
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?

Ruby has the ability to automatically download required gems in single-file scripts via bundler. I don't know of any equally convenient alternative for my python scripts.

e.g. https://gist.github.com/destiny-index/2a2e7e586bb9cd6e5c3000...

Post reply on HN