Live data from Hacker News

Ruby 3.4 Highlights

blog.sinjakli.co.uk

41–50 of 86 posts

Re: Ruby 3.4 Highlights

#41
post #24

Earlier quoted context omitted.

Did you know you were going to use Ruby before Applying? Just wondering.

Yup. I don't mind switching languages, I've done it a few times and I enjoy learning new things. The market for ruby seems to have good salaries and job satisfaction despite being smallish, so it didn't seem like a bad area to get some experience in. Why, is there any issue with the choice I'm not aware of?

>Why, is there any issue with the choice I'm not aware of?

No, not at all. I was just interested since there is a sudden influx of people joining Ruby ( I guess mostly Rails ) companies without previous Ruby background. As I have notice this across HN, Reddit, Twitter and elsewhere. And yes Ruby market tends to be on the slightly higher end because they mostly hire people with years of programming experiences and lack of junior position. And there used to be complains about not being able to find people with Ruby / Rails experiences etc. So it is a good market shift I guess.

Re: Ruby 3.4 Highlights

#42

The author also forgot to mention that the new error output doesn't mix ` and ' anymore. Ruby 3.3 > 'asd' + 1 (sitar-report):1:in `+': no implicit conversion ... Ruby 3.4 > 'asd' + 1 (sitar-report):1:in 'String#+': no implicit conversion...

This has bothered me for decades, why was this ever the case to begin with?

I'd presume it's the same motivation behind quotes in TeX (`foo' and ``bar'')—maybe typewriters didn't use to have true curly quotes, or something?

EDIT: https://en.wikipedia.org/wiki/Backtick#As_surrogate_of_apost... seems relevant

Re: Ruby 3.4 Highlights

#43
post #18

Earlier quoted context omitted.

I wish I could reach for Kotlin as a kind of "Ruby with typing out of the box" but the lack of a good REPL is a real dealbreaker.

You'll get Ruby with typings soon when rbs-inline is finalized

Is that really something that's been slated to be added to the language proper? I attended RubyConf and in his keynote Matz seemed pretty opposed to adding types to Ruby source, and argued in favor of automatic typing instead.

Re: Ruby 3.4 Highlights

#44
post #31
post #12

Earlier quoted context omitted.

At my day job we use Ruby with Sorbet to stitch together a large number of data engineering pipelines. It's a good choice since we also often stand up small Rails apps to expose the results from those pipelines, so we can keep everything in one language. The fluent functional approach it enables is pretty nice for that business logic (but I would not want to do it without the gradual typing on top). We do find oursel…

Oh nice! I haven't used Sorbet yet, but this is the second time I've heard good things about it outside of Stripe (where it originated). I'll have to give it a proper look.

I think they direct people to tapioca by default at this point, but that was key to making it a smooth process for us.

Re: Ruby 3.4 Highlights

#45

Is ruby used outside of web dev (i.e., Ruby on Rails)? it seems like a nice cute language but I almost never hear about it.

I think it's quite sad that Ruby is so associated with Rails. Ruby is one of my favorite languages and last time that I touched a Rails code was in 2017. Even in web dev Rails is not the only thing in Ruby, there's also Sinatra which is an elegant micro-framework for building HTTP APIs, similar to Flask. Some projects that I remember that uses Ruby that are not related to web dev: Homebrew, Metasploit, Vagrant and Je…

I got into Ruby kind of early, around 2001. When Rails initially came out a few years later (circa 2004, IIRC) I remember being excited to see something putting Ruby out there giving it some publicity. But in a few years I think a lot of us were regretting the fact that most people's view of Ruby was formed by Rails.

Re: Ruby 3.4 Highlights

#46

The default block parameter name seems small, but I feel like I'm gonna use it all the time, especially when I'm in the Rails console just trying to debug data

I constantly run into situations where I need to nest an iterator computation, and things like "it" get confusing. I'm all for adding language features to avoid boilerplate, and it's clearly useful. I just want to call out that anonymous typing can be polarizing in large codebases and maybe only use it sparingly.

nested_example = [1, 2, 3, 4, 5].map do

  [it, (1..it).map { it * it }]
end

Has an ambiguity, so you just add |x| to one of them..

nested_example = [1, 2, 3, 4, 5].map do |x|

  [x, (1..x).map { x * it }]
end

Seems like a mental over complication of a non-issue to me.

Re: Ruby 3.4 Highlights

#48

The default block parameter name seems small, but I feel like I'm gonna use it all the time, especially when I'm in the Rails console just trying to debug data

I was disappointed that "block parameter name" wasn't the ability to give a block an actual name that will show up in a stack trace. It's been an endless source of frustration when your stack trace is just a bunch of anonymous blocks and procs. I assume JS devs feel a similar pain with anonymous functions.

Re: Ruby 3.4 Highlights

#49

Earlier quoted context omitted.

I think it's quite sad that Ruby is so associated with Rails. Ruby is one of my favorite languages and last time that I touched a Rails code was in 2017. Even in web dev Rails is not the only thing in Ruby, there's also Sinatra which is an elegant micro-framework for building HTTP APIs, similar to Flask. Some projects that I remember that uses Ruby that are not related to web dev: Homebrew, Metasploit, Vagrant and Je…

Congratulations on getting Matz to tweet about your post.

Thanks! I never thought this would reach him!

Re: Ruby 3.4 Highlights

#50

The author also forgot to mention that the new error output doesn't mix ` and ' anymore. Ruby 3.3 > 'asd' + 1 (sitar-report):1:in `+': no implicit conversion ... Ruby 3.4 > 'asd' + 1 (sitar-report):1:in 'String#+': no implicit conversion...

Is the stack trace in the section "Clearer exception backtraces" actually from 3.4? It has mixed backticks and single quotes.

Fixed! I grabbed that example from the bug tracker issue where the change was discussed and that wasn’t based on a version where the backtick change had been made.
Post reply on HN