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

  • PhilipTheBucket@piefed.social
    link
    fedilink
    English
    arrow-up
    44
    arrow-down
    5
    ·
    10 days 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
      22
      ·
      10 days 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
      17
      arrow-down
      1
      ·
      edit-2
      10 days 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
      ·
      10 days 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
            ·
            9 days 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
      4
      ·
      10 days 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.

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

      Great story, but why antropomorphize? Would tools not be a better analogy?

      C is like having a box of nails, manual tools and some mortar. The Notre Dame was built like that.

      C# is like having a box of screws and some power tools. Some tools are still manual. This is how your grandma’s house was built.

      Java is similarily a mix of old and new, but you also have stuff like cement. That’s how new schools were built.

      Python is like having a modern hardware store at your disposal. Big, clunky, and you need a stroll down the isles before you find what could work. Should I use this power tool I know or a new one more specific for the usecase? What are those little plastic screw sleeve thingies? This is how modern homes are built.

      Javascript is like US power tools. When trying to switch to them you’ll question your sanity, but you can still get stuff done just as well. However, only power tools: Want to drive a nail into something? Gonna need a semiautomatic nailgun. Want to hit something hard? Can’t use a hammer, there’s a power tool for that. Oh, and your nails and screws are shapeshifting. This is how the Opera House was built.

      Type script is like javascript, but you retain your organized nailbox. For some reason, not many things were built with it.

      Go and rust are like metric, traditional tools with some screws. However, they’re labeled in chinese. In essence, it’s the same as your run-of-the-mill tools. It just takes some time to get to know them. This is how a hospital gets built in a week.

      I’ve never done Clojure, so wouldn’t know.

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

        This is a very apt description.

        Lua is like using duct tape for everything. It worked to save the Appollo mission so it should work anywhere.

        Visual Basic is like using the tools you found in a cardboard box when you cleared out the house when your uncle died. You’ll get random, super specialized things, but if one of these old tools breaks, you just have to continue with the remains.

        Cobol is like using the toolshop at the Renaissance fair, only that the tools are original, not reproductions.

        Brainfuck is the like your kid’s toy tool box. Yes, there’s something that kinda looks like a plastic hammer, but good luck using it for anything other than role playing.

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

      “The C programming language is like debating a philosopher and Python is like debating someone who ate an edible

      Here “edible” is a drug. it means Python is going in all and every directions like someone high on drugs.

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

        I get that part. I just don’t understand how the analogy relates to the programming languages. Maybe it really is just a shitty analogy from someone who doesn’t know much about either language.

    • cooligula@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      12
      ·
      9 days ago

      Why would you hate on it? It has its usecases. You won’t build an OS in Python, but I’d much rather do data processing in Python than in C

        • cooligula@sh.itjust.works
          link
          fedilink
          English
          arrow-up
          2
          ·
          9 days ago

          You just cannot do it, I’m afraid. Python is an interpreted language, and requires de CPython library to be translated into machine code so that it can then be run, but that requires an underlying OS that makes the calls. The closest thing would be micropython, which can be run inside the Linux kernel, but that’s about it. The only thing I can think of is using a custom compiler that would generate either C/C++ or assembly code from a Python script, and then compile it using a standard C/C++/assembly compiler.

      • PeriodicallyPedantic@lemmy.ca
        link
        fedilink
        arrow-up
        2
        ·
        9 days ago

        I hate on it mainly for its lack of static typing.
        I tried building a HomeAssistant add-on in python, and it was not a good experience. Idk what IDE python devs usually use but VSCode did not provide much assistance.

        • cooligula@sh.itjust.works
          link
          fedilink
          English
          arrow-up
          4
          ·
          9 days ago

          You can in fact statically type in Python. For example, defining variables:

          six: int = 6
          hello_world: str = "Hello World!"
          

          Or defining functions:

          def foo(x: int) -> int:
              return x**2
          

          If you only want to use static Python, you can use the mypy static checker:

          # Install mypy if you don’t have it
          pip install mypy
          
          # Run the checker on the file (e.g., example.py)
          mypy example.py
          
          • Kornblumenratte@feddit.org
            link
            fedilink
            arrow-up
            2
            ·
            8 days ago

            That’s just a fancy way of commenting on the intended types, no static typing though.

            Python will happily execute:

            six: int = 6
            six = "Hello World!"
            
          • Omgpwnies@lemmy.world
            link
            fedilink
            English
            arrow-up
            1
            ·
            8 days ago

            What you’re describing is type hints, it’s syntactic sugar and not used at all by the interpreter.

            For example, this is a “legal” statement:

            foo: int = "bar"

            Your IDE and linter will complain, but the interpreter just chops the hints off when compiling, and it’s left with foo = "bar"

          • PeriodicallyPedantic@lemmy.ca
            link
            fedilink
            arrow-up
            1
            ·
            9 days ago

            I was using that syntax, but nothing seemed to be checking it. Running an external app to get static checking done isn’t great, presumably there are extensions for common IDEs?

            But the poor vscode developer experience went beyond that. I attribute it to dynamic typing because most of my frustration was with the IDE’s inability to tell me the type of a given variable, and what functions/properties were accessable on it.

            I hope it’d be better on an IDE made specifically for python, although idk how many extensions I’d have to give up for it, and things like devcontainers.

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

          I am currently taking a Python class and we are using PyCharm I’m not a developer, so I don’t know if it’s good yet.

    • QuinnyCoded@sh.itjust.worksOP
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      8 days ago

      i didn’t say anything negative about it, I like both languages (though python is way easier). i was just stoned and made an observation

  • hardcoreufo@lemmy.world
    link
    fedilink
    arrow-up
    7
    arrow-down
    1
    ·
    9 days ago

    I try to avoid python for two main reasons. While coding, white spaces. Who thought that was a good idea? While using, shared dependancies, again who thought thay was a good idea? I have to use pipx or manually make a venv otherwise python scripts start breaking each other. May as well just package it with its own dependancies from the get go.

    • PlexSheep@infosec.pub
      link
      fedilink
      arrow-up
      1
      arrow-down
      1
      ·
      9 days ago

      Thats nit my problem with it. My problem is that it’s too dynamic, especially that I can’t have proper types

  • Captain Aggravated@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    7
    arrow-down
    1
    ·
    10 days 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…”

    • squaresinger@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      9 days ago

      Python is 34 years old already. That means, someone who was already working as a programmer when Python came out would have to be about 54 years or older now.

      I wonder why people still think it’s the hot new thing.

      When Python came out, C was 19 years old. So Python is almost twice as old now as C was when Python came out.

      • normalexit@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        8 days ago

        I was thinking more along the line of Goldilocks and the three bears. What is the language that feels just right to you (given the obvious issues with C and Python)

        • squaresinger@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          8 days ago

          Makes sense what you are saying.

          When it comes to programming languages, I like to think of them as tools for a job. All languages have advantages and downsides.

          For server software Java is by far the best (especially if it’s supposed to scale). For web frontends it’s TypeScript. For very simple scripts that mostly call other tools it’s bash. For more complex scripts, non-performance-critical data processing and small projects it’s Python. For microcontroller work, C. For working on more performant microcontrollers C+Lua. For tests Groovy is surprisingly helpful. For game development GDScript or whatever your chosen environment supports.

          The rest is just syntax. It doesn’t really matter whether I use curly braces or indentation.

          I do like the old if-endif block style, but sadly that doesn’t really exist in mainstream languages anymore. Lua is the only thing that’s kinda similar, but they only use “end”, negating the advantage of being able to easier see where the “for” ends in a sea of “ifs”.

          I guess bash does something similar too, but “fi” and “esac” really break my fingers (and then they don’t even do “elihw”).

  • Treczoks@lemmy.world
    link
    fedilink
    arrow-up
    3
    ·
    10 days 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!