• @Buffalox
    link
    639 months ago

    How is this funny? 8 Upvotes at current writing???

    • Björn Tantau
      link
      fedilink
      1029 months ago

      It’s kind of funny because it looks like it is nonsense dreamt up by a non-programmer. But it actually works.

      • mac
        link
        fedilink
        1029 months ago

        I thought it was poking fun at the tutorial saying instead of learning to code, import a library from someone who knows how to code.

        • @[email protected]
          link
          fedilink
          279 months ago

          That’s what libraries are for. I’m no security expert and the sensible thing to do is using a library instead of taking a class.

            • @[email protected]
              link
              fedilink
              49 months ago

              Love the part where he claims that if your users are authenticated, it’s not untrusted input. I mean, surely you trust all of your users to run any code on your server, right?

            • @[email protected]
              link
              fedilink
              19 months ago

              Impressive and unsurprising. As soon as you start getting complex libraries with multiple dependencies it becomes nearly impossible to review everything. At one time I had an interest in contributing to some AI libraries, but they’re a mess as soon as you go looking for points of improvement.

        • billwashere
          link
          English
          69 months ago

          Which is funny because when I first started my CS degree in the late 80s (get off my lawn) we used to make fun of the beginning Java classes because it seems 90% of coding was to import the right library.

        • @[email protected]
          link
          fedilink
          17
          edit-2
          9 months ago

          Time travel is a prerequisite but don’t worry, you can just

          from __future__ import antigravity
          
        • mac
          link
          fedilink
          99 months ago

          “I also sampled everything in the medicine cabinet”

          This made me smile.

        • @grue
          link
          English
          89 months ago

          It’s literally this comic, five years and a research team later.

        • @[email protected]
          link
          fedilink
          19 months ago

          From the hovertext: “I wrote 20 short programs in Python yesterday. It was wonderful. Perl, I’m leaving you.

          After years of a dozen other languages, I finally tried Perl the other day.

          Never again, if I can help it.

      • Otter
        link
        fedilink
        English
        139 months ago
        from Lemmy import Upvote
        from Fediverse import Posts
        from ActivityPub import Submit
        
        target_post = 'https://lemmy.ca/post/18691085'
        num_votes = 8
        
        post = Posts.open(target_post)
        
        package = Upvote(post, num_votes)
        
        package.Submit(target_post)
        

        or something

      • billwashere
        link
        English
        19 months ago

        Good because I was confused. I’ve written similar code

    • Adel Khial
      link
      199 months ago

      It’s funny because

      from apps import facebook-killer as fb
      
      fb.start()
      
      // 3 million seed investment 
      
      
    • @[email protected]
      link
      fedilink
      13
      edit-2
      9 months ago

      Because this example isn’t really programming, it’s just calling an existing library. Which is the big joke about Python.

      • @Buffalox
        link
        19 months ago

        OK that way I get why it could be considered funny.

    • Lupec
      link
      fedilink
      39 months ago

      My best guess is it’s a play at the usual “all you do in python is import libraries without knowing how they work lololol” dig but yeah, I don’t find it particularly funny either