UmU
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
devilish666@lemmy.world to Programmer Humor@lemmy.ml · 1 year ago

Python tutorial moment

lemmy.world

message-square
56
fedilink
491

Python tutorial moment

lemmy.world

devilish666@lemmy.world to Programmer Humor@lemmy.ml · 1 year ago
message-square
56
fedilink
  • Buffalox@lemmy.world
    link
    fedilink
    arrow-up
    93
    ·
    1 year ago

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

    • Björn Tantau@swg-empire.de
      link
      fedilink
      arrow-up
      169
      ·
      1 year ago

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

      • mac@infosec.pub
        link
        fedilink
        arrow-up
        148
        ·
        1 year 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.

        • lowleveldata@programming.dev
          link
          fedilink
          arrow-up
          43
          ·
          1 year 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.

          • bort@sopuli.xyz
            link
            fedilink
            arrow-up
            25
            ·
            edit-2
            1 year ago

            I’m no security expert and the sensible thing to do is using a library instead of taking a class.

            Counterpoint: “not knowing your libraries” + “blind trust in the maintainer” will give you stuff like this: https://bitbucket.org/snakeyaml/snakeyaml/issues/561/cve-2022-1471-vulnerability-in

            (the thread itself is worth a read. But also very impressive is the list of big players who fell for exactly this mentality)

            • gears@sh.itjust.works
              link
              fedilink
              arrow-up
              7
              ·
              1 year ago

              Jesus that was one hell of a thread

              • anguo@lemmy.ca
                link
                fedilink
                arrow-up
                3
                ·
                1 year ago

                I dont want to see the words “low quality tooling” ever again.

            • unique_hemp@discuss.tchncs.de
              link
              fedilink
              arrow-up
              4
              ·
              1 year 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?

            • Gabu@lemmy.ml
              link
              fedilink
              arrow-up
              3
              ·
              1 year 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.

        • Björn Tantau@swg-empire.de
          link
          fedilink
          arrow-up
          24
          ·
          1 year ago

          Works as well.

        • billwashere@lemmy.world
          link
          fedilink
          English
          arrow-up
          7
          ·
          1 year 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.

        • WolfLink@lemmy.ml
          link
          fedilink
          arrow-up
          5
          ·
          1 year ago

          That is a large part of coding

      • mondoman712@lemmy.ml
        link
        fedilink
        arrow-up
        92
        ·
        1 year ago

        It’s basically import antigravity

        • ChaoticNeutralCzech@lemmy.one
          link
          fedilink
          arrow-up
          35
          ·
          edit-2
          1 year ago

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

          from __future__ import antigravity
          
          • Gabu@lemmy.ml
            link
            fedilink
            arrow-up
            1
            ·
            1 year ago

            Future libraries still makes me laugh.

        • grue@lemmy.world
          link
          fedilink
          English
          arrow-up
          26
          ·
          1 year ago

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

          • Dandroid@sh.itjust.works
            link
            fedilink
            arrow-up
            5
            ·
            1 year ago

            It’s funny how solvable that problem is now. I remember seeing that comic, I think over a decade ago now, and thinking about how true it was. It really shows you have far we’ve come in CS.

          • tofubl@discuss.tchncs.de
            link
            fedilink
            arrow-up
            4
            ·
            1 year ago

            More like all the research teams.

            • Bene7rddso@feddit.de
              link
              fedilink
              arrow-up
              1
              ·
              1 year ago

              And 10 years

        • mac@infosec.pub
          link
          fedilink
          arrow-up
          16
          ·
          1 year ago

          “I also sampled everything in the medicine cabinet”

          This made me smile.

        • RobertoOberto@sh.itjust.works
          link
          fedilink
          arrow-up
          3
          ·
          1 year 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@lemmy.ca
        link
        fedilink
        English
        arrow-up
        30
        ·
        1 year 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@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

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

    • CanadaPlus@lemmy.sdf.org
      link
      fedilink
      arrow-up
      43
      ·
      edit-2
      1 year ago

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

      • Buffalox@lemmy.world
        link
        fedilink
        arrow-up
        9
        ·
        1 year ago

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

    • Adel Khial@lemmy.world
      link
      fedilink
      arrow-up
      32
      ·
      1 year ago

      It’s funny because

      from apps import facebook-killer as fb
      
      fb.start()
      
      // 3 million seed investment 
      
      
      • zaphod@sopuli.xyz
        link
        fedilink
        arrow-up
        13
        ·
        1 year ago

        SyntaxError

        • pewpew@feddit.it
          link
          fedilink
          arrow-up
          5
          ·
          1 year ago

          : Inconstistent indentation

    • Lupec@lemm.ee
      link
      fedilink
      arrow-up
      5
      ·
      1 year 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

Programmer Humor@lemmy.ml

programmerhumor@lemmy.ml

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: [email protected]

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 341 users / day
  • 1.07K users / week
  • 3.22K users / month
  • 9.68K users / 6 months
  • 2 local subscribers
  • 37K subscribers
  • 1.4K Posts
  • 21.8K Comments
  • Modlog
  • mods:
  • AgreeableLandscape@lemmy.ml
  • cat_programmer@lemmy.ml
  • BE: 0.19.9
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org