Live data from Hacker News

Do I not like Ruby anymore? (2024)

sgt.hootr.club

141–150 of 184 posts

Re: Do I not like Ruby anymore? (2024)

#141
post #11

Back when autocompletion and stuff were only available in Visual Studio/Xcode/Other bug IDEs, I was forced to use Ruby and fell in love with it. It didn't matter what I used as my editor was Sublime. But when VSCode came and language features became democratized, I never touched a type-less language again. Why should someone opt for a language with absolutely no features where one can have autocompletion, typecheckin…

I think Ruby is really great at what it tries to do. The only "problem" with it is that python kind of sucked the air out of the room and ruby got shoved into a little niche.

These languages are really quite similar in many ways, but their domains ended up diverging. With python becoming the layman / scientific / learning language of choice, ruby has been pigeon holed into mostly web development.

Both are really easy to pick up and learn for somebody unfamiliar with CS concepts and I personally find the ruby syntax far more intuitive.

We have a lot more options now. For a while people tried to use python and ruby as glue / systems programming languages, but with golang and rust you have really good and more performant options in that space. And as you say the tooling has improved massively, so the hurdle of moving on to a more "rigid" language is less than it ever was.

I still really like ruby, and I think rails is still a powerhouse due to solving so many real world problems in a really complete package, but the lack of adoption outside of that niche has left it dwindling in popularity.

Re: Do I not like Ruby anymore? (2024)

#143
post #74

Earlier quoted context omitted.

As someone coming from Ruby to TypeScript, I find types cumbersome, verbose, complex, and not of much use. I have been writing and reading TS for the past six months. What am I missing?

Types really start pulling their own weight as the size of an application increases. In order to catch problems in dynamic type languages you end up needing a bunch of additional tests to, ironically, verify the expected type. And even then, those tests don't and can't tell you how a method is actually used throughout the program. Consider the following class class Human def initialize(name) @name = name end end Now…

It’s an interesting example, knowing when to make a breaking change is really tricky in codebases like these.

You could avoid it by leaving “name” and just adding the additional fields. Maybe that’s the “right” thing to do if you have a ton of consumers and spotty test coverage. But if there’s a lot of fragile code out there (parsing “name” in subtlety different ways, etc.) it’ll never be fixed/improved. Things can get gnarly over time because there’s multiple ways to do something, and everything starts to feel like “legacy code”.

I tend to think that for private codebases, it’s important for breaking changes to be easy.

Re: Do I not like Ruby anymore? (2024)

#144

Earlier quoted context omitted.

It's not Ruby, it's your code... :D class Mess OUTPUTS = { 1 => ->(i) { i.odd? ? "odd" : "even" }, 2 => ->(_) { "trying" }, 3 => ->(_) { "other" } }.freeze def chaos(x) return puts "negative" unless x.positive? [1, 2, 3].each do |i| puts OUTPUTS[i]&.call(i) || "other" end end end

And I have no idea why HN messes up my class statement... it looks good in the text field :D

Did you start it with two spaces? That's how HN does code blocks. Two spaces added before each line. The other lines look fine because they were already indented, add two spaces before all of them and it'll look fine.

Re: Do I not like Ruby anymore? (2024)

#145
post #92
post #89

Earlier quoted context omitted.

You haven't used many screwdrivers if you don't hate some of them for stripping screws, slicing your hand etc. Likewise, other ones exist that make jobs super easy - be they having a ratchet, or quick change of bits, etc Programming languages seem to be a pretty good parallel. Though, I don't see why Python in particular would be hated . It has its bullshit, but it's workable.

I have used many of them. Some of them are easier to use but all of them were useful at some place and time. I still don't understand how anyone can hate a tool. Dislike maybe, but some people really hate some tools with a passion.

This comparison doesn't make much sense. When a person chooses a language for their project it implies a long term commitment. And all the headaches that follows for years to come. It's unlike a screwdriver, which can be easily replaced in the matter of hours.

Re: Do I not like Ruby anymore? (2024)

#146
post #11

