Beehaw
  • Communities
  • Create Post
  • search
    Search
  • Login
  • Sign Up
tfm ( tfm@europe.pub )  to Programmer Humor@lemmy.mlEnglish · 1 year ago

Python!

lemmy.ml

message-square
29
link
fedilink
440

Python!

lemmy.ml

tfm ( tfm@europe.pub )  to Programmer Humor@lemmy.mlEnglish · 1 year ago
message-square
29
link
fedilink
alert-triangle
You must log in or register to comment.
  • lime! ( lime@feddit.nu ) 
    link
    fedilink
    English
    arrow-up
    70
    ·
    1 year ago

    alternative joke

    C++: “Hey, what’s your name?”
    Python: *grabs C++* “what is my name?”

    • Hadriscus ( Hadriscus@jlai.lu ) 
      link
      fedilink
      arrow-up
      30
      ·
      1 year ago

      please explain I want to laugh

      • lime! ( lime@feddit.nu ) 
        link
        fedilink
        English
        arrow-up
        15
        ·
        1 year ago

        one of python’s strong suits is it’s foreign function interface. it’s very easy to call code in other languages from python, which can speed execution up significantly

        • Hadriscus ( Hadriscus@jlai.lu ) 
          link
          fedilink
          arrow-up
          2
          ·
          1 year ago

          oh alright. Cheers, heheh. I laughed

      • Ethan ( firelizzard@programming.dev ) 
        link
        fedilink
        English
        arrow-up
        2
        ·
        1 year ago

        One of the main implementations of Python is CPython, which is written in C or C++

    • 𒉀TheGuyTM3𒉁 ( TheGuyTM3@lemmy.ml ) 
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      It’s now cannon in my head that Python talks like Parappa the rapper

  • wheezy ( wheezy@lemmy.ml ) 
    link
    fedilink
    arrow-up
    64
    ·
    1 year ago

    I know people joke around about this a lot. But I was blown away by a recent switch to I did from using cv2 with python to using cv2 with C++.

    I had literally hundreds of thousands of images to analyze for a dataset. My python script would have taken 12 hours.

    I ported it to C++ and it literally destroyed it in 20 minutes.

    I’m sure I was doing something that really wasn’t optimized well for python. I know somewhere in the backend it probably was using a completely different library with multi thread optimization. Or maybe turbojpg is just garbage in python. I’m still not even sure what the bottleneck was. I don’t know enough to really explain why.

    But holy shit. I never had that much of a performance difference in such a simple task.

    Was very impressed.

    • Oriel Jutty :hhHHHAAAH: ( barubary@infosec.exchange ) 
      link
      fedilink
      arrow-up
      47
      ·
      1 year ago

      If you had let me write the C++ code, I could have literally destroyed your dataset in a couple of seconds.

      • ThunderComplex ( ThunderComplex@lemmy.today ) 
        link
        fedilink
        arrow-up
        23
        ·
        1 year ago

        I don’t even need C++ for this just give me a rm with a side dish of -rf

    • jsomae ( jsomae@lemmy.ml ) 
      link
      fedilink
      arrow-up
      21
      ·
      1 year ago

      Exactly what this comic is saying. C++ can handle in 20 minutes what takes python 12 hours, but something gets destroyed.

    • sugarfoot00 ( sugarfoot00@lemmy.ca ) 
      link
      fedilink
      English
      arrow-up
      15
      ·
      1 year ago

      But make sure to bill for the full 12 hours.

      • wheezy ( wheezy@lemmy.ml ) 
        link
        fedilink
        arrow-up
        10
        ·
        1 year ago

        Was a personal project. But absolutely. Half my job is trying to explain why something is taking so long when in reality I actually it’s already done I just don’t want to do nothing for the next few days.

        Managers never really know. And other engineers don’t care. It’s all about balancing expectations.

    • HiddenLayer555 ( HiddenLayer555@lemmy.ml ) 
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 year ago

      Might be latency? Python is probably slower to respond to things like when one job is done and the next job can start, since it needs time to interpret the code and call the relevant C libraries.

  • bobbyfiend ( bobbyfiend@lemmy.ml ) 
    link
    fedilink
    arrow-up
    23
    ·
    1 year ago

    This has got to be the best, most legitimately funny programmer/computer joke I’ve seen in years.

    • tfm ( tfm@europe.pub ) OP
      link
      fedilink
      arrow-up
      7
      ·
      1 year ago

      I thought that too! :D

  • HiddenLayer555 ( HiddenLayer555@lemmy.ml ) 
    link
    fedilink
    English
    arrow-up
    23
    ·
    1 year ago

    Python’s core implementation is in C though. It’s just a fancy way to call C libraries.

    • whimsy ( whimsy@lemmy.zip ) 
      link
      fedilink
      English
      arrow-up
      24
      ·
      1 year ago

      You could say this about a lot of things…

    • ddplf ( ddplf@szmer.info ) Banned from community
      link
      fedilink
      arrow-up
      7
      ·
      1 year ago

      I code in JS, so I’m something of a C dev myself!

      • Natanox ( Natanox@discuss.tchncs.de ) 
        link
        fedilink
        English
        arrow-up
        6
        ·
        1 year ago

        Beginning your sentence with “I code in JS” really makes any follow-up statement sound sane in comparison.

      • noddy ( noddy@beehaw.org ) 
        link
        fedilink
        arrow-up
        3
        ·
        1 year ago

        Aschhually the most used JS engine is made in C++ (v8)

    • MoonMelon ( MoonMelon@lemmy.ml ) 
      link
      fedilink
      English
      arrow-up
      3
      ·
      1 year ago

      Python is actually pretty baller with string operations too since so much of the C has been heavily optimized.

    • vrighter ( vrighter@discuss.tchncs.de ) 
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      so?

      • Saleh ( Saleh@feddit.org ) 
        link
        fedilink
        arrow-up
        6
        ·
        1 year ago

        It might not be a language but a skill issue if your python code performs significantly worse than your C code

  • officialdakari ( officialdakari@sopuli.xyz ) 
    link
    fedilink
    arrow-up
    18
    ·
    1 year ago

    JavaScript fits too

    • brokenlcd ( brokenlcd@feddit.it ) 
      link
      fedilink
      arrow-up
      27
      ·
      1 year ago

      Javascript’s still arriving to the meeting

      • Sonotsugipaa ( Sonotsugipaa@lemmy.dbzer0.com ) 
        link
        fedilink
        English
        arrow-up
        16
        ·
        1 year ago

        Javascript took the wrong turn and ended up in [object Object]

    • HiddenLayer555 ( HiddenLayer555@lemmy.ml ) 
      link
      fedilink
      English
      arrow-up
      8
      ·
      1 year ago

      NaN

  • qjkxbmwvz ( qjkxbmwvz@startrek.website ) 
    link
    fedilink
    arrow-up
    16
    ·
    1 year ago

    It’s interesting that, with Python, the reference implementation is the implementation — yeah there’s Jython but really, Python means both the language and a particular interpreter.

    Many compiled languages aren’t this way at all — C compilers come from Intel, Microsoft, GNU, LLVM, among others. And even some scripting languages have this diversity — there are multiple JavaScript implementations, for example, and JS is…weird, yes, but afaik can be faster than Python in many cases.

    I don’t know what my point is exactly, but Python a) is sloooow, and b) doesn’t really have competition of interpreters. Which is interesting, at least, to me.

  • Cevilia (they/she/…) ( Cevilia@lemmy.blahaj.zone ) deleted by creator
    link
    fedilink
    English
    arrow-up
    11
    ·
    edit-2
    6 months ago

    deleted by creator

    • Oriel Jutty :hhHHHAAAH: ( barubary@infosec.exchange ) 
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago
      $ python3 -c 'f = (lambda x: x + 0.5 - 0.5); print(f(2**52))'  4503599627370495.5
      

      #python

      • Cevilia (they/she/…) ( Cevilia@lemmy.blahaj.zone ) deleted by creator
        link
        fedilink
        English
        arrow-up
        8
        ·
        edit-2
        6 months ago

        deleted by creator

    • Cevilia (they/she/…) ( Cevilia@lemmy.blahaj.zone ) deleted by creator
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      6 months ago

      deleted by creator

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: !programmerhumor@lemmy.ml

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.

  • 1 user / day
  • 41 users / week
  • 42 users / month
  • 1.56K users / 6 months
  • 871 local subscribers
  • 43.7K subscribers
  • 1.25K Posts
  • 10.2K Comments
  • Modlog
  • mods:
  • AgreeableLandscape ( AgreeableLandscape@lemmy.ml ) deleted by creator
  • cat_programmer ( cat_programmer@lemmy.ml ) 
  • BE: 0.19.21
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code