• OpenStars@piefed.social
    link
    fedilink
    English
    arrow-up
    2
    ·
    15 hours ago

    In trying to learn more about it, I copied and pasted code the other day… ofc it broke everything I had previously built up, but invisibly ofc bc why da fuq not. Fortunately copying and pasting code is something that real programmers never, ever do, right? :-P (I use Vim btw)

    The literal creator of Python said that when first learning it, it is best to avoid an IDE. But if that would better handle a copy-paste…

    Also one of the standard tricks in any C++ style language is to purposefully write a single line or block of code that is meant to be ran once then intended to be thrown away - i.e. debugging - in a radically different indentation style so as to call attention to it, whereas in Python it absolutely must blend in with the entire rest of the code block:-(.

    In reading about the situation, Python did not “win” so much as Perl shot and killed itself with the whole 6 vs. Raku situation:-(.

    • hark@lemmy.world
      link
      fedilink
      English
      arrow-up
      2
      ·
      8 hours ago

      Yeah, the argument for the indentation in Python is to enforce good formatting, but these days an IDE will do the good formatting for you, so now all that indenting does is make copying and pasting error-prone. Maybe that’s a benefit since it’d force you to look at what you copied and pasted. I’ve also heard about the Python vs Perl thing, but also Python looks a lot more welcoming to a beginner and is easier to pick up. I’m sure Perl fumbling contributed, but a lot of newer projects would’ve probably gone with Python anyway, like the data science stuff where the easy interface is exposed through a Python library and all the messy stuff is just C or C++ underneath.

      • OpenStars@piefed.social
        link
        fedilink
        English
        arrow-up
        2
        ·
        edit-2
        7 hours ago

        Oh yes, but now aren’t you arguing on my side here, that Python is helpful for PieFed to gain features more rapidly than Rust might?:-D

        One thing about Perl scripts is that if someone sent one to you and you looked it over and ran it, it would be very likely to function (edit: in the past, this used to be true). That seems no longer true nowadays though, and also the same is not true of Python either, or C++ for that matter. Even so, Python’s package management is world infamous for being annoying, and yet… what else is there that would be more worthwhile to use?

        And against all of that backdrop, the Lemmy developers chose Rust, a language which isn’t even finished yet and is therefore even more likely to change - in MAJOR ways - than any of these others. I am not even criticizing that, just saying that with that niche covered, it will be nice to see what Python (PieFed) or Java (Sublinks) can offer as well.:-)

        • hark@lemmy.world
          link
          fedilink
          English
          arrow-up
          3
          ·
          6 hours ago

          Python absolutely is faster to get things going since it’s a lot more simple and flexible, that was never a point of contention, but it goes back to the issue of tech debt. The more you take advantage of Python’s simplicity and flexibility, the more pain you’ll be in when you need to untangle the mess and work out performance issues later on.

          Rust is a finished language, as much as one can be anyway. It’s stable and doesn’t have breaking changes. The editions mechanism means they can introduce more dramatic changes, but your older code will still function by assigning it an edition and you can always upgrade by making the changes necessary to jump to a later edition.

          • OpenStars@piefed.social
            link
            fedilink
            English
            arrow-up
            2
            ·
            3 hours ago

            I don’t know much what the performance bottlenecks would look like for a social media platform. Pages themselves can only be so large though I assume that as the total amount of content grows then it would scale more with activity, yet even that would have bounds placed upon it like no ability to comment on posts older than six months. Naively to me that sounds like it could take great advantage of parallelization, and therefore not be as well suited for Python, though perhaps an actual database system is being used? Which is obviously true so to clarify I meant using Python to connect to some more optimized SQL engine, and yet that sounds naive even to my own ears so definitely not trying to pass myself off as an expert.

            There may be value in seeing features arrive more quickly though, especially as people are leaving Lemmy to go back to Reddit, so if something could help them want to stay or even help bring in new ones, then even short term benefits may contribute towards a longer term future.