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:

  • FizzyOrange@programming.dev
    link
    fedilink
    arrow-up
    5
    ·
    7 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
    link
    fedilink
    arrow-up
    1
    ·
    7 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
    link
    fedilink
    English
    arrow-up
    5
    arrow-down
    7
    ·
    7 months ago

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

    • lautan@lemmy.caOP
      link
      fedilink
      arrow-up
      3
      arrow-down
      1
      ·
      7 months ago

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

      • FizzyOrange@programming.dev
        link
        fedilink
        arrow-up
        5
        arrow-down
        3
        ·
        7 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.