• @pete_the_cat@lemmy.world
    link
    fedilink
    English
    0
    edit-2
    8 months 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. 🤬

  • JackbyDev
    link
    fedilink
    English
    08 months ago

    I think venv is the best because it’s built in. But I’m also not a Python dev.

  • @powermaker450@discuss.tchncs.de
    link
    fedilink
    English
    0
    edit-2
    8 months 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

  • @Smoogs@lemmy.world
    link
    fedilink
    08 months 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.

      • @Smoogs@lemmy.world
        link
        fedilink
        0
        edit-2
        8 months 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
          08 months 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.

    • @Swedneck@discuss.tchncs.de
      link
      fedilink
      08 months 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
        0
        edit-2
        8 months 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.

    • janAkali
      link
      fedilink
      English
      0
      edit-2
      7 months ago

      Meanwhile Nim:

      echo "I am still worthy"
      
      let a = r"I hate the ugly '\' at the end of " &
               "multiline statements"
      
      for x in 0..9:
        if x == 6: echo x
      
      echo x # this is error in Nim, but not in python. Insane!
      
      assert false + 1 # this is an error (python devs in shambles)
      assert true - 1 # see above
      

      Thanks for coming to my Ted-talk.
      More here: Nim for Python Programmers

    • @wewbull@feddit.uk
      link
      fedilink
      English
      08 months ago

      Computer programming, regardless of language, is hard. The computer does exactly what you tell it to.

      • @CanadaPlus@lemmy.sdf.org
        link
        fedilink
        08 months ago

        Yes. That being said, it matters which language you choose. COBOL is always a bad choice, unless writing in COBOL is the whole point. There isn’t really a universal best choice, either. Python is often a good one, but if you’re doing something big it will become this meme.

    • Snot Flickerman
      link
      fedilink
      English
      08 months ago

      But the Lord came down to see the city OS and the tower app the people were building. The Lord said, “If as one people speaking programming the same language they have begun to do this, then nothing they plan to do will be impossible for them. Come, let us go down and confuse their language so they will not understand each other.”

      So the Lord scattered them from there over all the earth, and they stopped building the city OS. That is why it was called Babel—because there the Lord confused the language of the whole world. From there the Lord scattered them over the face of the whole earth.

      This message brought to you by TempleOS

    • @xavier666@lemm.ee
      link
      fedilink
      English
      08 months ago

      There are 2 types of programming languages

      • The type everyone keeps complaining about
      • The type no one uses
  • @DerArzt@lemmy.world
    link
    fedilink
    08 months ago

    For how popular of a language python is, at this point it’s a bad sign to me that the language has default way to manage versions and create new projects. I get having options, but options are annoying to new folk.

    • Ephera
      link
      fedilink
      08 months ago

      Honestly also annoying as a not-so-new folk. I just thought about this yesterday, I reasonably expect to clone a random project from the internet written Java, Rust et al, and to be able to open it in my IDE and look at it.

      Meanwhile, a Python project from two years ago that I helped to build, I do not expect to be able to reasonably view in an IDE at all. I remember, we gave up trying to fix all the supposedly missing dependencies at some point…

      • @psud@aussie.zone
        link
        fedilink
        08 months ago

        Does python not require you to include your libraries? How can the runtime environment not tell you “you used whatever library but whatever library isn’t installed” is it then hard to find the library? Does python not have anything like perl’s cpan to consolidate all libraries? Can’t you just grep for the libraries a project calls and loop over the results adding that library to the build environment?

        • Ephera
          link
          fedilink
          08 months ago

          It does have that, the ecosystem is just really fractured and also not good.

          Sort of the ‘standard’ way of managing dependencies is with Pip and a requirements.txt. By itself, that installs dependencies on your host system.
          So, there’s a second tool, venv, to install them per-project, but because it’s a separate tool, it has to do some wacky things, namely it uses separate pip and python executables, which you have to specify in your IDE.
          But then Pip also can’t build distributions, there’s a separate tool for that, setup.py, and it doesn’t support things like .lock-files for reproducible builds, and if I remember correctly, it doesn’t deal well with conflicting version requirements and probably various other things.

          Either way, people started building a grand unified package manager to cover all these use-cases. Well, multiple people did so, separately. So, now you’ve got, among others:

          • Pipenv
          • Pip-tools
          • Conda
          • PDM
          • Poetry
          • Rye

          Well, and these started creating their own methods of specifying dependencies and I believe, some of them still need to be called like a venv, but others not, so that means IDEs struggle to support all these.

          Amazingly, apart from Rye, which didn’t exist back when we started that project, none of these package managers support directly depending on libraries within the same repo. You always have to tag a new version, publish it, and then you can fix your dependent code.

          And yeah, that was then the other reason why this stuff didn’t work for us. We spent a considerable amount of time with symlinks and custom scripts to try to make that work.
          I’m willing to believe that we fucked things up when doing that, but what makes still no sense is that everything worked when running tests from the CLI, but the IDE showed nothing but red text.

      • Akatsuki Levi
        link
        fedilink
        English
        08 months ago

        If the language can just break during runtime because of code indentation, I can’t really trust it

    • Pennomi
      link
      fedilink
      English
      08 months ago

      Why would it be a bad sign that the language has built in tools for common things you need to do?

      • @driving_crooner@lemmy.eco.br
        link
        fedilink
        08 months ago

        One of the things that frustrated me more with python, coming from R and Julia, was that the math and statistics functions weren’t default. But after learning more, and learning the math, numpy, scipy and others started yo like that, there’s different projects working on the same and you pick and choose what works better for you.

      • Ephera
        link
        fedilink
        08 months ago

        I’m guessing, they meant to write “that the language has no default way”.

  • @fin@sh.itjust.works
    link
    fedilink
    08 months ago

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

    • lime!
      link
      fedilink
      English
      08 months ago

      they are also working on a follow-up, uv. not really a fan of writing tooling in another language but it works really well.

    • Pumpkin Escobar
      link
      fedilink
      English
      08 months ago

      Coming from c# then typescript and nextjs, rye feels very intuitive and like a nice bridge / gateway drug into python.

      • @marlowe221@lemmy.world
        link
        fedilink
        English
        08 months ago

        I know this may be an unpopular opinion on lemmy, which leans so heavily towards Linux and FOSS, and I’m a Linux user myself but….

        I actually really like C# and .NET (the modern cross-platform version anyway).

        • MrScottyTay
          link
          fedilink
          English
          08 months ago

          .net from core 2 was awesome. From 5 onwards it’s been beyond amazing!

  • @dudinax@programming.dev
    link
    fedilink
    08 months 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.

    • @LANIK2000@lemmy.world
      link
      fedilink
      08 months 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!

      • Kichae
        link
        fedilink
        English
        08 months ago

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

    • The Menemen
      link
      fedilink
      08 months ago

      Is it better than R? I am not so much into python (too embedded in R).

      • @dudinax@programming.dev
        link
        fedilink
        08 months ago

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

        • 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.

        • The Menemen
          link
          fedilink
          08 months ago

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

    • @azimir@lemmy.ml
      link
      fedilink
      08 months 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.

      • @toastal@lemmy.ml
        link
        fedilink
        08 months 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.

      • @CanadaPlus@lemmy.sdf.org
        link
        fedilink
        0
        edit-2
        8 months 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.

  • @brettvitaz@programming.dev
    link
    fedilink
    English
    08 months ago

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

    • JackbyDev
      link
      fedilink
      English
      08 months ago

      No, the dependency management in Python is a nightmare. There’s like a billion options for it.

        • JackbyDev
          link
          fedilink
          English
          08 months ago

          What’s the difference? I rarely use Python and every time I do I have to relearn which tools are the go to ones. In Java it’s a little simpler, we really just have Maven and Gradle. They have their own problems, sure, what tool doesn’t, but the thing that annoys me about python is the quantity of tools. There often isn’t a clear winner.

          Now, to be fair to python, a lot of the ones mentioned on this post are very specifically for data science use cases and not general purpose development.

        • synae[he/him]
          link
          fedilink
          English
          08 months 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
            link
            fedilink
            0
            edit-2
            8 months 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
          08 months 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
            08 months 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.

  • @Machindo@lemmy.ml
    link
    fedilink
    08 months 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.