Back when autocompletion and stuff were only available in Visual Studio/Xcode/Other bug IDEs, I was forced to use Ruby and fell in love with it. It didn't matter what I used as my editor was Sublime. But when VSCode came and language features became democratized, I never touched a type-less language again. Why should someone opt for a language with absolutely no features where one can have autocompletion, typecheckin…

[deleted]

Re: Do I not like Ruby anymore? (2024)

#147
I started my programming journey with VB6. Ruby reminds me of Visual Basic. But its never evolved past that. Python became popular because it was a scripting language that had classes and a nice built out framework of features. But it has a god awful syntax and should never be used for a large project. Also their package management is a dumpster fire.

This brings me to C#. At .NET 10 there will be another option then python. .NET 10 brings the ability to run C# script files without the need for a proj file or a main method. This will bring the full .NET Framework and NUGET eco system with it. I can't wait to replace all my python scripts with this.

Re: Do I not like Ruby anymore? (2024)

#148
post #39
post #21

Earlier quoted context omitted.

So your suggestion to the TA is to ask literally the exact same question but slightly different?

One question is encouraging, the other is discouraging. That matters a lot in an educational setting. And they aren't the exact same question.

As someone who spent a fair chunk of time as a TA for comp-sci classes...

If you're in my room asking me how to change the keyword for "if"...

"why would you want to do that?" is entirely the appropriate answer.

---

Not because the concept of modifying the language itself is necessarily bad, but because the structure of the relationship here isn't neutral. The students in the class are here asking me questions that almost always relate to homework, exams, projects, or tasks.

From experience - You usually see this type of question when the student is actually trying to accomplish some other goal, and can't figure out how to do it.

So "Why would you want to do that?" is not dismissive... it's goal seeking.

help me understand the goal you have in the context of the current work that you are seeking to accomplish by modifying the "if" keyword. Until I understand what you're working towards, it's hard for me to appropriately scope my answer.

Further... I'm not really paid to spitball conceptual language design with you (fun though it may be!). I'm here because a large chunk of the students in the class are genuinely struggling and need basic assistance understanding the existing class concepts.

Re: Do I not like Ruby anymore? (2024)

#149
post #45
post #11

Back when autocompletion and stuff were only available in Visual Studio/Xcode/Other bug IDEs, I was forced to use Ruby and fell in love with it. It didn't matter what I used as my editor was Sublime. But when VSCode came and language features became democratized, I never touched a type-less language again. Why should someone opt for a language with absolutely no features where one can have autocompletion, typecheckin…

Static type-signatures are inevitable in general. You can see this by how even the Ruby documentation has to make up silly ad hoc notation like "→ array_of_strings", "→ matchdata or nil" etc. (Random example): https://docs.ruby-lang.org/en/3.4/String.html#method-i-lines

That's just documentation tool but the method is actually already statically typed by ruby.

I'm not sure why they don't link that in the documenation but I beleive it is something the RDoc mainer wants to do.

  def lines: (?string? separator, ?chomp: boolish) -> Array[String]
           | (?string? separator, ?chomp: boolish) { (String line) -> void } -> self
https://github.com/ruby/rbs/blob/master/core/string.rbs

Re: Do I not like Ruby anymore? (2024)

#150
post #73

Ruby is such an elegant language, but the strong and ongoing hostility to any sort of sensible gradual typing is a real mistake. I know that the Ruby community loves its clever runtime metaprogramming, but even the most metaprogrammed codebase is still going to consist mostly of plain old in-out methods. And as anyone who's ever typed a dynamic codebase knows, you pick up so much low-hanging fruit, in terms of edge c…

> Ruby is such an elegant language, but the strong and ongoing hostility to any sort of sensible gradual typing

I'm not sure what you're basing that on, gradual typing has been built into Ruby since 3.0 (2020). Sorbet can around a bit earlier in 2019.

There is on going work to improve both with RBS-Inline support now in Sorbet with runtime support hopefully on the way.

IRB uses RBS for autocompletion and Solargraph and Ruby-LSP both support it.

I would say there is no hostility to gradual typing in the Ruby community. Quite the opposite, people are being paid to work on it.

Post reply on HN