Live data from Hacker News

Ruby 3.0 Preview 1

ruby-lang.org

131–140 of 207 posts

Re: Ruby 3.0 Preview 1

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

The "line noise" aspect of Perl never bothered me, because I'm already a heavy user of regexes. The cause of my misery was Perl's "There Is More Than One Way To Do It."

Re: Ruby 3.0 Preview 1

#132
post #32

Earlier quoted context omitted.

In theory the scheduler should be similar to NodeJS and Ractor should be similar to Go if they’re both applied correctly.

Isn't Ractor based on the Actor model and not CSP?

Ractor is "actor-like" and looks a bit like a mix of both Elixir/Erlang and Go.

Re: Ruby 3.0 Preview 1

#133

Earlier quoted context omitted.

>.NET went with non-standard SQL-like names (select/where) […] Which names do you believe are standard?

`where` is intuitive as a synonym for `filter`, but it's the `select` that always threw me as a synonym for `map`. I get that they're trying to expose an SQL-like API, but yeah, map is always about mutation, but `select`only does mutation sometimes in SQL.

Map doesn't mutate, it returns the result of applying a function to the (possibly immutable) value. I believe you can also, say, `select icolumn * 2 from table`, where `icolumn * 2` provides precisely the same functionality as the function passed to a map.

Re: Ruby 3.0 Preview 1

#134

Earlier quoted context omitted.

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

Explanation: https://threeifbywhiskey.github.io/2014/03/05/non-alphanumer...

Re: Ruby 3.0 Preview 1

#135
post #130

>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…

Happy someone else echoes my sentiment too, especially when Ruby seems to be beloved by everyone around. So many ways of doing the same thing; unnecessary cognitive burden for both reading and writing.

Best practices are extremely common in Ruby. Something I long missed writing JS which only came about as the language started to really mature with ES5/6. Ruby seemed sufficiently mature and sufficiently best practiced in basic training and widespread usage where it wasn’t a problem.

It’s not anything like C++ or C where the whole coding practice and culture changes depending on your framework (like using Unreal or doing Linux programming). The best practices were the same across the board.

Basically my experience with writing it for a decade doesn’t match these critiques. The quirks in Rails were easily ironed out among intermediate developers. It’s not like it requires advanced programming knowledge to just do what everyone else is doing, which is often share in best practice documents and popular libraries/tutorials/books or (less so) rubocop style plugins.

Re: Ruby 3.0 Preview 1

#136

>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…

I would never share a Ruby code base with anyone either. It’s like issuing kindergartners a can of silly string and asking them to be sensible with it. I consider myself a sensible developer, but even I’ve had some childish moments with Ruby: doing something I thought was clever and productive but which really just made my code inscrutable and unmaintainable... ... by other people . The flip side is I can just about…

Why wouldn't you share your Ruby code with others? As a Ruby developer I an assure you, us Rubyists can work and understand each other's code.

Re: Ruby 3.0 Preview 1

#137

I have mixed feelings. I'm not a fan of rightward assignment because I don't see much value and now the => operator has even more meanings. I'm not a fan of endless methods because how lazy do you have to be to not want to type 'end'? My editor does it for me automatically. Now there is even more parsing.

JS has already adopted the endless style and it’s obvious when to use it and where a single line adds needless complexity. It’s really an overrated barrier to entry with a high return value in code simplicity (particularly aesthetically, which goes a long way with Ruby).

I have no comment on the rightward bit though. That is more... radical. Until I see how it is adopted generally.

Re: Ruby 3.0 Preview 1

#138
post #85

Earlier quoted context omitted.

Original source here, by the way: https://www.ruby-forum.com/t/conventions-in-ruby-and-the-pri... All of those things are "dangerous" in this sense. It is arbitrary, but that's how Ruby works; there's a gray area shared understanding of concepts. The "principle of least surprise" is literally about Matz, and Matz alone. Yes, something may be surprising to you, or not, but it's not about you. This shared taste/underst…

I have also strayed away from Ruby so I'm out of touch too. The arbitrariness helped get me into Ruby and helped get me out. It's cool if that's your sort of thing but as I get older I'm starting to dislike arbitrary things more and more. Anyway, I didn't realize who I was replying to when I replied to your first comment. I've seen a few of your presentations and read a lot of your work and I'm a fan.

I think we're all really great in cherry-picking something lacking in a language and then describing the whole eco-system as bad. What language are you using now? Were there seriously no bad design decisions made in said language?

Re: Ruby 3.0 Preview 1

#139
post #66

This is all great stuff. I’m rather meh on RBS, mainly because separating types from code is less than ideal but I like the potential here. But the right hand assignment operator. What on earth. Nobody asked for that and nobody wants it. Why.

The examples given were all things that would be nice to do in the REPL. What I don’t understand is why not just define it in the repl, then, like ‘_’.

Because changing or pre-processing the language syntax is far beyond the scope of any REPL. Assigning the latest return value to a variable named '_' is very straightforward and does not require dealing with the syntax.

Re: Ruby 3.0 Preview 1

#140

Earlier quoted context omitted.

I only ever tried out a rails tutorial once, and coming from a C/C++ background, but having used with many languages, too many things felt like magic back then, but no further experience with the language itself, so can’t really judge it. However, now I’m on the operational side of things, and there are 2 types of applications I avoid to deploy/maintain, mainly because of their runtime: Java and Ruby apps. It’s very…

Reminds me of http://harmful.cat-v.org/software/ruby/rails/is-a-ghetto . "The main Rails application that DHH created required restarting ~400 times/day. That’s a production application that can’t stay up for more than 4 minutes on average." Not that Ruby = rails

And yet, Basecamp is a successful company. So that tell us that crashing 400 times a day is not a problem in itself.
Post reply on HN