• @daddy32
    link
    English
    92 days ago

    I got once disqualified from a programming competition for including cases like that - and I was even nice enough to not include the os.remove thing!

  • Semperverus
    link
    English
    683 days ago

    import os

    Instant goblin behavior.

  • @brucethemoose
    link
    English
    503 days ago

    Terrible code.

    os.remove does not remove folders, for that you want shutil.rmtree().

    Best to just do the user data folder since that’s where you have permission anyway.

    • @marcos
      link
      English
      213 days ago

      Exactly. You write the tests first so you know exactly when not to remove Windows.

    • @[email protected]
      link
      fedilink
      English
      53 days ago

      That would be true if there were tests. If you work in banking or any other field with very specific specs and regulations, the program is almost perfect and answers the demands of the client.

      The undefined behavior is too much though, he should throw an exception instead.

  • Troy
    link
    fedilink
    English
    122 days ago

    It’s that hacker 4chan again

  • @satans_methpipe
    link
    English
    72 days ago

    Localization dependent regex for this should be possible

  • MeatPilot
    link
    English
    53 days ago

    Little Johnny “DROP TABLE ?” up to it again I see.

  • @iAvicenna
    link
    English
    33 days ago

    all he wanted was to get his cs101 hw done. all he got was computer reckt