Live data from Hacker News

Do I not like Ruby anymore? (2024)

sgt.hootr.club

91–100 of 184 posts

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

#91
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?

Typescript is not suitable for all applications. I also transitioned to Typescript from python some years ago and the extra information about "intent" provided by types made a world of difference to me when reading code written by other people. Type information is so valuable in a team of 3+ developers and when a rest api has at least 5+ resources. If your application or team size are any less, the benefits of typesc…

Totally agree. I've found that people who don't understand the value of types are usually solo devs

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

#92
post #89
post #50

> Python is not my favorite programming language. In fact, allow me to drop the euphemism and express my pure, unadulterated thoughts about it: I never liked Python, I see it as a huge red flag and I think the world would be a better place if we all decided to finally move on from it. Why do people make hating a tool their entire personality? I have noticed this same thing with languages like Go ("oh no Go still bad"…

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.

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

#93
post #85

I'm going through the same processes as the author, after about a decade of Ruby I'm writing Typescript, Go and type-hinted Python, and I don't think I want to go back to the lack of namespaces/packages and the lack of typing. And I've actually used Sorbet with Ruby for 2 years, but that seems like a really bad solution to this problem.

What do you think of rbs-inline?

Haven't tried that, but I think adding this from tooling will always lead to friction: "smart comments" are annoying to write.

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

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

Have you given RBS/Sorbet etc a go?

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

#95
post #84
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…

> it’s a shame no language is as beautiful as Ruby [...] I really think it's a bad choice of Ruby not to care for types Do you think Ruby could change something so fundamental as dynamic => static typing and still retain its beauty? The only static typing solution I've seen for Ruby is Sorbet, and it's... not beautiful.

I use RBS/steep with great success to catch plenty of nil issues early, but it's similarly not great from a dev POV to have to maintain a completely separate set of rbs files (or special comments with rbs-inline). Also in my experience, modern editors don't leverage it for typing/intellisense.

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

#96

I'm confused by this post because I think Sorbet satisfies basically all the things the author wants, and my experience with Sorbet has been really good!

It pales in comparison to what the author is talking about, editor support for instance is not good, it took them an awful lot of time to add support for linux-aarch64, it's in general rough around the edges (having to maintain various custom type files for some gems it cannot auto-generate type info for) and in general feels like a chore to use.

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

#97

Earlier quoted context omitted.

All due respect but Typer looks like the kind of library that you want to use after your CLI has enough args that you wouldn't be able to get away with the sort of "Hello World" simplicity that you pine for. Nobody's stopping you from manually parsing a couple of arguments. I still do it all the time and it's OK. If anything the magic of gradual typing is that you get to use it as necessity arises.

Typer is very convenient. I don't believe anyone manually parses arguments manually in Python where we have argparse in the standard library, and Typer is a step forward from that.

I really want to like typer, and frequently go down the rabbit hole of rewriting all my argparse into typer, but I keep getting put off by it's high import cost and that development seems to be a bit up in the air (see https://github.com/fastapi/typer/issues/678#issuecomment-319...). A shame because otherwise it's a really nice library!

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

#98
post #50

> Python is not my favorite programming language. In fact, allow me to drop the euphemism and express my pure, unadulterated thoughts about it: I never liked Python, I see it as a huge red flag and I think the world would be a better place if we all decided to finally move on from it. Why do people make hating a tool their entire personality? I have noticed this same thing with languages like Go ("oh no Go still bad"…

Realistically there is only so much mindshare available, especially if you like the kind of language that benefits from extensive tooling. I miss the days when my preferred language was the #1 option in some spaces and had two first-class IDEs available; my life is genuinely worse now that that's no longer the case.

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

#99
post #74
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…

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?

I have been building web apps for long enough to remember when it was commonplace to SSH (or Telnet!) into the server and just vim index.php. As you can imagine, it was pretty easy to bring the site down like that, so we started doing what is now called Continuous Integration and Continuous Deployment: automated tests as a precondition for deployment.

Later, we adopted static analysis tools and code linters. This helped, but only so much could be done with the dynamically typed languages which were popular in the early internet.

As a self-taught programmer with no college degree, I started with dynamic languages: Perl, JavaScript, PHP, Ruby. I viewed the statically typed languages (and the programmers who could wield them) with reverence and awe. C, C++, Java, these were “real” languages that required big brains, and I should stay in my dynamically typed playpen. But as I matured, my understanding shifted: dynamic languages require hubris, require belief that you can keep an entire complicated codebase in your head with perfect recall. Statically typed languages, it turns out, invite humility.

With a static type system, each step in a program’s lifecycle can be a little contract with itself. Break that contract and the language will tell you exactly how and where. These languages can provide immediate feedback to the developer about a program’s correctness before it is even run. Bridging the gap between all of the existing dynamic code (and the developers who wrote it) and the statically typed utopia lies so-called gradual type systems such as TypeScript.

I like to use a meteorological analogy here: if JavaScript is “wintry mix,” then TypeScript lowers the temperature just enough to build a snowman.

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

#100
post #93

Earlier quoted context omitted.

What do you think of rbs-inline?

Haven't tried that, but I think adding this from tooling will always lead to friction: "smart comments" are annoying to write.

I understand your point and it's valid. I think RBS is an interesting attempt at typed Ruby while also keeping it backwards compatible. I do however believe that having it as an separate file is not the right solution, it adds more load to the developer and ruins the joy of Ruby

RBS-inline is an interesting attempt at solving it!

Post reply on HN