Live data from Hacker News

Where is Ruby Headed in 2021?

bignerdranch.com

191–200 of 360 posts

Re: Where is Ruby Headed in 2021?

#191

Earlier quoted context omitted.

Ok, but Objective-C also does messages and most of them are defined statically and can be easily searched for in a codebase. I’m not saying Ruby needs header files to send messages to something, but being able to figure out where the code for something is isn’t off the table for languages with dynamic dispatch and it can come in handy.

For that, there's object.method(:name).source object.method(:name).source_location but frankly this is still thinking in a rigid mindset that suits other languages better. Ruby isn't just "dynamic dispatch"; a typical metaprogramming technique handles all incoming calls without named methods, or by dynamically writing the code. To put it bluntly, assuming there's a method on the other side of your message, is practic…

The best features about this bridge are that it's made out of soap bubbles and it doesn't necessarily span the river at any given time. This flexibility is wonderful.

Re: Where is Ruby Headed in 2021?

#192

This is really cool. I’ve used a number of languages and dabbled in a few frameworks but nothing I’ve used brings me joy like ruby does. I approach programming creatively. I think in large systems and architecture. Ruby allows me to skip worrying about the details. Code blocks abstract away thinking about loops and just focus on data. Just about every array operation I could want is there, waiting for a code block. I…

> I’ve tried python, but I end up having to deal with the mess of importing modules

It's funny, the fact that Ruby doesn't have a facility to import modules is one of my biggest gripes with it. Instead of importing into a specific scope, the global namespace becomes a dumping ground for anything that has ever been loaded, and you need something like Zeitwerk to do auto-loading for you. Which I guess can be seen as a convenience initially, but it makes things harder to manage as your app grows in complexity.

Re: Where is Ruby Headed in 2021?

#193
post #184

I think this article missed a key element of where ruby is going: developer productivity tools. It is kind of hinted at with static typing, but the real story behind a lot of what happened since ruby 3 was released has been the tools and IDE plugins around it. Static Typing via RBS is also the existing LSP integration + VSCode plugin, the Typeprof plugin which allows scaffolding .rbs files for untyped modules, and th…

> but above all, a debugger one can integrate with docker and IDE.

Can you expand? We have a kubernetes setup at work and I can't do binding.pry locally to get a breakpoint! (the containers aren't running on the developer's machine just clarifying). I was wondering what it would take for us to have breakpoints at work.

Re: Where is Ruby Headed in 2021?

#194

Earlier quoted context omitted.

Do you have any specific examples of things that make JS nice that have been lost because of the popularity of TS? As with types in Ruby, I was under the impression nothing was really lost as TS could be added incrementally as developers saw value. I don't think I've talked to anyone who has gotten "over the hump" with TS and felt like they were missing something from JS - I may be in a bubble though. It's almost fru…

The dynamic nature of JavaScript is lost when using TypeScript. Although TypeScript can be added incrementally, in practice I've only seen it totally replace JavaScript. While I do believe more people prefer TypeScript over JavaScript, I think it's because those people never deep dived JavaScript or bothered to learn it enough to see how powerful it really is. There are also people that just prefer typed languages an…

Why the downvoting? You somehow upset the typed mob I guess...

Re: Where is Ruby Headed in 2021?

#195
post #76

Earlier quoted context omitted.

A good test suite is better at keeping the code bug free. Not needing types is another benefit of good testing. That's my experience, at least.

I don't think that static typing obviates the need for tests. However: * Static typing catches many kinds of bugs earlier by simply not allowing you to write incorrect code in the first place. * No matter how good your test suite is, you're still putting the burden on the human to always remember to write tests for corner cases. * Static typing allows you have to write many fewer tests by making invalid data unrepres…

> Static typing allows you have to write many fewer tests by making invalid data unrepresentable. You don't have to write millions of unit tests of the type "what if this list is empty" if the function literally can't accept an empty list.

We just don't write these kind of tests on our Rails codebases and we are fine. The world hasn't exploded yet anyway. If some piece of code is super tricky and sensitive then sure maybe then (though I have yet to see such a test case I think), but as a rule? No.

Re: Where is Ruby Headed in 2021?

