• Deebster@programming.dev
    link
    fedilink
    arrow-up
    41
    arrow-down
    1
    ·
    3 months ago

    My absolute favourite is when the examples say something like “production code should not be written like this, this is just for clarity” with no indication of what’s wrong with the code.

    Is it just normal Rust stuff like there’s unwraps everywhere and it’s one big file? Does the example have security or performance problems? Is the example unidiomatic or over-verbose or is it ignoring features real-world code would use? EXPLAIN YOURSELF!

    • Nereuxofficial@programming.devOP
      link
      fedilink
      arrow-up
      14
      ·
      3 months ago

      Yeah that’s the fun part!

      Maybe there are also some security implications of the code?

      Because the thing is: That code is probably gonna end up in production somewhere

    • noddy@beehaw.org
      link
      fedilink
      arrow-up
      7
      ·
      3 months ago

      I personally prefer the straight forward everything in one file examples. The worst examples are those that come with its own ad hoc example framework I first need to understand before I can understand the example.

    • crispy_kilt@feddit.de
      cake
      link
      fedilink
      arrow-up
      2
      ·
      3 months ago

      It’s probably to encourage people to underdtsnd the example properly then write their own code. Too many people copy/paste examples without understanding them completely.