Live data from Hacker News

Ruby 3.0 Preview 1

ruby-lang.org

111–120 of 207 posts

Re: Ruby 3.0 Preview 1

#111

>Rightward assignment statement is added. >fib(10) => x This is exactly the kind of stuff I hated when I had to work with ruby in my last gig and why I will never accept a job using it again - soo many pointless and inconsistent ways to do the same thing ... they have method aliases for collection operations like map/filter in standard library ! .NET went with non-standard SQL-like names (select/where) and I'm not a…

In a sense Ruby is sort of a cleaned up Perl but maybe not cleaned up enough.

I fell totally in love with it almost 20 years ago but these days I think we have better languages to choose from even if their ecosystems aren't always as rich.

Re: Ruby 3.0 Preview 1

#112
post #59

>Rightward assignment statement is added. >fib(10) => x This is exactly the kind of stuff I hated when I had to work with ruby in my last gig and why I will never accept a job using it again - soo many pointless and inconsistent ways to do the same thing ... they have method aliases for collection operations like map/filter in standard library ! .NET went with non-standard SQL-like names (select/where) and I'm not a…

Ruby has been referred to as Smalltalk meets Perl, and the problem of dealing with other people's code is one of the main things that kept me in the past from using Perl on text processing projects. The problem of collaborating in Perl was lessened a lot by adhering to Damian Conway's Perl Best Practices. Is there anything similar for Ruby?

Ruby’s heavier use of key words rather than symbols saves it from the worst of Perl.

Yes, there’s still some symbols, but nowhere near as many.

Re: Ruby 3.0 Preview 1

#113

I left Ruby because the performance and security weren't improving and the community was slowly dying. I delved into Go before that got flooded with newbs, then looked at Crystal and Pony, before settling on Rust and Haskell for most things.

I see comments like this often and I find them deeply confusing. To me, it seems like most of the different programming/scripting languages you've listed excel at completely different things. I would be curious to hear what type of work you're doing where all of these languages have been, in some form or another, appropriate.

Re: Ruby 3.0 Preview 1

#114

Earlier quoted context omitted.

Metaprogramming is an important part of ruby, so method_missing stays.

No, metaprogramming is a stain on software engineering that all ecosystems are moving away from. Except Ruby.

There is no other way to avoid code repetition, it gets you closer to declarative syntax and pretty much every language offers it. Ruby does a little bit more.

Re: Ruby 3.0 Preview 1

#115
post #5

Happy to see developments on the pattern matching feature[0]. [0] https://bugs.ruby-lang.org/issues/16828

How do you intend to use this feature? I struggling to see the value.

Seems like you could use it to turn hashes and arrays into poor man’s sum/product types.

Re: Ruby 3.0 Preview 1

#116
It feels like RBS is for library writers, so that they can ship type information to help the consumers of their library. It’s not really aimed at the consumers themselves — the long tail of casual Ruby hackers like me.

If RBS was for end users, adding types inline with the source code would make more sense compared to the RBS approach: keeping the source file and typedef file in sync.

That might actually be a pretty smart move. At first it seemed inconvenient to have to maintain a separate file for the type information, but maybe this focus on type-checking being made easy for the 90% of us who hack scripts is a much smarter one.

Re: Ruby 3.0 Preview 1

#117

Earlier quoted context omitted.

Metaprogramming is an important part of ruby, so method_missing stays.

No, metaprogramming is a stain on software engineering that all ecosystems are moving away from. Except Ruby.

I take it you have never seen the many ways annotations are abused in Java frameworks like Spring?

Re: Ruby 3.0 Preview 1

#118
post #59

Earlier quoted context omitted.

Ruby has been referred to as Smalltalk meets Perl, and the problem of dealing with other people's code is one of the main things that kept me in the past from using Perl on text processing projects. The problem of collaborating in Perl was lessened a lot by adhering to Damian Conway's Perl Best Practices. Is there anything similar for Ruby?

Ruby’s heavier use of key words rather than symbols saves it from the worst of Perl. Yes, there’s still some symbols, but nowhere near as many.

For what it's worth, non-alphanumeric Ruby is Turing-complete: https://ideone.com/55WtMM

Re: Ruby 3.0 Preview 1

#119
post #21

My thoughts: - RBS: meh... might get more useful in the future (in 2-5 years maybe). - Ractor: Wohooo! I'm writing a DAG library where I was thinking of implementing something like this, good to know I can use it and get real parallelism on top. - Scheduler: :shrug: don't know about this one, might be relevant with future concurrent ruby code, any ideas? - Rightward assignment: it's a bit awkward but I see the use ca…

> - Endless method: this one is cute, I love it! It's a weird name for it. It should probably be called something like 'equational method definitions'

It's a bit of whimsy from the originator of that feature:

https://bugs.ruby-lang.org/issues/16746

Re: Ruby 3.0 Preview 1

#120
post #98

>Rightward assignment statement is added. >fib(10) => x This is exactly the kind of stuff I hated when I had to work with ruby in my last gig and why I will never accept a job using it again - soo many pointless and inconsistent ways to do the same thing ... they have method aliases for collection operations like map/filter in standard library ! .NET went with non-standard SQL-like names (select/where) and I'm not a…

But that's what I love about Ruby! There's so many great ways to express logic, making Ruby a language that really rewards exploration. Of course, when working with a team on a production application, you'd set up standards everyone can agree on and understand with rubocop or prettier-rb (which I loathe and will not touch with a 10-foot long pole for my personal projects). That's also great for onboarding newcomers -…

> you'd set up standards everyone can agree on and understand with rubocop or prettier-rb

Things like that just often lead to bikeshedding. And then worse, powerful voices may approve ideas that work for them and not everyone else, or even more worse crippling a language to be too safe or bland to be truly useful.

I got into an argument a couple weeks ago whether an unprotected eval() in python should make it's way into production code of a fortune 500 company. The coder's argument was that, "Well the language has it so why not use it?"

"Because with great power, comes great responsibility..."

Post reply on HN