• Smoogs@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    2 days ago

    “Print needs ()”

    Oh fuck off. years of code that cannot be easily redone in ANY editor. Whoever OCDd that into python 3 needs to have their asshole kicked up into their mouth.

    • Swedneck@discuss.tchncs.de
      link
      fedilink
      arrow-up
      0
      ·
      2 days ago

      why would it not have brackets? i detest syntax that is only applicable to a handful of situations and has to be specifically memorized separately from how every other part of the language works.

      • Smoogs@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        edit-2
        24 hours ago

        Not after 10 years of it not having brackets. And providing no editing ability to change it as a macro. That’s just cruel and inhumane and psychopathic.

      • Smoogs@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        edit-2
        24 hours ago

        If you developed it to not have brackets for the first one or two decades. Especially if there’s no possible way to easily edit it. You’re a psychopath to not consider this.

        • thebestaquaman@lemmy.world
          link
          fedilink
          arrow-up
          0
          ·
          22 hours ago

          That’s what major versions are for - breaking changes. Regardless, you should probably be able to fix this with some regex hackery. Something along the lines of

          new_file_content = re.sub(r'(?<=\bprint)(\s+)(?!\()', '(', old_file_content)
          new_file_content = re.sub(r'(print\(.*?)(\n|$)', r'\1)', new_file_content)
          

          should do the trick.

  • powermaker450@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    2 days ago

    oh my fuck. circular imports.

    I set out to create a Discord Bot in Python, then gave up trying to use an easy “proper” server-side language and just did it in TypeScript

  • toastal@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    2 days ago

    This is so true & unfortunately everyone keeps telling beginners to start at Python

  • Machindo@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    2 days ago

    Some people in the comments didn’t take it as tongue-in-cheek as I did. 😝

    I thought this was really funny. That’s a good collection of toe stubs.

    There is a lot of stuff to learn to be good at python but I still love it.

  • dudinax@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    2 days ago

    Best scientific packages in the open source by far, a library for everything, everybody knows it. Works on all kinds of systems. Available by default in many OSs.

    You might not like it, but you can’t leave.

      • Kichae@lemmy.ca
        link
        fedilink
        English
        arrow-up
        0
        ·
        2 days ago

        Is great until you need a job. It solves the 2 language problem right up until you’re working with others.

    • azimir@lemmy.ml
      link
      fedilink
      arrow-up
      0
      ·
      2 days ago

      The summary that I liked from the last post was “python is the second best language for everything”. There’s always something specialized and better for every given job. But, if you want one tool that’ll do a solid job everywhere, python is your go to.

      • CanadaPlus@lemmy.sdf.org
        link
        fedilink
        arrow-up
        0
        ·
        edit-2
        22 hours ago

        I don’t think that’s quite right. It’s more like if you have to choose a language before you know what you’re doing, Python is the best choice. For anything large enough it’s multiple places down the list, but you really don’t want to have to learn Rust and possibly reinvent wheels for your quick boilerplate hack.

      • toastal@lemmy.ml
        link
        fedilink
        arrow-up
        0
        ·
        2 days ago

        I literally used to say this last decade, but as I grew experienced with more languages/paradigms/systems, it became 3rd best, then 4th, until I realized it actually not really great at anything other than there is an large ecosystem around it (wildly varying in quality). To some that might be enough, & going outside what you know isn’t typically the most wise thing to do, but it’s not particularly simple, or readble, or performance, or composable, or offering great patterns. Anything that used Python in Nixpkgs tend to be the most unreliable software for actually building & using.

    • LANIK2000@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      2 days ago

      Can’t speak for the science libraries as I’ve never used em, and I’ll gladly just blindly accept that as truth, but for everything else it’s always a pain in the ass. For being designed to “run on anything” it sure is funny that 90% of the time I download a python app it doesn’t fucking work and requires me to look up and manually setup a specific environment for it. Doesn’t help that the error messages are usually completely random and unrelated to this…

      I always dread when some fucking madman makes the installer for their app in python, knowing it’ll probably fail… God forbid it’s a script that’s supposed to modify something else. Always a good time for reflection upon the choices that led me to this point.

      Even my old scripts I kept around for sentimental value. Half of those don’t work either, and I can’t be bothered to figure out what version I made em for.

      I tried my best to scrub python from my pc out of principle, but as you say, it’s soo common my distro uses it as a dependency, fucking bullshit!

      • dudinax@programming.dev
        link
        fedilink
        arrow-up
        0
        ·
        2 days ago

        I guess I don’t know. Whenever something tempts me to R, I quickly find that Python’s got a good-enough solution.

        • Knock_Knock_Lemmy_In@lemmy.world
          link
          fedilink
          arrow-up
          0
          ·
          2 days ago

          R is better if you want some very specific, niche statistical packages.

          Python is better if you want to combine statistics with any other compute process.

        • menemen@lemmy.ml
          link
          fedilink
          arrow-up
          0
          ·
          2 days ago

          Same for me with python, I always fall back to R after 10 minutes of trying to do it in python. :)

  • fin@sh.itjust.works
    link
    fedilink
    arrow-up
    0
    ·
    2 days ago

    While being controversial, rye is very good for small personal projects. It does pretty much everything from python version management to project scaffolding.

  • pete_the_cat@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    2 days ago

    The thing that annoys me the most is how it cares about whitespace/carriage returns. I remember back in college when I was taking a CS class, learning Python and writing the Code on a Windows PC, emailing it to myself, and then attempting to run the code on Linux. Before I learned about the carriage return conversions, I remember having to rewrite about 75 lines of code before I got it to run. 🤬

  • brettvitaz@programming.dev
    link
    fedilink
    English
    arrow-up
    0
    ·
    3 days ago

    Very little of this is uniquely a problem in Python. It seems to me that your problem is with software development in general.

        • synae[he/him]@lemmy.sdf.org
          link
          fedilink
          English
          arrow-up
          0
          ·
          2 days ago

          That’s the part I like the most. I don’t want to work on any code that isn’t properly formatted, and at that point why bother with curly braces, etc?

          • Tiefling IRL@lemmy.blahaj.zone
            link
            fedilink
            arrow-up
            0
            ·
            edit-2
            2 days ago

            They help to digest the individual code blocks. My mind doesn’t digest whitespace the same way, it simply interprets it as formatting.

            It’s also much more frustrating to edit imo since the formatter generally has no idea what to do with misaligned whitespace. I also find it frustrating that you can’t do multiline lambdas, last I used it.

        • azimir@lemmy.ml
          link
          fedilink
          arrow-up
          0
          ·
          2 days ago

          The same meme with “wiring and lights” at the top. Then you descend to motors, transformers delta-y phases, RC and RL circuits, op amps, BJT circuits, reverse bias what?, differential equations, and eventually signals and systems.

          • HStone32@lemmy.world
            link
            fedilink
            arrow-up
            0
            ·
            2 days ago

            at least then you’re dealing with the laws of nature instead of man-made BS. if you’re like me and have 0 tolerance for BS, it’s an absolute win.

  • heavy@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    0
    ·
    3 days ago

    I don’t know who needs to hear this, but Python, like most languages, can be as complex as you make it.

  • SatyrSack@lemmy.one
    link
    fedilink
    arrow-up
    0
    ·
    3 days ago

    Are any of those things that you actually deal with as a beginner, though? Sure, those add complexities, but by the time you start to get into them, you are probably no longer a beginner.

    • Ephera@lemmy.ml
      link
      fedilink
      arrow-up
      0
      ·
      2 days ago

      I don’t know, man, far too many people seem to think that “easy to learn” means they’ll know all they need to know in relatively short time.

      Like, you talk to our data scientists and they’ll tell you doing anything in Python, no problem. But you talk to our seasoned software engineers and you see the war flashbacks in their eyes, because it racks up in complexity so fucking quickly, it’s insane.

    • MashedTech@lemmy.worldOP
      link
      fedilink
      arrow-up
      0
      ·
      3 days ago

      Of course… But the idea is that it is misleading… And there’s more traps the beginners falls into. I have a feeling if beginners begin with C++, or other language that is strongly typed and requires memory management and then do some other language that is more abstract like python; they will become better programmers compared to them doing it in reverse.

      • thebestaquaman@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        22 hours ago

        For someone starting out, I would say that a major advantage of Python over any compiled language is that you can just create a file and start writing/running code. With C++ (which I’m also a heavy user of) you need to get over the hurdle of setting up a build system, which is simple enough when you know it, but can quickly be a high bar for an absolute beginner. That’s before you start looking at things like including/linking other libraries, which in Python is done with a simple import, but where you have to set up your build system properly to get things working in C++.

        Honestly, I’m still kind of confused that the beginner course at my old university still insists on giving out a pre-written makefile and vscode config files for everyone instead of spending the first week just showing people how to actually write and compile hello world using cmake. I remember my major hurdle when leaving that course was that I knew how to write basic C++, I just had no idea how to compile and link it when I could no longer use the makefile that we were explicitly told to never touch…

        • SuperSpruce@lemmy.zip
          link
          fedilink
          arrow-up
          0
          ·
          12 hours ago

          100 times this.

          I think I have a solid grasp of C++ and its manual memory management, but give me a build error and I’ll have zero clue how to fix it.

      • xpinchx@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        2 days ago

        Yeah but fuck all that python is good enough for most beginners. Variables, scope, loops, functions, operators… Once you get some of the principles down switching to C++ or similar isn’t nearly as bad.

        Being a person that tried to learn C/C# from scratch in my early days python was a good gateway language.

  • jeffhykin@lemm.ee
    link
    fedilink
    arrow-up
    0
    ·
    3 days ago

    I didnt upvote the other python-beginer friendly meme cause it wasn’t accurate. But this one is on point.