Live data from Hacker News

Ruby 3.2.0 is from another dimension

tomaszs2.medium.com

241–250 of 341 posts

Re: Ruby 3.2.0 is from another dimension

#241

Earlier quoted context omitted.

I disagree. I perceive no difference in elegance between the two languages nor a particular “cobbled together” aspect to Python.

I use Python every day and I like it. However, functional semantics are not elegant at all IMO. Using list() and map() all over the place is not cool, and like many others say, list comprehensions, though concise, are not always that readable (and I say this as someone who reads and writes plenty of them). Lambdas are not great, either. In Django in particular, async feels like an afterthought, compared to other fram…

Python lambdas are not great but Ruby not having first-class functions is also not great. Neither are perfect and there is no syntactic reason outside of variations of personal taste to choose one language over the other.

There are a boatload of compelling reasons to choose Python for its libraries and documentation and adoption level, though.

Re: Ruby 3.2.0 is from another dimension

#242
post #222
post #164

Earlier quoted context omitted.

I think you're spot on. Ruby actually gained wider appeal only when it gained visibility in the US (via rails). Being present in the markets which drive adoption matters more than being consistent, which python isn't ("one way of doing things" is mostly a meme nowadays, everyone touching python knows it's fake).

PHP got popular coz it could get barely code-literate HTML/CSS web designer to write a dynamic app, and host it easily Ruby got popular coz Rails could get barely code-literate graduate to write CRUD app and so it was cheap (famous 15 minutes to blog tutorial) for companies. JS got popular coz, well you ain't got fucking choice on frontend and having your then-frontend JS/HTML/CSS designer be able to also do backend…

I'm gonna disagree with

"Ruby got popular coz Rails could get barely code-literate graduate to write CRUD app and so it was cheap (famous 15 minutes to blog tutorial) for companies."

That's not what happened, instead Ruby got popular with advanced web developers working in Java who saw that Rails was had better answers than J2EE. If you were barely code-literate graduate you wouldn't recognize that Rails was offering new unique ways doing things.

The 15 minute blog tutorial wasn't really indicative of what Rails was like, just a small sample about how it was different.

It was an advanced tool for advanced users with a long learning curve that eventually paid off in better productivity.

Re: Ruby 3.2.0 is from another dimension

#243

Earlier quoted context omitted.

> ruby today is pretty fast Ruby today is slow as hell, but not as much as slower than other slow as hell languages as Ruby used to be.

did you benchmark Jruby or TruffleRuby? Did you compile c-ruby with jemalloc? Normally the "ruby is slow" argument, is based on not being involved with ruby and solving real problems with it. Some people will just LOL this argument even harder if you add development time and code maintenance costs on that equation.

> did you benchmark Jruby or TruffleRuby? Did you compile c-ruby with jemalloc?

Jruby a little faster than CRuby (it used to be more significantly faster, but CRuby has seen more recent performance increase); TruffleRuby is, OTOH, not slow like other implementations.

> Normally the "ruby is slow" argument, is based on not being involved with ruby and solving real problems with it.

Ruby is abstractly my preferred language, and I’ve done a fair amount in it, though I don't get to use it as much in anger because of issues other than its speed (ending up using another slow language as my main day to day.)

> Some people will just LOL this argument even harder if you add development time and code maintenance costs on that equation.

That’s just equivocation; time and cost to market is an orthogonal concern to execution speed, not a component of it; yes, Ruby has a decent code-writing experience, especially for small systems.

Re: Ruby 3.2.0 is from another dimension

#244

Earlier quoted context omitted.

I use Python every day and I like it. However, functional semantics are not elegant at all IMO. Using list() and map() all over the place is not cool, and like many others say, list comprehensions, though concise, are not always that readable (and I say this as someone who reads and writes plenty of them). Lambdas are not great, either. In Django in particular, async feels like an afterthought, compared to other fram…

Python lambdas are not great but Ruby not having first-class functions is also not great. Neither are perfect and there is no syntactic reason outside of variations of personal taste to choose one language over the other. There are a boatload of compelling reasons to choose Python for its libraries and documentation and adoption level, though.

I didn't know Ruby didn't have first-class functions but that's already a massive no for me. You don't need to convince me regarding Python though - it's too convenient to pass up. And despite its shortcomings it's certainly not a language devoid of elegance like some in this thread are painting... Like the old adage goes, there's the languages nobody uses, and there's the languages people talk shit about. Or in simpler terms, as seen in this thread: "everything I don't use is utter shit".

Re: Ruby 3.2.0 is from another dimension

#245
post #108

Earlier quoted context omitted.

> They did apparently manage to make their interpreter figure out where mismatched "end" statements are most likely to be, which was one several serious pain points for me with the language. Searching for a mismatched/missing _end_ is preferable to having a line or block get accidentally unindented and end up still "working" (running) while producing very confusing results. Moving blocks of code in Python requires gr…

I had over million euro of machinery stop because a rarely reached branch had one line with one less space due to missing linter run. Apparently Python 3 still doesn't fully parse and validate code on load, or somehow it made a valid if nonsense AST out of that.

I know it's offtopic, but this is really a case of using spaces where tabs are the correct choice ;)

Re: Ruby 3.2.0 is from another dimension

#246

Earlier quoted context omitted.

[dead]

Honestly I don’t agree. In my experience Rails easily becomes a rat’s nest of magical code that is nearly impossible to read. A bajillion imports leads to code being pulled in from who knows where.

That's your experience, many think it was a fresh air using Rails than using Java for webdev.

Re: Ruby 3.2.0 is from another dimension

#248
post #187

Earlier quoted context omitted.

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…

> I would argue Python is very consistent in its design, it aims to only have one obvious way to do things This argument is dead the second one stumbles upon the string interpolation/formatting situation. Or the list comprehensions, ew.

For the benefit of those not familiar with the Python string interpolation/formatting situation, I present 4 ways to perform the same string formatting:

    who='World'
    #1 - string concatenation
    'Hello, ' + who + '!' 

    #2 - % operator
    'Hello, %s!' % who

    #3 - format() method
    'Hello, {}!'.format(who)

    #4 - f-strings
    f'Hello, {who}!'

Re: Ruby 3.2.0 is from another dimension

#249
post #128

Earlier quoted context omitted.

Not in the vast majority of practical use-cases anyway. There'll obviously always be the exceptions like Twitter having to migrate off Ruby (Well rails) because scaling is just too hard. But those are exceptions.

My direct experience with combating scaling issues in Rails applications always comes back to Rails itself. (ab)uses of Active record, specifically. And sometimes they're very hard to detangle. After well over a decade of doing this sort of work I'm simply not interested in seeing yet another Rails mess.

I do agree that Rails is often a cause of bad performance.

Not in the first place because of its own, or Ruby's poor performance, but because it's easy to write horrible code, and hard to write nice code in it. AR is a very leaky abstraction over a DB. A horrible query always a mere has_many, sort or default scope away. It's MVC horribly unsuited to manage and isolate business logic. The result often indeed being code that performs terrible.

Re: Ruby 3.2.0 is from another dimension

#250
post #222
post #164

Earlier quoted context omitted.

I think you're spot on. Ruby actually gained wider appeal only when it gained visibility in the US (via rails). Being present in the markets which drive adoption matters more than being consistent, which python isn't ("one way of doing things" is mostly a meme nowadays, everyone touching python knows it's fake).

PHP got popular coz it could get barely code-literate HTML/CSS web designer to write a dynamic app, and host it easily Ruby got popular coz Rails could get barely code-literate graduate to write CRUD app and so it was cheap (famous 15 minutes to blog tutorial) for companies. JS got popular coz, well you ain't got fucking choice on frontend and having your then-frontend JS/HTML/CSS designer be able to also do backend…

> JS got popular coz, well you ain't got fucking choice on frontend and having your then-frontend JS/HTML/CSS designer be able to also do backend is, well, again, easy and cheap.

IIRC, a bigger reason for Node's popularity (at least at the very beginning of its popularity) was the fact that it had event-based I/O, which let a single process handle a lot more in-flight requests than Ruby (where the concurrency model was to spin up a bunch of processes and multiplex across them with nginx or similar).

Post reply on HN