#196

Earlier quoted context omitted.

1. What's wrong with C#? 2. What made JS uniquely nice? I wanted to leave these questions entirely open to answer, but I'll add my own opinion on (2) because I feel compelled: nothing, JS is quite possibly the worst language ever designed. Certainly the worst in widespread use.

Why is JS one of the worst languages ever designed? I've used many languages and JS is one of the better designed ones in my opinion.

What is [] + [] in JavaScript?

Re: Where is Ruby Headed in 2021?

#197

Earlier quoted context omitted.

Why is JS one of the worst languages ever designed? I've used many languages and JS is one of the better designed ones in my opinion.

>Why is JS one of the worst languages ever designed? Implicit type conversions. Function scoping. Null and undefined, what is the difference? Accessing an undefined variable doesn't throw an exception. Assigning to an undefined variable without var puts it in the global scope. No integer type. I could go on and on. The only reason it has become successful is because it has a monopoly in the browser.

My favorite recent discovery is calling a js function with too many or too few parameters. It'll just go ahead and do it.

Re: Where is Ruby Headed in 2021?

#198

Earlier quoted context omitted.

I think this is actually a very efficient way of programming. but it doesn't scale in project size and team size. Similar for Lisp. This is why these languages are really good for prototyping, but not as good anymore for big, longterm projects imho. That's also why I don't think it's a great idea to add types etc. to programming languages like python or ruby. They are not made for this and they should focus on what t…

This is just not true. There are several multi-Billion dollar public companies with millions of users and thousands of employees built on Rails. In fact, the philosophy of convention over configuration et all makes Rails MORE scalable and easier to onboard new people than anything else out there that I’ve seen.

Well, you'd better not check what happened to all those Rails apps when those companies grew.

There are soooo many blogs about migrating away from Ruby, adopting Go, Scala, whatever statically typed thing.

There's a reason even Ruby is getting a proper static type system.

Re: Where is Ruby Headed in 2021?

#199

Earlier quoted context omitted.

I'm not the person you're responding to, but I would say: "yeah, but it'd probably be bad practice." What would you be testing for, exactly? That `SomeClass#some_method` raises a `NoMethodError` when you pass it the wrong thing? You could test for that, but I don't think that would be a good use of code or your time. If A is passing the wrong things to B, your specs will fail anyway on that `NoMethodError` once B tri…

My experience with a medium-size but long timespan project was the two things you mentioned a bit dismissively are actually pretty massive time sucks. People are terrible at stubbing, and refactoring without types is painful. The vast majority of my Ruby experience is within Rails, so maybe that's a contributing factor? Having types not line up at various boundaries (DB/API/reading from a file) is already a pain, but…

> Having types not line up at various boundaries (DB/API/reading from a file) is already a pain

That's not really accurate - Postgres (for instance) types ARE mapped to Ruby types whenever you read something from the database, just like they are being mapped to Java types or any other language. I guess you mean you can have inadvertent type coercion where a Ruby string is saved into a PG numeric column or something?

Anyway for super sensitive code (let's say payments/prices) you can work with DRY types or Sorbet or any other solution. As a rule it's quite rare that I actually see these problems. Can they occur? Sure. Do they happen so often I wish I was using C++? No. In fact I can't even say it happens more than once a year that I see this type of bug.

Re: Where is Ruby Headed in 2021?

#200

Earlier quoted context omitted.

Elixir and Phoneix are more popular than ever, especially with the release of LiveView. The ecosystem and community continues to absorb refugees from Ruby and other stacks. It's such a better platform than Ruby and Rails that I won't bother writing about it here - there are already hundreds of blog posts about it. Productivity is at least on par with Ruby (I believe better) and performance on another plane of existen…

Sorry that really doesn't add up to what I see when I look at job boards, Elixir has really poor numbers. The Ruby guys who wanted to jump ship to Elixir already did so a few years ago (some of them will continue to jump ship from Elixir to Rust or Go because hey why not). So I don't know where new growth will come to Elixir. It's not just jobs, by any metric you can think of Elixir is an obscure tech, if you want I…

You’re right. Software development has devolved into a popularity game.
Post reply on HN