• HexesofVexes@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    2 hours ago

    It works and is a pile of jank - Python

    It doesn’t work and is a pile of jank - C++

    You violated gods laws with how bad your code is and it still runs (right through the wall) - C

  • UnfortunateShort@lemmy.world
    link
    fedilink
    arrow-up
    34
    ·
    edit-2
    21 hours ago

    In bigger projects, you tend to miss type safety really bad, really fast. Rust has it built in, Python can have it bolted on. That’s simply one of the many aspects to consider when choosing your programming language.

    But don’t worry about it too much. If one thing’s for sure, it’s that you will regret that choice in any case.

    • rumba@lemmy.zip
      link
      fedilink
      English
      arrow-up
      3
      ·
      edit-2
      1 hour ago

      It’s like learning Perl back in the day, then needing to learn use strict;

  • Kushan@lemmy.world
    link
    fedilink
    English
    arrow-up
    96
    ·
    1 day ago

    Rust is completely correct to be a dick about it as well. Type safety is there for a reason.

    • frezik@midwest.social
      link
      fedilink
      arrow-up
      1
      ·
      9 minutes ago

      I’d like it better if things were designed to work together better.

      Right now, I’m working on a password storage system using the password_hash crate. You need to provide the salt yourself; this is already a bit silly for not providing a simple default that just gives you 16 bytes from a CSPRNG, but let’s continue.

      You read the Salt struct documentation, and it talks about UUIDs being pretty good salts (well, using v4, anyway). So that pushes you toward the uuid crate, right? Except no. That crate doesn’t produce formats that the functions on the Salt struct will accept, like base64. So maybe the uuid_b64 crate will do it? I don’t think so, because that crate uses a URL-safe version of base64, and it’s not clear Salt will take that, either.

      You’re now forced to use a cumbersome interface from the rand crate to make your salt. I’m still working through some of the “size not known at compile time” errors from this approach.

      All of which would work better if there was a little thought into connecting the pieces together, or just providing a default salt generator that’s going to do the right thing 90% of the time.

      Don’t get me started on how Actix hasn’t thought through how automated testing is supposed to work.

  • mlg@lemmy.world
    link
    fedilink
    English
    arrow-up
    61
    ·
    1 day ago

    Hey at least it’s not JavaScript which is perpetually high on crack with Object object

    • bleistift2@sopuli.xyz
      link
      fedilink
      English
      arrow-up
      10
      arrow-down
      1
      ·
      1 day ago

      Well, that happens when you don’t override the toString method. Not worse than Java’s 0xf00cu

  • Moc@lemmy.world
    link
    fedilink
    arrow-up
    8
    ·
    20 hours ago

    Do we need any more proof Python is superior?

    (I’m ^joking, ^I ^love ^Rust)

  • Limonene@lemmy.world
    link
    fedilink
    arrow-up
    72
    ·
    1 day ago

    C when I cast a char * * to a char * * const: ok

    C when I cast a char * * to a char * const *: ok

    C when I cast a char * * to a char const * *: WTF

    C when I cast a char * * to a char const * const *: ok

    • Juice@midwest.social
      link
      fedilink
      arrow-up
      3
      ·
      2 hours ago

      Look at mister “Sometimes I write programs that have more than a single niche function” over here

      This is a post about growing disappointment with Python

  • neidu3@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    11
    ·
    1 day ago

    Perl when I iterate over an object and treat the result as a hash reference: “fine, whatever. Fuck you, tho”

    • frezik@midwest.social
      link
      fedilink
      arrow-up
      1
      ·
      6 minutes ago

      Just wait until you come across an XS library that uses a scalar reference for its objects (like LibXML).