Text description (for those with screenreaders):

A portion of a prime number checker written in the Rust programming language, where the first few lines are written correctly including the first if statement in the program. However, the following if statements are written using Python syntax instead of Rust, as the author slipped back into his native tongue.

    • Fal@yiffit.net
      link
      fedilink
      English
      arrow-up
      0
      ·
      10 months ago

      Seriously. I can’t imagine writing rust without an IDE, that’s absurd. Rustrover is amazing

        • JustARegularNerd@aussie.zoneOP
          link
          fedilink
          English
          arrow-up
          0
          ·
          10 months ago

          I’m not sure what does and doesn’t control it, but I’ve installed nano on some Linux distros and it has no syntax highlighting at all, then other distros (currently using LMDE) just have it by default.

      • JustARegularNerd@aussie.zoneOP
        link
        fedilink
        English
        arrow-up
        0
        ·
        10 months ago

        Well, in my defense I just wanted to initially try out Rust and on this particular computer, I don’t have any IDE set up on it yet. However, definitely seems like an IDE is in order for me haha

          • JustARegularNerd@aussie.zoneOP
            link
            fedilink
            English
            arrow-up
            0
            ·
            10 months ago

            I thought so but as I’m not a huge vim user myself, I thought maybe vim had some error detection like VSCode that could be set up and that’s what you meant.

            In any case, VSCode will probably be the go for me

              • t3rmit3@beehaw.org
                link
                fedilink
                arrow-up
                0
                ·
                edit-2
                10 months ago

                I actually use Vim to write all my code, but without IDE-ifying it, just syntax highlighting and some navigation tweaks (with Sublime3 for help with bulk edits). For most of my stuff an IDE is overkill.

  • Skull giver@popplesburger.hilciferous.nl
    link
    fedilink
    arrow-up
    0
    ·
    10 months ago

    I get this switching between Kotlin and Rust, and Java and C#. Close enough to be confusing, but distinct enough that I end up looking up the right syntax.

    Would recommend setting up VS Code or RustRover (while it’s still in EAP and free). Rust’s error messages are nice and all but it’s better to see the warnings before you hit compile.

    FYI the Rust compiler will try to be smart and defect tail call recursion, but if you want to be sure your code is fast, you should probably turn that recursion into a loop.

    • JustARegularNerd@aussie.zoneOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      10 months ago

      I was pleasantly surprised by how good the error messages are in Rust though on compile time. I agree that having an IDE flag them before I compile is much better though.