also I just realized that Brazil did NOT make a programming language entirely in Spanish and call it “Si” and that my professor was making a joke about C… god damn it

this post is probably too nieche but I feel like Lemmy is nerdy enough that enough people will get it lol

  • edinbruh@feddit.it
    link
    fedilink
    English
    arrow-up
    11
    ·
    17 hours ago

    I’ll be honest, I think modern python is cool. You just need to accept that it has some limitations by design, but they mostly makes sense for its purpose.

    It’s true that the type system is optional, but it gets more and more expressive with every version, it’s honestly quite cool. I wish Pylance were a bit smarter though, it sometimes fails to infer sum types in if-else statements.

    After a couple large-ish personal projects I have concluded that the problem of python isn’t the language, but the users.

    On the other hand, C’s design is barren. Sure, it works, it does the thing, it gives you very low level control. But there is nothing of note in the design, if not some quirks of the specifications. Being devoid of innovation is its strength and weakness.

    • realitista@lemmus.org
      link
      fedilink
      English
      arrow-up
      6
      ·
      13 hours ago

      As someone who studied C exclusively in school and used it for the majority of programming projects I had in the real world, coming to Python now is like moving from a kit car like a Caterham to a Mercedes S class.

      • JoeBigelow@lemmy.ca
        link
        fedilink
        arrow-up
        3
        ·
        6 hours ago

        Knowing nothing about code but a fair bit about cars, does that analogy mean like, you can play around with a kit car all you want because you built it, it’s relatively simple, and if you break it you’ll know why and how to fix it, and the Mercedes being the exact opposite?

    • DarkAri@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      7
      arrow-down
      3
      ·
      edit-2
      14 hours ago

      C does one thing really well and that’s everything fast with complete control. Python is cool for people just trying to bang out some scripts or learning to program but interpreted languages have no place in mainstream software. Devices are starting to become slower than computers 30 years ago because there is so much garbage being included in apps written in interpreted java and Python and other nonsense. It’s not just bad for the user but it’s bad for the planet. It shouldn’t take a million times the energy to run a simple program because someone doesn’t know how to write in a proper language. Python is okay for some things. The world has become too reliant on it though. Also just for purely selfish reasons if you are the type. Interpreted languages kill your battery life and ram and stuff. Modern android phones besides all their problems with Google ruining them like Microsoft are also just becoming incredibly slow and stupid. You can barely even open two apps without most android phones panicking and closing apps to save memory. A calculator app is 100 MBs now. The phone feels like it’s going to catch on fire when you open a notepad.

      • edinbruh@feddit.it
        link
        fedilink
        English
        arrow-up
        1
        ·
        6 hours ago

        I like many of your points, but your comment is facetious.

        You said it yourself, “it’s good for someone trying to bang out scripts”… and that’s it, that’s the main point, that’s the purpose of python. I will argue over my dead body that python is a trillion times better than sh/bash/zsh/fish/bat/powershell/whatever for writing scripts in all aspects except availability and if that’s a concern, the only options are the old Unix shell and bat (even with powershell you never know if you are stuck ps 5 or can use ps 7).

        I have a python script running 24/7 on a raspberry that listens on some mqtt topics and reacts accordingly asynchronously. It uses like 15kiB (literally less than 4 pages) of ram mostly for the interpreter, and it’s plenty responsive. It uses about two minutes of CPU time a day. I could have written it in rust or go, I know enough of both to do it, it would have been faster and more efficient, but it would have taken three times the time to write, and it would have been a bitch to modify, I could have done it in C and it would have been even worse. For that little extra efficiency it makes no sense.

        You argue it has no place in mainstream software, but that’s not really a matter of python, more a matter of bad software engineers. Ok, cool that you recognise the issue, but I’d rather you went after the million people shipping a full browser in every GUI application, than to the guys wasting 10 kiB of your ram to run python. And even in that case, it’s not an issue of JavaScript, but an issue of bad practices.

        P.S. “does one thing well” is a smokescreen to hide doing less stuff, you shouldn’t base your whole design philosophy on a quote from the 70s. That is the kind of shit SystemD hater shout, while running a display server that also manages input, opengl, a widget toolkit, remote desktop, and the entire printer stack. The more a high profile tool does, the less your janky glue code scripts need to do.

      • realitista@lemmus.org
        link
        fedilink
        English
        arrow-up
        7
        arrow-down
        1
        ·
        edit-2
        13 hours ago

        Uses less memory until it inevitably springs a memory leak. And its not a million times the memory, its ~10x. You should check out assembly language, it beats C in all the metrics you care about.