• @[email protected]
    link
    fedilink
    312 years ago

    Python. Not even a competition. My love of programming quadrupled the day I switched to python and it’s getting stronger and stronger. I have now 10 years of professional python experience and around the same of C++ with occasional C#. A few projects in Go and Java. They all have ups and downs, but… Not even comparable how much everything is more elegant and simple in python

    • @[email protected]
      link
      fedilink
      English
      222 years ago

      I don’t get it. I love python for small quick projects. But anytime things get more complicated, I find myself constantly tripping over myself without the strong typing and errors letting me know I when I’ve changed a property in a class that in falling elsewhere.

      • @[email protected]
        link
        fedilink
        52 years ago

        Python was always strongly typed. For years there has been optional static typing and - you know - unit tests.

        If you’re having significant issues due to not knowing what types you’re using, the type system may not be your greatest problem…

        • @[email protected]
          link
          fedilink
          English
          82 years ago

          Sorry, I meant static typing, not strongly typing. I often cross the two. But this is exactly what I mean, if you want something to be statically typed you have to put in the extra effort, if not you’ve got dynamically typing, which is fine when things are small but I find causes stumbling blocks when things get larger.

          And depending on the scale of the project I’m working on, my unit tests usually take minutes to run, if not hours. If I’m debugging and I change a property, when I compile it instantly catches that I forgot to change it elsewhere. Hell, even when I save it I’ll get a little error warning. Maybe running unit tests all the time is fine if the project is small, but not if it’s large. I’m not going to run unit tests every time I’m starting a new debugging session. Linters kind of make up for this. But then we are back to making sure there are type hints, which, as I’ve been told, is not “pythonic.”

          If people like it, more power to them, I’m not shitting on the language as even I like it. I just can’t use it for larger stuff, and I’ve never worked anywhere that uses it for larger stuff, and I think for good reason.

        • @[email protected]
          link
          fedilink
          72 years ago

          These exist in theory, but as a whole, I’ve never seen them working at even the base level of what you get in other languages.

          Adding type hints to your code is fucking exhausting, because there is no type inference.
          MyPy regularly calls it quits, when any library doesn’t have type hints. PyCharm regularly doesn’t properly auto-complete, because it doesn’t have type information (if it can load your project correctly to begin with).
          Unit tests exist, yes, but you need 100% test coverage to make the language properly check all code paths. Without it, even just calling a library isn’t guaranteed to work. In no fully statically typed language, would I recommend 100% test coverage, unless you have special correctness requirements.

      • @[email protected]
        link
        fedilink
        3
        edit-2
        2 years ago

        Yeah, C libraries can be used in basically any mature language. It’s just too useful to not have.

        And Rust, since it doesn’t need a runtime, can emulate the format of C libraries.
        Rust libraries can also specifically target Python via https://pyo3.rs, but as I understand, this just does the C library format, plus a basic Python wrapper to make it nicer to use.

        • @[email protected]
          link
          fedilink
          42 years ago

          Sorry, I meant in the context of OPs question (so i guess up to them to set the rules). As in, you pick Python for the rest of your life, does that lock you out of C libraries? Its a bit of a rabbithole though, as many language runtimes would get excluded as well. There arent many languages that actually stand alone.

          • @[email protected]
            link
            fedilink
            32 years ago

            Ah, right, my interpretation is that as long as you don’t need to touch the source code, you’re good.

            But yeah, it’s certainly not as clear cut. My pick would actually be Rust, because you can use it for pretty much everything, including web frontends via WebAssembly.
            However, in that case, you still write HTML+CSS, which technically may or may not be programming languages, and the DOM API is actually only documented in JavaScript. So, I wouldn’t need to write JS, but would still want to read it…

            • @[email protected]
              link
              fedilink
              32 years ago

              Thats probably the best way to look at it, otherwise it gets very difficult very fast.

              If markup languages are locked out, then rust has other problems, because you then can’t change your cargo.toml file anymore.

              And then there is the build script problem :/

              As a thought excercise this has been interesting, there certainly are a lot of inter-dependencies between languages the deeper you look.

              • @[email protected]
                link
                fedilink
                22 years ago

                Yeah, I found it quite interesting, too. To some degree, I’ve been wondering why it’s so natural for programmers to be programming language polyglots, even if they’re not actively nerds/excited about them.
                And yeah, this discussion made me realize that you basically can’t take a single step in programming without being confronted with multiple languages/syntaxes at once.

    • @[email protected]
      link
      fedilink
      62 years ago

      You could write a compiler for a low-level language in anything. Honestly makes little sense that most people do it in C++ when they’re only going to replace it anyway.

    • @[email protected]
      link
      fedilink
      32 years ago

      Zig > Rust because actually writing safe Rust code

      Start thinking more functional, I rarely have issues with the borrow-checker, or even have to write unsafe. But it obviously depends on the context, when the issue at hand really requires a lot of interior mutability or unsafe can be pain.

      I’m also super fast nowadays with Rust, probably faster than with any other language (thanks to great tooling?).

  • @[email protected]
    link
    fedilink
    English
    72 years ago

    I would be torn between Python and Rust.

    The case for Python is that I’m already very experienced in it (nearly 20 years), there’s a good job market out there for it, and the ecosystem is one of the best in existence. It’s like a comfortable well made jacket, maybe a tad worn in some areas but very functional. And it’s not standing still, with a community that’s committed to constant improvement.

    Rust is more fun. I like the way it’s been put together. It can also be used in more areas. There are some niches (wasm, low level, kernel) where Python just doesn’t work. It has been able to benefit from the years of mistakes from Python and other languages on things like how it handles Unicode strings. I don’t know it as well as Python, but I barely get a chance to work with it so that could change quickly in time.

    • @[email protected]
      link
      fedilink
      22 years ago

      Behold, Rust is blazingly fast in approaching the most popular language :)

      Also, in comparison to Python you can do pretty much everything throughout the stack, which would be the reason I would go for Rust (not mentioning all the other niceties it has to offer).

      Also learning Rust nowadays is much more approachable compared to say 7+ years back (ecosystem got way better)

      • @[email protected]
        link
        fedilink
        English
        22 years ago

        All of this is very true! But it’s has to stack up against the large amount of experience with Python, both personally and in the industry. I have had to make decisions on project languages with an eye towards the abilities not just of myself, but of other people on my team. Fortunately, someone who knows Rust recently transferred onto my team, so we may do a project in Rust soon.

        • @[email protected]
          link
          fedilink
          12 years ago

          True, Python has a very big userbase and a lot of cool libraries and is nice to quickly hack something together.

          Though the title of the post is

          If you had to choose one programming language that you had to use for the rest of your life, what would it be?

          So TMU I want to predict the future in a way that it positively affects me, and find a language that fulfills this role best (throughout the stack, so that I’m not limited). And honestly I wouldn’t want to touch Python with a long stick, if the project is moderately complex (and isn’t easily off-loadable to native libraries that Python builds upon) and say > 5000 LOC, the super dynamic nature of python is a curse in this regard.

  • @[email protected]
    link
    fedilink
    English
    152 years ago

    Scala. Expressive, concise, can scale from simple to sophisticated. Sufficiently powerful - has metaprogramming, advanced types. Runs on a world-class runtime and takes advantage of a huge, mature package ecosystem that isn’t going anywhere.

    • UFO
      link
      fedilink
      32 years ago

      Seconded. The metaprogramming aspect of Scala is getting better and better.

    • interolivary
      link
      fedilink
      32 years ago

      “Sufficiently powerful” is a bit of an understatement when it comes to Scala. Honestly may have a bit too many features for my taste, it’s not a small language

      • @[email protected]
        link
        fedilink
        32 years ago

        Actually the language is quite small. The features, it has, are just quite powerful and have huge synergies so that it seems that you have a lot of complex features. It has a lot of weird corner case stuff, but most of that is because of the jvm and other languages have that too unfortunately.

        • interolivary
          link
          fedilink
          1
          edit-2
          2 years ago

          That’s a good point about the synergies, something like eg. a type system that’s expressive enough to be Turing-complete is going to have some effects. You’re right that it might just feel like a “kitchen sink language” due to complexity of the features it has, but then again I suppose it’s sort of one and the same where a language’s complexity comes from.

          But it’s no Swift, at least; now that language really does have everything and the kitchen sink.

  • @[email protected]
    link
    fedilink
    English
    172 years ago

    JavaScript because you can do everything with it and long term all other languages will, most likely, gradually fade away (except for C/C++).

    • @[email protected]
      link
      fedilink
      8
      edit-2
      2 years ago

      Yeah, if I really took this question seriously, I would say JavaScript. It runs everywhere, it does everything, and it’s honestly pretty fun to work with, when it’s not being awful.

    • @[email protected]
      link
      fedilink
      22 years ago

      In 20 years we’ll be able to run Javascript on microcontrollers, that will be an interesting day.

      • @[email protected]
        link
        fedilink
        English
        42 years ago

        20 years? Ahahah

        https://github.com/espruino/Espruino

        Espruino is a JavaScript interpreter for microcontrollers. It is designed for devices with as little as 128kB Flash and 8kB RAM.

        Before anyone says that an ESP32 isn’t actually a microcontroller let me just point out that it doesn’t really matter. A few years ago a board with an ATmega 2560, lets say an Arduino, would cost around 30€, today you can get ESP32 boards with WiFi and way better performance for 3€ making the Arduino 2560 mostly useless / not cost effective.

        In just 5 years with all those new RISC and ARM chips will most like triple their performance and take over what is now done by high end AVR and PIC microcontrollers. Costs will go even further into cents and microcontrollers as we know them will become irrelevant. With the extra performance JS will become the most popular language simply because developer time is more expensive than hardware.

      • Dave.
        link
        fedilink
        1
        edit-2
        2 years ago

        15 years ago I was running multi-tasking BASIC programs on a controller that had 2MB of storage. We should have been there by now.

        Holy shit, they’re still kicking around:

        https://wilke.de/en/embedded-computer/details/zurueck/computer-module/products/tiny-tiger-multitasking-computer.html

        I used a few for high speed logging of a quadrature rotary encoder to measure the speed of a hydraulic sampling arm. Battery powered , had a 4 line LCD and keypad with a simple menu interface to take samples, as well as a serial export function to get .CSV files via hyperterminal.

    • bedrooms
      link
      fedilink
      22 years ago

      If I can choose a single language that’d be lisp. Very beautiful to write.

  • @[email protected]
    link
    fedilink
    8
    edit-2
    2 years ago

    I’d love to take Haskell, but there’s neither enough support nor enough jobs. Same with most functional languages really. But nothing else compares.

    • @[email protected]
      link
      fedilink
      42 years ago

      Truly! One day I decided to take the plunge and learn functional programming with Haskell—I haven’t been the same since.

  • Rikudou_Sage
    link
    fedilink
    132 years ago

    PHP or C++, I love both of them for different reasons. Tough one deciding between the two.

    • @[email protected]
      link
      fedilink
      English
      42 years ago

      Who downvoted this person’s preference?

      Like “you preferenced wrong”? “You have the wrong likes”? “You like something different from me?”

        • @[email protected]
          link
          fedilink
          English
          22 years ago

          You’re welcome to like what you like

          The person upthread got downvoted for what they like. 🤷

        • Amju Wolf
          link
          fedilink
          English
          32 years ago

          You got it backwards there. PHP was pretty bad (mostly because it was easy to pick up so novice and shitty programmers used it a lot), but got insanely better, and it absolutely stood the test of time - most of modern web still uses it and it isn’t going anywhere. There are also few languages that would have such a robust ecosystem where you could whip up a solid, complete app in a few hours. JS comes close but its ecosystem is a clusterfuck. Everything else has poor third party support - be it libraries, connectors to various services or just simply best practices (for web).

          • @[email protected]
            link
            fedilink
            12 years ago

            I would argue but there is nothing to say about clearly wrong statements. PHP was ‘good’ (compared to nothing comparable) and is now no challenger any more. It stays as a result of dullness. “Everything else has poor third party support”? Well let me answer this as accurate as possible: lmao

            • Amju Wolf
              link
              fedilink
              English
              12 years ago

              …so you have not, in fact, used PHP in the past decade or so. Thanks for letting us know.

      • Pyro
        link
        fedilink
        English
        72 years ago

        The did not follow the hivemind of “Rust good, JS slow, C complex, PHP bad” which clearly means they are in the wrong /s

      • @[email protected]
        link
        fedilink
        72 years ago

        Don’t lump them in with us! I’m a proud member of the Satanic Temple, and I wouldn’t touch PHP on my most hedonistic night.

        There’s the Devil, and there’s the Devil.

        • @[email protected]
          link
          fedilink
          82 years ago

          Haha. I’m sure they’re joking.

          But probably because you chose two languages with relatively scary syntax.

          I don’t know how to create automation to summon extraplanar nightmare creatures, but if I had to start, my first attempt would be PHP, and I know in my heart that getting it working would require C++.

            • @[email protected]B
              link
              fedilink
              132 years ago

              Here’s your image!

              AI image generated with the prompt from the previous comment


              The AI model has revised your prompt: A terrifying creature from another dimension is being summoned. This is happening through a unique and unusual method, which combines elements of computer coding. The person initiating the summoning is dynamically typing a hybrid language that merges the syntax and functions of two popular programming languages, PHP and C++. The scene is imbued with a supernatural feel as ethereal lights emanate from the lines of code, giving a clue that this is not ordinary programming but something arcane and otherworldly.

              • Dave.
                link
                fedilink
                42 years ago

                5 stars, would summon with an unholy mix of C++ and PHP again.

            • Amju Wolf
              link
              fedilink
              English
              32 years ago

              Have you used modern PHP with its ecosystem and frameworks? It’s actually really solid, and really good at what it aims to do.

        • interolivary
          link
          fedilink
          22 years ago

          I think it’s the PHP, makes people doubt your soul’s status that you’d subject yourself willingly to it

          • Rikudou_Sage
            link
            fedilink
            12 years ago

            Well, that’s quite easy - if you judge a language by what it looked like 10 years ago, your opinion doesn’t matter

              • Rikudou_Sage
                link
                fedilink
                12 years ago

                Half of that are lies and you can clearly see how up to date it is, because in one example it mentions php 5.1. That is close to 20 years old, it was released in 2005. I’m not gonna spend my time trying to disprove something that refers to a 20 years old version as its point of reference.

                Don’t get me wrong, there are valid drawbacks of PHP (as with any language), this document just isn’t a good representation of that.

            • interolivary
              link
              fedilink
              22 years ago

              Because no way could I dislike modern PHP. Maybe you just have low standards when it comes to programming languages?