• masterspace@lemmy.ca
    link
    fedilink
    English
    arrow-up
    114
    arrow-down
    9
    ·
    4 days ago

    Lmao, bruh. How do people keep praising a language where messing up a space breaks everything and there is no real type system?

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

      I have never once, in nearly 20 years of using python, encountered IndentationError. Until today actually. I tried to make it happen because I couldn’t remember the class name.

    • jedibob5@lemmy.world
      link
      fedilink
      English
      arrow-up
      71
      arrow-down
      1
      ·
      4 days ago

      The whitespace doesn’t bother me. Any IDE worth a damn will manage that for you. As for the type system, yeah, I strongly prefer static typing, but for simpler projects I can see the convenience of it.

      My real issue with Python comes with managing a development environment when multiple developers are working on it. Dependency management in Python is a headache, and while in theory, virtual envs should help with synchronizing environments from machine to machine, I still find it endlessly fiddly with a bunch of things that can go wrong that are hard to diagnose.

      Python is great for small scripts, proofs-of-concept, and such, but I wouldn’t write anything more heavy-duty than that in it.

      • Eager Eagle@lemmy.world
        link
        fedilink
        English
        arrow-up
        21
        arrow-down
        3
        ·
        4 days ago

        You can totally write heavy duty things if you know what you’re doing: use type hints, static checkers, tests, etc. It just takes a bit more effort and care.

        • ByteJunk@lemmy.world
          link
          fedilink
          arrow-up
          15
          arrow-down
          1
          ·
          4 days ago

          But why would I use something that takes more effort and care?

          I’m sure you’re right and it’s possible, but if I don’t have to fix another python project at work I’ll be in heaven.

          • grue@lemmy.world
            link
            fedilink
            English
            arrow-up
            21
            arrow-down
            2
            ·
            4 days ago

            Because “more effort and care” in Python is still way less of a pain in the ass than the minimum enforced boilerplate necessary in most other languages.

          • Eager Eagle@lemmy.world
            link
            fedilink
            English
            arrow-up
            4
            ·
            4 days ago

            it’s more effort and care compared to a throwaway script, not necessarily compared to other languages

        • Ephera@lemmy.ml
          link
          fedilink
          English
          arrow-up
          6
          arrow-down
          2
          ·
          4 days ago

          Personally, my estimate doubles when we’re asked to implement something in Python…

          • Eager Eagle@lemmy.world
            link
            fedilink
            English
            arrow-up
            9
            arrow-down
            3
            ·
            4 days ago

            That’s a proficiency matter. Python is the language I can get something done the fastest today, but 6 years ago that would be Java or even JS for me.

            • fuck_u_spez_in_particular@lemmy.world
              link
              fedilink
              arrow-up
              6
              arrow-down
              1
              ·
              3 days ago

              Nah it’s also a language matter. People complain about Rusts complexity, meanwhile I complain about everything else in other languages, and am faster than in any other language, not necessarily because writing code is faster, but because I am able to just focus on writing code. I cannot tell that about other languages, because e.g. the packaging system is bad, or configuring an environment, or debugging stuff which a strong type-system would have caught already. Also IDE experience I think is the one thing that keeps me away from dynamic languages. Rust analyzer is so much better than anything else I’ve tried, and it keeps getting better (e.g. recently it was added to show whether a trait is object safe or not, and why it is not).

              Another thing that is often missed when comparing static with dynamic languages is just performance, python heavily relies on stuff written in a system language, as soon as a hot-loop is written in python, things get bad

            • Ephera@lemmy.ml
              link
              fedilink
              English
              arrow-up
              5
              ·
              4 days ago

              Eh, it’s most definitely part of it, but the biggest time sink that I expect when working with Python is fixing the build system every two weeks on different devs’ PCs. I do imagine, if you eventually find a solution that works on most PCs that this workload will go down, but we had a substantial Python part in my previous project and over the course of the 1½ years that we worked on it, it really felt like we were making negative progress. Near the end of it, I couldn’t use PyCharm anymore, because I couldn’t figure out for the life of me, how to make it recognize the dependencies again.

      • morrowind@lemmy.ml
        link
        fedilink
        arrow-up
        10
        arrow-down
        2
        ·
        4 days ago

        Any IDE worth a damn will manage that for you.

        Yeah in like 10% of cases. I’m copying something from a pdf my prof gave. The only ones able fix spacing now are me and God

        • Incblob@lemmy.world
          link
          fedilink
          arrow-up
          3
          ·
          3 days ago

          You, god, pretty much any Formatter and ide. Black Formatter: “All leading tabs are converted to spaces, but tabs inside text are preserved.” Vscode has a command to convert between the two, and non-leading tabs are a simple replace/regex away from being converted. If you mean unorthodox spacing, if you have code with like 7 leading spaces, then that’s a matter for a priest.

      • masterspace@lemmy.ca
        link
        fedilink
        English
        arrow-up
        8
        ·
        edit-2
        4 days ago

        Yeah, working on python projects professionally is always a nightmare of configuring env variables and trying to get your system to perfectly match the reference dev system. I find Node.js projects to often be the simplest and most pain free to setup, but even compiled languages like C# and Java are often easier to get up and going than python.

    • HiddenLayer555@lemmy.ml
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      4 days ago

      A statically typed Python would be my dream programming language.

      Can someone please make Typethon?

      • porous_grey_matter@lemmy.ml
        link
        fedilink
        arrow-up
        3
        ·
        4 days ago

        Type checking for python is not bad these days, just run pyright (or mypy, I would like to prefer the non MS solution, but we have found pyright much more rigorous) on your code. Yes obviously you can still get out of it with an ignore statement, and that might occasionally be necessary for some libraries, but if you enforce no errors in pre-commit or CI then it’s only a little worse than compile time.

      • ma1w4re@lemm.ee
        link
        fedilink
        arrow-up
        3
        ·
        4 days ago

        Pyright language server makes Typethon out of your Python at the cost of massive bugs and performance. I used to like it, until I got really sick of waiting about 10 seconds for a suggestion to appear when typing open() and really fucking sick of the entire server crashing after I type pow()

    • TriflingToad@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      4
      arrow-down
      2
      ·
      4 days ago

      because it’s easy to use. I don’t like strangling my code because it’s screaming about semicolons again

    • porous_grey_matter@lemmy.ml
      link
      fedilink
      arrow-up
      2
      arrow-down
      6
      ·
      4 days ago

      where messing up a space breaks everything

      Messing up some character breaks everything in any language, skill issue

      there is no real type system

      What does “real” mean? It’s pretty robust these days.

        • porous_grey_matter@lemmy.ml
          link
          fedilink
          arrow-up
          3
          ·
          edit-2
          3 days ago

          Yes, I love rust and use it regularly, but it is suitable for totally different use cases than python. Have you worked on a python project using strict type checking enforced in CI? It really isn’t so bad.

          • fuck_u_spez_in_particular@lemmy.world
            link
            fedilink
            arrow-up
            1
            ·
            3 days ago

            I haven’t, but everytime I try python I want to quit it so quickly because of the messed up packaging system and more importantly IDE experience (and I don’t think unless you are extremely disciplined with type annotations, that you’re getting even close to rust-analyzers performance). I enjoy just exploring dependencies with go to definition, and the trust I can have in the type system.

            I’m swearing everyday in my job about typescript, which is just javascript with leaky and unnecessary complex type annotations. So yeah I even consider typescript bad (and I doubt that python is better with type-checking).

            • porous_grey_matter@lemmy.ml
              link
              fedilink
              arrow-up
              2
              ·
              3 days ago

              In my experience which is pretty extensive with python but only moderate with typescript I’d say it’s probably better, easier to work with and offers a similar level of flexibility.

              Not sure what you mean by performance but it’s easy to be disciplined when you can’t commit something that isn’t fully annotated. I feel like I can trust it fairly well, except for rare occasions where external library code is wrongly annotated and I have to put some ugly shim in.

              Afaik you can just go to definition in literally any language, typing or no.

              I’m in total agreement about the packaging though, it sucks.

              • fuck_u_spez_in_particular@lemmy.world
                link
                fedilink
                arrow-up
                1
                ·
                edit-2
                3 days ago

                performance

                Like raw runtime performance, if I write the code in python, it’s ~ 100x slower than in Rust. You often get away with dumber stuff in Rust as the compiler is able to optimize it well. With python you would have to write your native bindings either in Rust/C or C++. So why not straight use Rust (as the other choices aren’t sa(f/n)e at this point anymore).

                Afaik you can just go to definition in literally any language, typing or no.

                No you can’t, at least not in the same way that a static type-system allows. As dynamically-typed programs are evaluated on runtime, so you often don’t know at the time while coding what is run. In untyped/dynamically typed languages you often use heuristics to jump into stuff, which is just less precise.

                There’s more to this, but I think you get what I mean, when you programmed more intensively with static generics in Rust (compared to something similar in say javascript or python without types), IDE experience is just more precise and correct (and more fun).

  • ChickenLadyLovesLife@lemmy.world
    link
    fedilink
    English
    arrow-up
    15
    ·
    3 days ago

    Y’all need Qt Creator: C++ for under the hood and Javascript for the UI. Virtually nonexistent base of coders who can do both competently and if you’re not careful you end up moving to Finland because of it.

  • fl42v@lemmy.ml
    link
    fedilink
    arrow-up
    32
    ·
    4 days ago

    I’ve learned python after CPP… And I can’t #even remember all the cases when I thought “damn, I wish I could’ve just used pointers”

    • Tiefling IRL@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      15
      ·
      4 days ago

      I’ve been in industry for a decade, big tech for over 6 years. And I STILL fucking hate Python. I can write in it, but everything about it just feels wrong

      • dafo@lemmy.world
        link
        fedilink
        arrow-up
        3
        ·
        edit-2
        3 days ago

        Similar story in our team with 2-15 YoE. We do TS and C# but recently did a hostile takeover of the API from one of our providers which is in python We all now fucking hate python. The codebase is fine, the language isn’t.

    • Treczoks@lemmy.world
      link
      fedilink
      arrow-up
      7
      ·
      4 days ago

      Even our C++ guys won’t touch my C code with all the pointer tricks and unions used for hidden castings. Whimps!

      But python has worse problems than lacking pointer. Have you ever copied a piece of code from an external source into a python source? It really can f-ck up everything if one has tabs and the other has spaces.

  • Agent641@lemmy.world
    link
    fedilink
    arrow-up
    7
    ·
    3 days ago

    Rust is a scrappy pimply kid vs a US Marine (still with pimples).

    Ada is just two redacted pictures

  • CarrotsHaveEars@lemmy.ml
    link
    fedilink
    arrow-up
    17
    ·
    4 days ago

    Let me guess. Are the Java and Python programmers happy after because they leave up their technical debt for someone else to resolve? 🤭

  • kameecoding@lemmy.world
    link
    fedilink
    arrow-up
    26
    arrow-down
    6
    ·
    4 days ago

    Java is in a completely different leagues to the rest of these.

    Whatever you think Java sucks at, the other languages mentioned here suffer from much worse.

  • Pasta Dental@sh.itjust.works
    link
    fedilink
    arrow-up
    22
    arrow-down
    4
    ·
    4 days ago

    Every time I use python it makes me want to throw my computer through my window. Doesn’t happen with other languages. Pip fucking sucks it seems like every time I want to install dependencies for a project there is one that throws a compilation error when installing it. Like, why does it not try to download the version of the package that works with my version of python?? It doesn’t even tell me why it failed!!!

    • Swedneck@discuss.tchncs.de
      link
      fedilink
      arrow-up
      8
      ·
      4 days ago

      i still do not fathom what on earth you people are doing to get these issues.
      The worst annoyances i’ve had with python is just running the correct commands to install stuff, which is no different from working with git.

    • jas0n@lemmy.world
      link
      fedilink
      arrow-up
      7
      arrow-down
      4
      ·
      4 days ago

      Yup. The fact that the “proper” method to develop is to work in a sandboxed environment tells me everything I need to know. I feel like the only thing you learn from python is how to fight python instead of anything about programming. Personally, I think we need to stop recommending it as a first language.

      • Incblob@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        3 days ago

        So… The proper way is… Global installs? What are you saying here?

        Just use poetry or something, install the environment in your project directory and you’re done. The versions of your dependencies are fixed, so are consistent across installs, and because it’s sandbox you aren’t polluting your system, and vice versa.

        And if you’re using a language that installs the dependencies localy, guess what? That’s what you’re already doing, only with less security.

        • jas0n@lemmy.world
          link
          fedilink
          arrow-up
          2
          arrow-down
          1
          ·
          3 days ago

          There’s another one?! What’s wrong with venv, pipenv, virtualenv, flit, conda, etc. I just want to write code, not fight with silly tools. It’s a scripting language after all.

          • Incblob@lemmy.world
            link
            fedilink
            arrow-up
            1
            ·
            3 days ago

            a) poetry came out 6 years ago, though UV is the new kid on the block, it’s easier to complain about that if you want to.

            b) so, you are fighting with silly tools, but don’t want newer, hopefully better tools? If you aren’t fighting with silly tools, then more options is bad? I guess it’s a bit confusing for beginners?

            c) how are you fighting with the tools? This is a genuine question, I don’t remember the last time that the tooling caused a problem and I’ve been working professionally with python for the last 5 years, on both small and larger projects, first I used conda, and in the last few years poetry. In poetry, it’s two commands to create a new environment, and install everything. The only time I had a problem was with an internal library that had misconfigured dependencies.

            d) here’s the rundown on the dependency tools:

            • Virtualenv is one of the oldest, from the python 2 times
            • venv is just a subset of Virtualenv that was integrated into the standard library to have venvs available without external tools
            • conda is not python specific, it also does R, Ruby, some DB stuff, etc… It tries for maximum compatibility with various systems. This is apparently very useful in bioinformatics which use very disparate tools.
            • Pipenv is an attempt to implement ruby-like dependencies. I don’t know much about it, it’s not used much.
            • flit is lightweight, for publishing packages only -poetry is what I am currently using. Simple toml based dependencies. Installs the packages wherever your want. Since it uses toml, it’s compatible with other tools like dependi to check for updates. It’s got a pretty good set of commands that you don’t need to remember because init and update is what you need 90% of the time. Can also publish packages, and has separate dev/prod dependency groups.
            • uv is the new one, written in rust (of course) and very fast. Also installs python versions, meaning you no longer need a separate tool/docker images to manage your python versions. No multiple dependency groups yet. Aiming to become the only tool you need to do anything in python. Still <v1.0 and not feature complete.
            • pdm is more of a project manager, that allows for plug ins, scripts, and also no virtual envs if you want. Does a lot of things similar to poetry.

            I mean, every one if these has a reason for existing, and is an improvement of the previous one (pdm started as a personal project, let people have their fun) . It’s also a good few years between them, so it’s not like they’re spamming them.

            • jas0n@lemmy.world
              link
              fedilink
              arrow-up
              2
              ·
              edit-2
              3 days ago

              My bad. I personally can’t stand Python, and am just a python hater. If I used python professionally as a general purpose language, I would probably want all the tools. Though… I never needed a virtual environment in another language.

              In the codebases I work in, python is occasionally used as a cross-platform scripting language, which is where its bread and butter should be. Never more than 200 lines. Every time I crack open a codebase, if there is any python, it doesn’t work. That will be the thing I have to fight before I get to work on the real problem. If it has been a year, it’s broken. If it’s a Linux project, you’re better off using Bash if you want it to run a year from now. On Windows, well…

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

                Did… Did someone on the Internet admit to not being 100% correct?!

                What is happening right now? Is it the apocalypse? the end times?

                Has great Cthulhu risen, neath the dark waves of the abyss to tear mind from-

                Ok, a bit dramatic, but when was the last time you saw anyone give an inch in an online argument?

                Anywho, thanks for the context, though I think the idea of python as a “scripting language” is a bit overblown.

                • jas0n@lemmy.world
                  link
                  fedilink
                  arrow-up
                  1
                  ·
                  2 days ago

                  I felt bad you typed all that out when I’m just a python hater who isn’t able to argue in good faith.

  • Victor@lemmy.world
    link
    fedilink
    arrow-up
    6
    ·
    4 days ago

    I have worked with TypeScript for about 6 years now, professionally, and I really enjoy it. It’s got all the nice things from JavaScript, obviously, and almost eliminates all the bad stuff/uncertainties from JavaScript. That’s my opinion. I feel very confident working with TS.

  • Eiri@lemmy.ca
    link
    fedilink
    arrow-up
    15
    arrow-down
    3
    ·
    4 days ago

    Python managed to turn me away before I wrote a single line of code.

    Running an already functional project took me nearly two hours and three separate tutorials.

      • Eiri@lemmy.ca
        link
        fedilink
        arrow-up
        14
        arrow-down
        2
        ·
        4 days ago

        Hmm, I follow the package’s readme and only get invalid command errors.

        Gotta install the pip dependencies.

        Oh but first you need to create a venv or everything will be global. Why isn’t that local by default like with npm? Hell if I know!

        Ah but before that I need to install the RIGHT version of Python. The one I already have likely won’t do. And that takes AGES.

        Oh but even then still just tells me the command is invalid. Ah, great, I live CLIs. Now I’ve gotta figure out PATH variables again and add python there. Also pip maybe?

        Now I can follow the readme’s instructions! Assuming I remember to manually open the venv first.

        But it only gives me errors about missing pieces. Ugh. But I thought I installed the pip dependencies!

        Oh, but turns out there’s something about a text file full of another different set of dependencies that I need to explicitly mention via CLI or they won’t be installed. And the readme didn’t mention that, because that’s apparently “obvious”. No it’s not; I’m just a front-end developer trying to run the darn thing.

        Okay. Now it runs. Finally. But there’s a weird error. There might be something wrong with my .env file. Maybe if I add a print statement to debug… Why isn’t it showing up?

        Oooh, I need to fully rebuild if I want it to show up, and the hot reload functionality that you can pass a command line argument for doesn’t work… Cool cool cool cool.

        • Eager Eagle@lemmy.world
          link
          fedilink
          English
          arrow-up
          4
          ·
          edit-2
          4 days ago

          yeah, all that setup sucks even after being writing python for years.

          Nowadays I’ve been running every project with uv and it’s a much better and faster experience, usually in 3 steps: 1. initialize, 2. add dependencies, 3. run project:

          
          # if the project doesn't already have a pyproject.toml with dependencies, initialize it
          # uv will also install the right interpreter if not present:
          uv init --python 3.13
          
          # anything you would install with pip, use uv add:
          uv add dep1 dep2
          
          # run the project / script
          uv run main.py
          
          

          Then in future runs (as long as you have the pyproject.toml), you can just do uv run main.py (shorthand to uv run python main.py), even when there’s no venv created. No more activating virtual envs. No more long interpreter installations. No more accidentally messing with system’s packages or the PATH variable. With the uv.lock that’s also a lot more reliable to reproduce than requirements.txt and similar.

        • TrickDacy@lemmy.world
          link
          fedilink
          arrow-up
          3
          arrow-down
          1
          ·
          4 days ago

          This does not reflect my experience with python at all. Except the version thing used to be a thing. Not really any more.

        • zalgotext@sh.itjust.works
          link
          fedilink
          arrow-up
          1
          arrow-down
          1
          ·
          3 days ago

          This has way more to do with that specific project being poorly written/not documenting things well than any shortcomings in Python