this post was submitted on 25 Apr 2024
16 points (94.4% liked)

Ruby

527 readers
1 users here now

A community for discussion and news about Ruby programming.

Learning Ruby?

Tools

Documentation

Books

Screencasts

News and updates

founded 1 year ago
MODERATORS
 

I saw a project a couple weeks back which allows writing and running Crystal methods inline inside a Ruby file. It’s a neat project, and I don’t want to take away from it but something in the README example looked off to me. require 'crystalruby' require 'benchmark' module Fibonnaci crystalize [n:

top 5 comments
sorted by: hot top controversial new old
[–] FizzyOrange@programming.dev 5 points 6 months ago

It's easy to make Fibonacci fast. And even so I wouldn't count non-idiomatic code. The first version is clearly what you would write.

[–] HParker@programming.dev 1 points 6 months ago

Very cool that Ruby can get that much faster with relatively small changes. Even just the implicit return + array allocation tip is a useful one on its own.

[–] Fal@yiffit.net -3 points 6 months ago (1 children)

Even if ruby was the fastest language ever, it would still be awful. It encourages such awful coding practice.

[–] lautan@lemmy.ca 3 points 6 months ago (1 children)

Like what? Meta programming? Ruby on Rails is still fairly mature.

[–] FizzyOrange@programming.dev 2 points 6 months ago

From what I've seen it encourages writing highly dynamic code that is extremely difficult to follow if you didn't write it. This is based on me trying to understand Gitlab's code. I have tried to read it to understand several different features and behaviours and every time I always get to a bit of code where I can't find the caller or callee.

Compare to VSCode which is a similarly huge codebase that I have contributed some small fixes and features to. It's night and day. Just click things to follow them. The only time it is even slightly difficult is when there's an abstract interface and then it can be a little tricky to find the concrete code that you want. But still very doable.

I think you'd have to be crazy to pick Ruby for anything other than tiny one man shows.