Live data from Hacker News

Ruby 3.2.0 is from another dimension

tomaszs2.medium.com

211–220 of 341 posts

Re: Ruby 3.2.0 is from another dimension

#211

Earlier quoted context omitted.

So, how do you reconcile this opinion with the fact that Ruby can't even do a proper REPL on Windows? It just starts showing weird output, overwriting lines and doubling up other ones... that other language just works. And look, I LOVE Ruby. I come from twentyish years of Perl, and I really like the way Ruby feels when banging out a script but these days, time is in short supply, and I just don't have time to screw a…

If anyone reading this is thinking “why does Windows even matter for development?” then congratulations because you’ve discovered you’re in a filter bubble. Surveys, such as StackOverflow’s ( https://survey.stackoverflow.co/2022/#section-most-popular-t... ) consistently find that > Windows is the most popular operating system for developers, across both personal and professional use. If it makes anyone feel better, I…

I've been doing Ruby on Rails since the early 2.x days. (I dabbled with 1.x, but gave up to let it "age" a little.) For the first 5 years, I was on Linux full time, and it was great.

Then I moved to Mac, and it was almost as great. (The terminal situation and general integration of the command line is still more cohesive in Linux.)

For about the past 10 years, I've been at a standard Fortune 250 Windows-is-the-entire-world kind of place. I've been able to do my work on my personal Mac, but I've always made sure that I can do all of my Rails work on my corporate Windows laptop. There are times my code needs to access file locations and other applications inside the corporate firewall.

Obviously, people are correct that Ruby is not a "first-class" citizen on Windows, but RubyInstaller (https://rubyinstaller.org) has been a lifesaver. Not only does it "just work," and compile all the gems I've used, but it also includes a neat little script that addresses the common "corporate" practice of having to install custom SSL certificates so that IT can decode all traffic going through their firewall. (They install these certs directly into the Windows networking stack, but bundler doesn't use the stack.) The SSL bundle their script creates is also useful for use with Postgres database connections. You just need RubyInstaller, NodeJS, and a better terminal application (or maybe RubyMine), and you're GTG on Windows.

I've tried to use WSL, both version 1 and 2. If you need to support many Rails apps, and switch Ruby versions (with RVM or rbenv), that might be the way to go, but for just one (big) project, I prefer to stay inside the native environment. And even if I were tempted to use WSL, I'd rather just use an actual VM software like VMWare or OpenBox, and control the details of the virtualization myself. YMMV.

Re: Ruby 3.2.0 is from another dimension

#212

Ruby is my favorite language, and often it is a joy to use because of its combined attributes of brevity, expressive power, and feature consistency. It's disappointing that there are so many more jobs for another popular language - one that lacks the elegance and consistency but which has a larger ecosystem. As far as I know, the only well known reason for a company to choose Ruby is if they want Rails (and obviously…

You are obviously referring to Python and so I would like to note a few things. (I have nothing against Ruby) > Ruby ... its combined attributes of brevity, expressive power, and feature consistency. > [Python] lacks the elegance and consistency First I would argue Python is very consistent in its design, it aims to only have one obvious way to do things and so it's easy to guess how apis will work. It also aims for…

> it aims to only have one obvious way to do things and so it's easy to guess how apis will work.

I’ve seen that statement multiple times, but in my experience it’s far from the truth. For every thing I ever had to look up in Python I often found more than one way of accomplishing the same task and all of them were (subjectively) uglier and less straightforward than Ruby.

> on "brevity" and "expressiveness", I don't really see them as an attribute that make a language "better". Sure for experienced developers

It’s an attribute including for inexperienced developers. Perhaps especially for them. Even for something as basic¹ as writing a file, one needs multiple lines of code and know about `with` or opening and closing the file². In Ruby: `File.write("/path/to/write.txt", "file contents")`. One line, immediately understandable.

> that doesn't necessarily translate to code that is ideal when working as part of a team, or code that is easy to follow when a new developer starts on an existing codebase.

Agreed. Though in Ruby I have found myself thinking “I wonder if this keyword will work” and it does exactly what I expected. With Python, the norm is frustration with the impossibility of doing the simplest of things like defining a constant.

¹ From the coder’s point of view, never mind the underlying implementation.

² Failing the goal of one and only one obvious way to do something.

Re: Ruby 3.2.0 is from another dimension

#213

Ruby is my favorite language, and often it is a joy to use because of its combined attributes of brevity, expressive power, and feature consistency. It's disappointing that there are so many more jobs for another popular language - one that lacks the elegance and consistency but which has a larger ecosystem. As far as I know, the only well known reason for a company to choose Ruby is if they want Rails (and obviously…

I love Ruby. Sinatra was actually my entry into using Ruby and recently have been working on a side project with Rails 7.

I work with PHP and Laravel too and after working with Rails 7 for a bit Laravel is like a cheap imitation.

I also work with python a lot and I wouldn't want to do the web work in python as much as I would ruby but I would rather do the data crunching in python.

Re: Ruby 3.2.0 is from another dimension

#214
post #29

Earlier quoted context omitted.

Python gained traction because of Google (Google used it initially then Guido worked for them for a decade+, vs. Matz at Heroku/salesforce) and then because it's the easiest way to use ML libs. That's it. It's slower than Ruby, has worse package management and less consistent syntax but if you want to use Tensorflow, PyTorch, etc..., it's the default.

That's a fairly Silicone Valley focused argument. I don't subscribe to the theory at all that Google closed internal use of Python was instrumental in its adoption. Django was released in 2005 and RoR in 2004. I suspect my journey was similar around then (late 2005), I had used PHP, classic ASP and a little Perl. I was looking for something better, read the tutorials for both Django and RoR. Had a look at what deskto…

> Silicone Valley

I think Silicone Valley is, uh, another type of valley.

Re: Ruby 3.2.0 is from another dimension

#215
post #52

Earlier quoted context omitted.

One aspect in which Ruby is much more consistent than Python: sorted(arr) arr.sort() versus arr.sort arr.sort!

Personally I think the Python syntax make its more explicit which is an in-place sort vs returning a sorted copy. And also what's a method call vs an attribute access. Someone new to Ruby will be WTF is the ! for?

But random.shuffle also operates in place despite being a free function

Re: Ruby 3.2.0 is from another dimension

#217

Ruby is my favorite language, and often it is a joy to use because of its combined attributes of brevity, expressive power, and feature consistency. It's disappointing that there are so many more jobs for another popular language - one that lacks the elegance and consistency but which has a larger ecosystem. As far as I know, the only well known reason for a company to choose Ruby is if they want Rails (and obviously…

I woudn't exactly call it consistent and design decisions are questionable. Even the article-mentioned

    def foo(*)
        bar(*)
    end
is some needless nonsensical bloat, who on earth complained "oh, saying def foo(a) is so 90s, we need to have option to replace it with symbol used for multiplication or pointers in some cases!"

It's mediocre language that happened to have some then-popular web framework written in

Re: Ruby 3.2.0 is from another dimension

#218

Ruby is my favorite language, and often it is a joy to use because of its combined attributes of brevity, expressive power, and feature consistency. It's disappointing that there are so many more jobs for another popular language - one that lacks the elegance and consistency but which has a larger ecosystem. As far as I know, the only well known reason for a company to choose Ruby is if they want Rails (and obviously…

imo, Ruby optimizes for flexibility over consistency in a way that is unpleasant and lends itself to unforced errors.

The Python standard library has never straight up failed on me in the way that Ruby has.

Ruby had buggy named-argument splatting, i.e. func(*kwargs), until 2.7, and even that was a half-realized implementation. It took something like 5 years to fix: https://bugs.ruby-lang.org/issues/11860

I've had similar experiences with Rails.

Re: Ruby 3.2.0 is from another dimension

#219

Ruby is my favorite language, and often it is a joy to use because of its combined attributes of brevity, expressive power, and feature consistency. It's disappointing that there are so many more jobs for another popular language - one that lacks the elegance and consistency but which has a larger ecosystem. As far as I know, the only well known reason for a company to choose Ruby is if they want Rails (and obviously…

You are obviously referring to Python and so I would like to note a few things. (I have nothing against Ruby) > Ruby ... its combined attributes of brevity, expressive power, and feature consistency. > [Python] lacks the elegance and consistency First I would argue Python is very consistent in its design, it aims to only have one obvious way to do things and so it's easy to guess how apis will work. It also aims for…

> Ultimately I think that's why Python has gained more traction than Ruby, it's an "easer" language to follow and start with. Ruby is probably a more fun and intellectually stimulating language to work with though.

Working with various Ruby-adjacent stuff for 10+ years and nothing about Ruby was even "fun" to work with, it was mix of "WTF" and "who designs language like that!".

Python is also not "easier" to start with, I'd put Ruby/JS/Python to be at pretty similar level there. No worrying much about types (till they bite you, inevitably, of course, and cause untold bugs), simple things are simple and actual proper (i.e. "not send it to some piece of C code to calculate) multithreading sucks donkey balls.

Re: Ruby 3.2.0 is from another dimension

#220
post #201

Earlier quoted context omitted.

> Both are bottom of the barrel compared to any compiled language. Scripting languages and compiled languages are used for different things. And you're right, both are slow as hell and speed doesn't really matter for scripting, but when all else is equal, it matters, a lil...

JavaScript is a scripting language but wipes the floor with either (like 25 and more times faster) and can be used to actually do something other than being a glue.

JS was slow before V8. Also TruffleRuby brings Ruby very close to V8 speeds. I just didn't consider that because it's not really a drop-in CRuby replacement.

Also JS is still too slow for most things compiled languages are used for.

Post reply on HN