• FizzyOrange@programming.dev
    link
    fedilink
    arrow-up
    14
    ·
    7 days ago

    Very good points. A codebase that gets this VERY wrong is Gitlab. I think it might be a dumb characteristic of Ruby programs, but they generate identifiers all over the place. I once had to literally give up following some code because I could not find what it was calling anywhere. Insanity.

    Another point: don’t use - in names. Eventually you’ll have to write them down in a programming language, at which point you have to change the name. CSS made this mistake. foo-bar in CSS maps to fooBar in Javascript. Rust also made this mistake with crate names. A crate called foo-bar magically becomes foo_bar in Rust code.

    • Die4Ever@programming.dev
      link
      fedilink
      arrow-up
      9
      ·
      7 days ago

      I’ve been working in Ruby on Rails lately (unfortunately) and yeah it’s extremely bad at this. There’s so much hidden implicit behavior everywhere.

      • tyler@programming.dev
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        3 days ago

        Ruby on Rails is the worst thing to ever happen to Ruby. The language is great, much better than Python from a tooling perspective. And then Rails came along and ruined everything. I sincerely believe that the reason Python won out is solely because of Rails, because Ruby is better in every other regard.

    • thingsiplay@beehaw.org
      link
      fedilink
      arrow-up
      3
      ·
      7 days ago

      The dash - vs underscore _ is also a common “problem” with CLI arguments --file-name, that are mapped to variable names file_name.

      • esa@discuss.tchncs.de
        link
        fedilink
        arrow-up
        2
        ·
        6 days ago

        Yeah, translating between cases isn’t exactly a problem IME. Might be neat to have a case-aware grep though, so you can get kebab-case, snake_case, camelCase and PascalCase all done in one go.