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
    10
    ·
    14 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
      ·
      10 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
        2
        ·
        3 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
      6
      arrow-down
      3
      ·
      edit-2
      12 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
        ·
        3 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
        10 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.

  • PhilipTheBucket@piefed.social
    link
    fedilink
    English
    arrow-up
    44
    arrow-down
    3
    ·
    19 hours ago

    C is the old carpenter, who can drive in nails with three strikes of the hammer and never forgets his tools.

    C# is his friend who just uses power tools instead. He is fine too. He goes home early whenever he can.

    Python is the new guy at work who thinks he’s super smart. He actually can do the job really well, but for some reason nobody likes him all that much.

    Javascript is the boss’s son who got the job since he agreed to stay off pills but he does not. He is useful to be friendly with, maybe, but avoid him any day that you can. Typescript is his weird fiancée. She is significantly less stupid but much more rarely useful, and also best avoided.

    Go and Rust are tight-knit friends who get shit done. They are extremely capable but also not friendly, they tend not to talk much.

    Clojure does mushrooms on weekends, and seems to believe he has key insights the rest of the crew is too dim to understand, but he also makes frequent simple mistakes on the job and forgets things. Also avoid.

    Java only has the job because he’s known the boss since they were kids. He was never that good, but now he is old, and frequently drunk. Avoid at all costs.

    • Otter@lemmy.ca
      link
      fedilink
      English
      arrow-up
      18
      ·
      18 hours ago

      COBOL handles the books because no one else can understand the system and it’s too much work to change after 40 years

    • Jankatarch@lemmy.world
      link
      fedilink
      arrow-up
      14
      ·
      edit-2
      18 hours ago

      Rust is that one rare type of guy who refuses to round measurements so you end up with “the drawer is 28.34646 inches tall.”

      Clojure one is perfect lmao.

    • squaresinger@lemmy.world
      link
      fedilink
      arrow-up
      11
      arrow-down
      3
      ·
      17 hours ago

      C is the old carpenter with leaky memory with heavy undiagnosed autism, who constantly cracks demented jokes like “Missing } at end of file”.

      He’s so mentally not there in fact, that if you don’t specifically tell him to return to you after finishing the job, he will neither figure out what he’s supposed to do, nor will he tell you what went wrong, but instead he will happily jump somewhere else, halucinate commands from the structure of the walls and start doing whatever the voices tell him to do.

          • PhilipTheBucket@piefed.social
            link
            fedilink
            English
            arrow-up
            1
            ·
            3 hours ago

            I mean yeah lol. That’s why I said “mostly.” But my point was, more or less, that modern power tools can do stuff that you simply can’t do with C, but C is still a venerable tool to me. I like it. The old pros can make fantastic custom cabinets, they do framing almost as fast as someone with a nail gun, it’s just that it’s not practical for most people to try to get skilled enough to be able to make solid stuff (and of course you can never make a skyscraper with just hand tools.)

            Once you start finding yourself using malloc() all that much, you’re probably using the wrong tool, and it’s also just objectively less secure than other safer languages. But clean C code has a kind of beauty to me that is hard to replicate in the more powerful languages.

    • boletus@sh.itjust.works
      link
      fedilink
      arrow-up
      2
      arrow-down
      1
      ·
      12 hours ago

      Yeah and the new guy takes 3 days to finish the job that the old carpenter can do in 2hrs. And when he wants it done faster he quickly asks the old guy to do it for him. That’s why nobody else in the site likes him.

  • Captain Aggravated@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    7
    ·
    14 hours ago

    Python is my “native” programming language, it’s the first I learned, and many of my leaps in understanding of the language have resulted from thinking “Wait, Python is a smart ass. I bet it can do…”

    • balance8873@lemmy.myserv.one
      link
      fedilink
      arrow-up
      6
      ·
      8 hours ago

      That’s because it’s a stupid take. Believing brazil named a programming language after a Spanish word is pretty embarrassing too but I guess English speakers do that constantly.

  • Treczoks@lemmy.world
    link
    fedilink
    arrow-up
    3
    ·
    15 hours ago

    also I just realized that Brazil did NOT make a programming language entirely in Spanish and call it “Si”

    Imagine Python did this, and people would programming in Dutch!