• 10 Posts
  • 525 Comments
Joined 1 year ago
cake
Cake day: July 1st, 2023

help-circle



  • Fair. But unwrap versus expect isn’t really the point. Sure one has a better error message printed to your backtrace. But IMO that’s not what I’m looking for when I’m looking at a backtrace. I don’t mind plain unwraps or assertions without messages.

    From my experience, when people say “don’t unwrap in production code” they really mean “don’t call panic! in production code.” And that’s a bad take.

    Annotating unreachable branches with a panic is the right thing to do; mucking up your interfaces to propagate errors that can’t actually happen is the wrong thing to do.


  • cbarrick@lemmy.worldtoRust@programming.devDioxus Labs + “High-level Rust
    link
    fedilink
    English
    arrow-up
    3
    arrow-down
    1
    ·
    19 hours ago

    Unwrap should literally never appear in production code

    Unwrap comes up all the time in the standard library.

    For example, if you know you’re popping from a non-empty vector, unwrap is totally the right too for the job. There are tons of circumstances where you know at higher levels that edge cases defended against at lower levels with Option cannot occur.




  • \1. Many retro games were made for CRT TVs at 480p. Updating the graphics stack modern TVs is valuable, even if nothing else is changed.

    \2. All of my old consoles only have analog A/V outputs. And my TV only has one analog A/V input. The mess of adapter cables and swapping is annoying. I want the convenience of playing on a system that I already have plugged in.

    \3. I don’t even still have some of the consoles that play my favorite classic games, and getting retro hardware is sometimes difficult. Especially things like N64 controllers with good joysticks.

    Studios don’t need to do a full blown remake to solve these problems. But I’m also not going to say the Crash and Spyro remakes weren’t welcome. Nintendo’s Virtual Console emulators toe this line pretty well.

    But studios should still put in effort to make these classic games more accessible to modern audiences, and if that means a remake, that’s fine with me.

    (I’m mostly thinking about the GameCube/PS2 generation and earlier. I don’t see much value in remakes of the Wii/PS3 generation yet.)













  • cbarrick@lemmy.worldtoPython@programming.devNumPy 2.0.0 released
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    9 days ago

    Huh. This got me curious.

    Yes, I did just type a bare URL. Every mature markdown parser I’ve used turns this into a link, and appropriately handles trailing punctuation.

    So I went to the spec, and it’s explicitly called out that this is not an autolink. Autolinks must be explicitly surrounded with angle brackets <>.

    So yeah \shrug.

    https://spec.commonmark.org/0.31.2/#autolinks

    Edit to be clear: This means that both of our markdown parsers are wrong relative to the commonmark spec. But I’ll argue that if a parser is going to attempt to autolink this, then handling trailing punctuation is better than not.