• Lux (unregistered)

    which comes back as a vector-of-bits, so we have to unwrap() it.

    I believe it's because it comes back as an Option<T>, Rust's way of expressing types which may be null: https://doc.rust-lang.org/std/option/enum.Option.html#method.unwrap

  • (nodebb)

    I have a bad feeling somebody was a little too impressed with things like LINQ and vectors (lists). This looks like that was their hammer and everything is of course a nail.

  • some Rust coder (unregistered)

    That unwrap() call isn't there to get the results out of a vector, it extracts the Ok variant value out of a Result enum. If it is an Err variant instead, it will "panic" and immediately and unstoppably crash the entire program. This is Rust's standard way of error handling, instead of throwing and catching exceptions. For reference: https://doc.rust-lang.org/std/result/enum.Result.html

  • Me (unregistered)

    First (but only in bigendian)

  • LawrenceG (unregistered)

    I love the "Naive" implementation from this line: "we wouldn't want to use the naive version". Naive just seems more appropriate then "Native".

  • Sole Purpose Of Visit (unregistered) in reply to some Rust coder

    You would know better than me, but I actually appreciate the Rustiness of the "library" version. Apart from the endian bug, of course.

    It's a nice standard Schwartzian Transform sort of thing, with added exception-handling goodness, as you say.

    Of course, it's an absurd way to implement the actual requirement (plus it's broken), but it's one of those rare WTFs where the design and (most of) the implementation are really quite nice. Bit of a shame that the result is up shckreek. Could do with some tests in the crate, I feel.

  • (nodebb) in reply to LawrenceG

    I don't think "naive" is a typo. If there were a native version, then she wouldn't have needed to use a crate or write her own version. A naive implementation (of anything) generally refers to the first approach that comes to mind, without regard for optimizations or possible edge cases.

  • (nodebb)

    "If all you have is a three-headed hammer, everything looks like three nails." — D_Coder.

  • Bithead (unregistered)

    uhhhhh uh huh uh. uhhhhhhhhhhhh.

    So I got this ... ... grate. Or gutter. Or drain .... uh huh. uh huh.

    And this can of spray paint. ... ... uh huh. huh huh huh.

    And I need to ... ... uhhhhh.... uh huh ... uh huh ... uhhhhhhhh "coat a path to each intersection member" huh huh huh huh .... you said "sex member"

    Damn it. Let's just poke holes in a piece of cardboard and cut it up with a chainsaw again. uh huh uh huh. ... ... ... this is gonna be cool.

  • Sole Purpose Of Visit (unregistered)

    I've always liked the idea of describing "perfectly cromulent" Python as "pythonic." Perhaps, in like manner, we could describe this "perfectly cromulent" Rust as "rustic."

    Is that an apt description? It is now ...

  • Da'Vyne (unregistered)

    Since when does TDWTF pick on random hobbyist projects on github that were never meant for production use? Is this how you make OS more welcoming to people?

    Oh and by the way, the details of this story make it easy to track down the original library, and "Jenna" (actually John - wonder why you chose to misgender him?) was extremely rude to the original library creator who admitted to being a hobbyist coder who made his library for fun and no longer maintained it. Try to be less of an asshole to people, "Jenna."

  • WTFGuy (unregistered)

    @Sole Purpose of Visit ref:

    I've always liked the idea of describing "perfectly cromulent" Python as "pythonic." Perhaps, in like manner, we could describe this "perfectly cromulent" Rust as "rustic."

    I think a better term for cromulent Rust is "Rustolean". Rhymes with Tyrolian and, yes, Rust-o-leum. ;)

  • (nodebb)

    This person Haskells.

  • SG (unregistered) in reply to Sole Purpose Of Visit

    I know Rust developers are sometimes referred to as "rustaceans".

  • Harris Mirza (unregistered) in reply to Sole Purpose Of Visit

    Or Oxidised?

  • 🤷 (unregistered) in reply to Eric Ray

    Which is why we should write "naive" as "naïve", always. To prevent everyone from thinking it's a typo and should read "native".

  • (nodebb) in reply to Lux

    Believe it could be either an Option or a Result, which anyway adds to the complexity of the API, given that probably the procedure could never return null or fail entirely...

  • (nodebb)

    I love this one. Having had arguments with a few people who have claimed that Rust ensures that code is bug free and fast, the whole set of performance horrors and outright incorrect behaviour is just a wonderful counterpoint. There are a whole range of bugs other than memory handling, and getting them wrong can just as easily lead to disaster. Numeric code is particularly notorious for being tricky that way, and often has stuff in it that is seriously non-obvious.

  • Zdexter (unregistered)

    Based on the comment thread on the original issue ( https://github.com/blakehawkins/zdex/issues/8 ), I would say that the poster was very arrogant and far from constructive.

  • rlupton20 (unregistered)
    Comment held for moderation.

Leave a comment on “Put in Order”

Log In or post as a guest

Replying to comment #:

« Return to Article