• TurboWafflz@lemmy.world
    link
    fedilink
    English
    arrow-up
    56
    arrow-down
    1
    ·
    5 months ago

    It’s crazy that cloudflare of all people even had unwrap enabled. Whenever I use unwrap in some tiny little not important thing I always treat it as a temporary thing that I need to come back and fix before the software is actually ready for anyone to seriously use

      • Mubelotix@jlai.lu
        link
        fedilink
        English
        arrow-up
        11
        ·
        5 months ago

        Yeah but man, they should have had a CI against this. And reviews! I have refused to merge PRs from friends on hobby projects for less than that

        • moseschrute@lemmy.world
          link
          fedilink
          English
          arrow-up
          12
          ·
          5 months ago

          PM: Listen it’s almost December, the whole team decided to cash in PTO next week for thanksgiving, it’s 4pm on a Friday, and the quarter is about to end. We have to move onto next quarter’s OKRs. Is this good enough to ship?

          A very tired dev: …lgtm

  • anyhow2503@lemmy.world
    link
    fedilink
    English
    arrow-up
    32
    arrow-down
    2
    ·
    5 months ago

    I swear some of these commenters will jerk each other off about how “Rust is bad, actually” even if the root cause of an issue was someone intentionally crashing their app. Where do you even get this kind of attitude from? I’ve been around when Rust was the popular topic in any programming-related discussions and while there was plenty of evangelism and CS-101 experts making wild claims, nothing warrants this kind of irrational hatred. I thought you need to go to the phoronix forums to find people who have such loud opinions with very little actual programming experience, but apparently I was wrong.

  • ragingHungryPanda@lemmy.zip
    link
    fedilink
    English
    arrow-up
    11
    ·
    5 months ago

    I feel like I’ve seen an insane number of error messages in various apps and websites around the unwrap method.

    But this is on a result type, right? I’d figure the point would be that you would match on it and that the unwrap itself, which if my assumptions are correct, is more like get value or throw, should either not exist or take a default value. You shouldn’t be able to directly get the value of a monad.

    • anyhow2503@lemmy.world
      link
      fedilink
      English
      arrow-up
      5
      ·
      5 months ago

      There are good reasons to have unwrap or at least expect. There is no reason to use it in the case that Cloudflare used it in.

  • just_another_person@lemmy.world
    link
    fedilink
    English
    arrow-up
    7
    arrow-down
    15
    ·
    5 months ago

    RUST AGAIN.

    Just throwing this out because I’ve been hammering this Rustholes up and down these threads who claim it’s precious and beyond compare 🤣

    I will almost certainly link back to this comment in the future.

    • sugar_in_your_tea@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      9
      arrow-down
      1
      ·
      5 months ago

      Ift is precious and beyond compare. It has tools that most other languages lack to prove certain classes of bugs are impossible.

      You can still introduce bugs, especially when you use certain features that “standard” linter (clippy) catches by default and no team would silence globally. .unwrap() is very controversial in Rust and should never be used without clear justification in production code. Even in my pet projects, it’s the first thing I clear out once basic functionality is there.

      This issue should’ve been caught at three separate stages:

      1. git pre-commit or pre-push should run the linter on the devs machine
      2. Static analysis checks should catch this both before getting reviews and when deploying the change
      3. Human code review

      The fact that it made it past all three makes me very concerned about how they do development over there. We’re a much smaller company and we’re not even a software company (software dev is <1% of the total company), and we do this. We don’t even use Rust, we’re a Python shop, yet we have robust static analysis for every change. It’s standard, and any company doing anything more than a small in-house tool used by 3 people should have these standards in place.

    • lmmarsano@lemmynsfw.com
      link
      fedilink
      English
      arrow-up
      6
      ·
      5 months ago

      Programmer explicitly bypasses code safety with unwrap.
      Let’s blame it on their programming language!

      Cool hot take, brah.