Skip Navigation

InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)TI
Posts
1
Comments
7
Joined
7 days ago

  • I’m guessing there’s a reason they wanted min() to be able to be called without any arguments but I’m sure it isn’t a good one.

    It not a totally unreasonable definition. For example it preserves nice properties like min(a.concat(b)) == min([min(a), min(b)]).

    Obviously the correct thing to do is to return an optional type, like Rust does. But ... yeah I mean considering the other footguns in Javascript (e.g. the insane implicit type coersion) I'd say they didn't do too badly here.

  • I don't think so. Apart from dynamically typed languages which need to store the type with the value, it's always 1 byte, and that doesn't depend on architecture (excluding ancient or exotic architectures) or optimisation flags.

    Which language/architecture/flags would not store a bool in 1 byte?

  • Well there are containers that store booleans in single bits (e.g. std::vector<bool> - which was famously a big mistake).

    But in the general case you don't want that because it would be slower.

  • RISC-V @lemmy.ml

    RISC-V Vector Quick Intro