Live data from Hacker News

An Ode to Ruby

blog.yboulkaid.com

21–30 of 204 posts

Re: An Ode to Ruby

#21

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 and Django are both very pleasant and have enormous ecosystems where every imaginable problem has been encountered and "solved". It's been a while since i was writing Rails but from what I gather Rails 7 is a homerun release and has a lot of buzz around it.

Re: An Ode to Ruby

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

I am not a Python or a Ruby dev.

The Ruby devs I know are overall great devs

The Python people are second-rate.

Ruby produced tons of good software as a framework base besides Rails.

Python? Eh.

Re: An Ode to Ruby

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

It's not about simplicity, It's about expressivity.

Re: An Ode to Ruby

#25

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.

Re: An Ode to Ruby

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

> Python I find equally if not more simple. Would you agree?

Simple, yes. But when I want to write a script as fast as possible with the least amount of effort I don't want simple. I want convenient and powerful. Many things which in Python take multiple lines in Ruby are simple one liners.

There's a certain dichotomy between Ruby and Python that I also see in many other pairs of languages. One language is simple, easy to learn and easy to read (Python), but is not as powerful or convenient to write. The other language is more complex, harder to learn and harder to read (Ruby), but is more powerful and convenient to write.

It seems like most people prefer the first category, which I think is why languages like Python or Go are so popular. There's nothing wrong with that as it's a tradeoff, but I personally prefer the second category, which is the reason why I do all of my scripting in Ruby and not in Python like everybody else.

Simply put I don't really mind the extra complexity since it is essentially mostly a one time cost, so I always pick whichever tool will make me more efficient in the long run. And out of the two (Python and Ruby) that's Ruby. (With a few exceptions like, e.g. machine learning, where you don't really have a choice.)

Re: An Ode to Ruby

#27

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.

Re: An Ode to Ruby

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

Nope. Can't stand that Python uses built-in functions for basic things like list, map, fold, etc... instead of methods on base classes. Here's a super basic example. Add one to an array [1,2,3] and print results.

Python: print(list(map(lambda x: x + 1, [1,2,3])))

Ruby: print [1,2,3].map {|x| x + 1}

So much more readable, easy to write, etc... Ruby keeps it consistent by making pretty much everything an object and you just call methods. Even Haskell has dot notation to chain functions since it's just so much easier to read and write...

Re: An Ode to Ruby

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

Really depends on what you mean by "simple". "Simple" is one of those descriptors that gets tossed around a lot in programming by rarely with a clear definition.

Python is a "simpler" language with its preference for "one obvious way", and it does tend to support fewer paradigms than Ruby. Ruby is a more complex language, supporting many approaches. But if you are familiar with the various approaches, that can be "simpler" if it allows you to choose the most fitting approach for whatever problem you have at hand.

To put it another way, "simple" can mean "the language is small/has an obvious way it wants you to do things", or "simple" can mean "the language is flexible enough to be used to model your problem in the most appropriate way". Python is the first kind of simple, Ruby is the second.

IMHO Ruby is much more expressive than Python, and the stdlib is better designed and less crufty. Ruby really has one of the best stdlibs around, I think, and a lot of languages could learn a lot from it - particularly the design of `Enumerable`.

So I prefer Ruby when I have the choice. Part of that is probably just familiarity, but I've been a full time dev on both Ruby & Python projects for long stretches of time so I think I'm in a decent position to compare them. My personal preferences/taste is another aspect, of course, and there's no objective accounting for that.

The case where I often will prefer Python is if I'm scripting something that needs some degree of portability. If you pick a random Linux box it's much more likely to have some version of Python installed than Ruby, so if I'm writing something that should be easy to copy to a box and use without additional setup, I'm more likely to pick Python.

Re: An Ode to Ruby

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

Personally I think writing Python is like writing maths, writing Ruby is like writing English.

Depends which one you prefer.

Post reply on HN