Live data from Hacker News

An Ode to Ruby

blog.yboulkaid.com

11–20 of 204 posts

Re: An Ode to Ruby

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

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, well, almost everything.

My opinion: they will take dynamic typing from my dead cold hands.

Re: An Ode to Ruby

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

Re: An Ode to Ruby

#13

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.

Definitely consider Python with FastAPI too. I got a simple API up and running in a few hours with OAuth2. Auth comes batteries included and wasn't nearly as complex as I feared.

Re: An Ode to Ruby

#16

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.

I don't know about miserable, but definitely easier to get side tracked deciding what libs to use. Rails tends to push users down a path that works for most things. This makes it much easier for new users. JS leaves it up to the developer to pick and choose what libs which is not new user friendly.

Re: An Ode to Ruby

#17

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.

Rails is quite pleasant. There is a reason it became so popular.

I’d recommend using rails without any front-end framework initially so you understand the HTTP calls going on. Just return HTML from your controllers (classes that run specific code when you hit an endpoint.) Build up from there and you’ll get the hang of it while understanding what’s happening underneath.

Re: An Ode to Ruby

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

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.

Re: An Ode to Ruby

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

Equally maybe. Simpler? I'm not sure, I don't know Python very well.

A couple of things I found surprising about Python was having to do the whole `re.compile` thing instead of just `//` in Ruby. Also, no one will ever convince me that a list comprehension is simpler than `map` and related functions. Also, it's hard to beat the convenience of libs that let you do `1.day.ago`.

Ruby gets complicated when people start throwing around metaprogramming where they shouldn't.

I do like Python's file == module. Python seems like it would be a good functional programming language but it goes and only allows for single line lambdas.

Again, I don't know Python very well.

Re: An Ode to Ruby

#20
I love Ruby - Rails has been my day job for the past decade and my life is so much more pleasant when working with it than the odd time I've ventured off into things like Go or Java.

For personal things, my bread and butter is Sinatra and Sequel and that's a great combo as well.

My only real issue with it is differences in building native extensions on macos vs linux, usually need to set different compiler flags in the bundle config. Otherwise, works great.

ie. # ~/.bundle/config

---

BUNDLE_BUILD__PG: "--with-pg_config=/usr/local/Cellar/postgresql@10/10.19_1/bin/pg_config --with-cflags=-Wno-error=implicit-function-declaration"

BUNDLE_BUILD__THIN: "--with-cflags=-Wno-error=implicit-function-declaration"

BUNDLE_BUILD__FFI: "--with-cflags=-Wno-error=implicit-function-declaration"

Post reply on HN