• grue@lemmy.world
      link
      fedilink
      English
      arrow-up
      5
      arrow-down
      1
      ·
      1 month ago

      Implement a basic socket connection in C (20 lines of manipulating struct sockaddrs and such), then do the same in Python (2 lines).

      And then go back and make the C version support IPV6, because your initial implementation didn’t.

      • Ethan
        link
        fedilink
        English
        arrow-up
        6
        ·
        1 month ago

        Or use a statically typed language that’s actually modern instead of C

      • 𝙲𝚑𝚊𝚒𝚛𝚖𝚊𝚗 𝙼𝚎𝚘𝚠
        link
        fedilink
        arrow-up
        7
        arrow-down
        1
        ·
        1 month ago

        “Look, Python is way easier to use than other languages! Look how complex this easy task is in Python versus other languages like assembly and brainfuck!”

        I’m not saying “do stuff in C it’s easier than Python”, but if I took e.g. C# then it’s also just two lines. That supports everything and is also faster than the Python implementation.