• peopleproblems
    cake
    link
    fedilink
    439 months ago

    It’s actually kind of nice coming from C.

    I’m reading this and all I can think is “yeah, I too would rather lose a limb than let a necrotic infection spread.”

    • @[email protected]
      link
      fedilink
      159 months ago

      C sucks to write and take care of memory, but it’s nice for super efficient code for use on smart watches. Samsung ditched it (tizen- native apps written in C) in favor of wearOS (java?), and their battery life is now less than half what it was.

            • @[email protected]
              link
              fedilink
              19 months ago

              I haven’t used it in a while, so I don’t remember off the top of my head. I guess the main thing is the syntax is much more natural than C-likes. It can be wordy but the flip side is that it’s easier to read and decipher.

              I don’t really think it has a future though. It was released in the 80s and suffers the same constraints from backwards compatibility as any other old language. Also it was intended to run on everything, so they limited the character set, which resulta in round brackets being the only brackets there are, which can lead to ambiguous code where for example you’re not sure if you’re accessing an array or calling a function that has the same name.

              I really want a safe language that has actual nice syntax instead of some gibberish with lots of symbols, and Ada is the closest I’ve found, but she’s old and forgotten now.

        • frozen
          link
          fedilink
          59 months ago

          Holy hell Java on a Smartwatch?

          WearOS is based on Android, which uses Android Runtime (ART) as the application runtime. ART uses Java (or any other JVM-compatible language, such as Kotlin) as the development language, but compiles the app to native code when it’s installed on a client device.

          So… Kind of?

    • @[email protected]
      link
      fedilink
      English
      5
      edit-2
      9 months ago

      I hate writing code in either language. But at least what C has going for it is that it’s waaaay simpler than C++. Simple can be a really good thing. Sure, all those cool features can save you time, but they can also be gotchas that will cause bugs.

      Though it is a balancing act. Too simple and you’ll make mistakes due to how much you have to repeat yourself or using unsafe equivalents (like using preprocessor directives to mimic features that C++ natively supports).