If you had to choose one programming language that you had to use for the rest of your life, what would it be?
If you had to choose one programming language that you had to use for the rest of your life, what would it be?
If you had to choose one programming language that you had to use for the rest of your life, what would it be?
DotNet Core as a whole (C# + F# + other languages that are being ported to compile down to a DotNet binary).
Because it has all the things Java promised us - frictionless, painless, cross-platform programs - but is implementing it far better than Java ever could.
Honestly, DotNet Core is now at least a half-decade or more ahead of Java in terms of the base platform and C# language functionality/ease-of-use. The only advantage Java has at this point is it’s community ecosystem of third-party features and programs.
I remember my first job working with C# - this was the common sentiment: it's a Java that is better than Java at being Java. I mostly agree with that.
Try using Kotlin some day, though. I consider that language to be even better than C#, and it additionally gets to leverage the JVM ecosystem.
Kotlin > C# > Java, in my book
I've been meaning to give F# a go but I never seem to get around to it. Seems like an interesting language
Get around to it, F# is fantastic! 😄
And those are enormous advantages. It will also get you a lot more jobs. I see Java jobs everywhere. I barely see C job postings at all.
Good thing they weren't talking about c.
Lisp, the language that has them all.
If I can choose a single language that'd be lisp. Very beautiful to write.
C, because it can run everywhere and I won't be limited on the things I can make
Me waiting for all the C websites written in AngularC /s
Lol cgi page generators written in C were the OG web framework. Maybe perl too.
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
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.
If you pick Python, do you still get libraries written in C or Rust?
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.
Python. I'm in data science. Sure I could write all that code in C or C++, but my time spent coding all that extra boilerplate is better spent on analysis.
I've already made this choice. Switched from C++ to Go, and now I never want to touch another language at all. Since I'm not writing kernels or embedded, Go is pretty fast for everything else. Not very popular in gamedev, but that's just a lack of 3rd party libs, specifically native graphics support.
As for other languages, I can't justify unnecessary complexity that is generally welcome by those language communities. Go is straight simple yet powerful, and I admire that.
I think I'm with you on this one. As another polyglot, I'm hesitant to pick anything, but the language I like working with most, today, is 'go'.
I think I would risk it and hope that 'go' gains libraries (or I just discovery existing ones) for other things I want to do later.
This would be my pick as well for all the same reasons.
I'd probably pick something esoteric and then just stop programming, tbh. I enjoy being a polyglot programmer, and learning many languages and learning from many ecosystems is incredibly interesting to me, far more than hyper-specializing in a single language would be.
I'd probably pick something esoteric and then just stop programming, tbh
I'll just leave this here for your consideration... "Friendship is Magic ++
Malbolge
INTERCAL
C, can build any other language from that :D
And if i am gonna be miserable, may as well inflict as many vulnerabities on everyone else while I am at it.
It would be C++. Its versatile enough to do everything with it.
Right? C++ feels like cheating. It has every conceivable feature, and you maintain sanity by not using most of them.
Rust:
For me it would be C++.
Likely either C or C++, both languages have been around for a long time and both are still used in huge projects
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.
Seconded. The metaprogramming aspect of Scala is getting better and better.
"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
COBOL because I am a fossil
Can’t have COBOL without COOL!
Yeah, but a rich fossil.
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.
In 20 years we'll be able to run Javascript on microcontrollers, that will be an interesting day.
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:
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.
That's cheating; you only get to pick one.
Unison. If it were to gain mainstream adoption, it would change the world. It’s a crazy futuristic idea and no one else seems to even remotely be approaching the same thing.
I took a look at Unison a short while ago when I saw it mentioned elsewhere on Lemmy and I'll say what I said before: Their Hello World example, and by extension the rest of the language, looks very weird and unwieldy to me. With the repeating identifiers and relatively alien syntax I'm having a hard time seeing this catch on.
Functional languages aren’t for everyone.
I dabbled in Haskell, and my time with it was very enjoyable. I grew comfortable with the syntax over time, so I’d say try the language for a few days/weeks (really depends how fast you learn) and see how it makes you feel.
I definitely suggest trying out Haskell. I followed the Wikibooks guide, and ever since using Haskell, I haven’t been coding the same. Functional programming can be amazing.
I’ve never heard of Unision. A quick look at it and it seems interesting, but very foreign. I’ll try it out and give it my thoughts.
Just scanning through the docs and YouTube, it doesn't seem to do anything that I can't easily do with Go. What am I missing?
I know this is a harmless "what if" but let's be encouraging people to explore more languages not to choose a single one to be everything for all time.
Absolutely! I'm just wondering if everyone has that one language in their hearts :)
I'm already resigned to using C for the rest of my life 🤷🏻♂️
What bucket of that are you in? There are a lot of different reasons people take your position.
Personally, I just do modding for games as far as using my programming knowledge. C is used damn near everywhere, does pretty much anything I can think of and it's easy to work with.
Assembly, so I can shorten my lifetime quite a lot
Rust.
I see that user name
PHP or C++, I love both of them for different reasons. Tough one deciding between the two.
C, because I can find a compiler or interpreter for other language written in C (I may need to run a few steps to get there), and thus work around your silly and nonsense question. Seriously, I use multiple languages because there is no one true language to rule them all. I use C++ for problems where bash would be wrong, and bash where C++ would be wrong. And some python, cmake, lua mixed in for good measure. I'm looking at Rust to add (rust doesn't like the way our system designed so it is hard to figure out how to implement it)
Java. It's familiar, it's the one I use most at my job, and I'm not in love with any other language enough to choose something less pragmatic.
Typescript. I greatly prefer C-Style curly brace languages over Pythonese langs. Also the typesystem is incredible, as it allows you to be as precise or not as you want which is a huge boon.
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.
Truly! One day I decided to take the plunge and learn functional programming with Haskell—I haven’t been the same since.
Probably Ruby. For some reason .. no, that's a lie .. playing with Exherbo, Gentoo and Funtoo, but mostly Exherbo, made me loathe Python. However, everyone in the data processing arena seems to use it, so I'm bound to have to change my ways eventually! For "Ruby": read "Python".
My days of needing high-speed low level languages are long gone. I learned C on Borland C++ back in 1990 to price derivatives on 386s. Loved it.
If I mess around with any language it's for fun. I intend to commit suicide, when my time is done, by the percussive head trauma that learning Haskell will cause me.
See, I love Haskell, and the reason I'd choose Rust for my one language is the feeling that in principle anything I can do in Haskell I can do in Rust, with a little extra percussive head trauma; but I can never have the control in Haskell to do the beautiful efficiency I can do with Rust if I ever actually did any programming.
That's rather beautifully put and extra marks for p-h-t! 😁😜
I learned low level stuff to give prices to traders before the trading interval ended. I'm serious. Our four man hedge fund was under the wing of huge French bank. Pricing in the era was painful.
Asked for a price in the era used to take minutes for derivatives; I was told much faster wasn't possible; that's a red rag to me. I had no choice but to get dirty and go low level again.
The traders were old style barrow-boys, their like disappeared maybe a year or so after. Derivatives have a load of parameters that go with the actual price, "the Greeks", and market traders easily remember sets of shopping lists and prices and quantities at the same time. They were a shoe-in before computers were actually useful on a trading floor.
I learned to program on a 6502 RISC chip in Acorn Assembler. I liked it because BASIC was shit in the era (GOTO Fcuk My Life), like it got much better .. 🤣😂 Knowing how programs work allows me to try to make it faster. These days I think know compilers are smarter than me.
Rust appeals too for the time-travel aspect. I'd like to learn to write a threaded program. I would have loved to do that when back in the day, I always regretted the way it worked, but it was way beyond me 😭 .
I wouldn't mind looking at my old original killer pricing program, I knew it could be optimised then, but I just didn't have the time or the skills to go that extra mile. I regret that bitterly. 😡
If you get time, let me know of your (t)rust travels. Bon voyage.
JavaScript. I can't think of anything else that can be used for everything. It's a back-end language, a front-end language, it can be used for styling and animation, it can be an OOP language or a scripting language, and can make database queries & submissions. Is there another language that is as versatile for website development? I can't think of one.
So while this is probably a good answer to the hypothetical question, that's actually not a good thing, you realize that, right?
Special tools exist because different problems require different solutions. And sure, then can be a huge overlap of those tools, but you can't literally do everything with a single tool; chances are it'd be a shitty tool. Either you can't actually do everything with it, or it's so complex that you don't want to use it in the first place.
Javascript is somewhere in between, in the sense that it's both kinda terrible for most of the jobs you mentioned, while also not actually usable for "everything" - i.e. it'd be a terrible language for anything that needs to be performant or reliable. Hell, we have JS in crap like Gnome now and it's a nightmare.
Yeah Rust can do all of those things as well, JavaScript is obviously much more common.
Ideally I'd choose Rust because I enjoy working with it, but don't have enough time to commit to it at the moment. But being Practical I'd probably say Java, its easy to get stuff going and has been around forever so it's easy to find solutions etc.
Kotlin without a doubt.
Gives you more flexibility and freedom that most scripting languages. The syntax is clean and concise, the tooling is amazing and can compile to JVM, JS, Native and WASM.
I have used Kotlin a bit for a hobby project and it felt like they were 95% done with a 1.0 version. I love the promise of a single code base that can run on the JVM and browser, but it is not all there. Until recently, the API was not guaranteed to be stable. Every one in a while, I hit a feature that is JVM only or does work right in JavaScript. The JS compiler will "helpfully" remove uncalled public functions unless you explicitly mark them with JsExport.
Also, from what I can tell, only InteliJ is the only supported IDE (which makes sense, since they are the language developers). There is an official Eclipse Plugin, but the last time I tried it, it did not work and tried to take the entire IDE down with it.
Having said that, it was very close to complete and I have not worked on that project for a few months, so it could all be perfect now.
Lua.
Don't call the ambulance, it's too late for me
I agree, I really enjoy programming in Lua.
I don't really want to do everything in one language but if I did have to pick it would probably be Julia. It's slightly simpler than Python, and significantly faster without relying on APIs written in C. And has some really great features like broadcasting, multiple dispatch, and a good type system. The only place I feel like Python has it beat is quantity of libraries and support network, which both basically come from the same origin of just having more users. I'm hoping more data science types switch over in the next few years, since Julia is already great for most things mathematical. And I hope that momentum allows Julia to perhaps reach out to other domains.
Java
Clojure, can't stop using it, so fun to use!
If you cannot write safe Rust code, it places your ability to ever write safe code in doubt.
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.
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?).
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.
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)
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.
Go. Nothing strikes a balance of ease and performance like go
Overall, I think I prefer elixir, but is probably choose go as well.
Not just ease and performance but popularity. I could be happy in only go for the rest of my life. Currently a Rust dev and I don't know if I can spend the rest of my life with lifetimes. They are an emotional challenge..
I've wanted to have an excuse to learn Elixir for a couple years now. It seems fascinating to me, but I just can't get started.
Rust, hands down.
Go or Rust
I’d pick JavaScript, mostly because of the ecosystem (even though we could argue about this point 😅)
I’d love to give Rust a try however I don’t have much time nor want to dedicate to coding in my spare time!
DNA
So many great viewpoints here. Crystal for faster and concurrent Ruby. Crystal has a pretty advanced Web Framwork called Lucky not many know about. Haskell so good, but hard to convince people to use it for projects. Haskell also has a very advanced Web Framework called Integrated Haskell Platform. Scala's very impressive feature set. Zig is in such a super position and Julia is capable in so many ways including Fortran integration.
I'm surprised no one has mentioned Chapel or Nim though! My favorite programming speed benchmark is spectral norm and even though Chapel is the fourth fastest language (not benchmark) it's not using the forte of grid parallelism!
Nim is getting to be quite the monster and not beholden to Mega-Corps finance/steering like Python and Go are.
Also I want to add that Zig blows Rust away in many performances!
NOTE: Just as an ethical, solo, non-commercial Engineer, I sponsor Nim on Patreon and Zig on Github
Full Disclosure: It was me that downvoted preferences for Python and Go as the one language. One lang a low level scripting lang? Preposterous! LISP can do/be anything for example. Get out of here with that undercover marketing/influencer speak!
Definitely lolcode.. HAI Can Has stdio KTHXBYE :)
C. I've been programming for over 30 years and it's the only language to survive. Imagine if I was asked this question 30 years ago and picked perl or Pascal, I'd be screwed today.
Big Kotlin fan.
Similar reasons to the commenter that talked about using a world class runtime, but the JVM is tested and works.
And now I can use Kotlin to make cross platform applications, while still utilizing the Java knowledge that I unfortunately possess? Perfect!
I'm surprised no one has picked either macro assembly on their favorite ISA or, perhaps just to screw with people, Forth.
Clojure. Simple language for complex things. It also has java interop and Javascript interop and c# interop. So I will be fine.
Teraterm scripting language.
Relatively useless, but did in the past use it to remotely control a DVD recorder, with relays on the LEDs of a 2400bps modem hooked to the channel up and record buttons.
Also to generate a Web page showing account balances for dialup customers in the 90s.
Now, to switch analog and digital inputs for our community radio station via telnet.
JavaScript
Is everything alright at home mate?
👌
C
Rust, easily.
I don't like writing Rust but I choose Rust. I like Microsoft Java also
GW Basic
V.
Rust, it is a pleasure to work with and far more flexible in where/what it can run then a lot of languages. Good oneverything from embedded systems to running on the web. Only really C and C++ can beat it on that, but those are farlesss pleasant to work with. Even if it is not as mature in some area quite yet, it just gets more support for things as time goes on.
I have been wanting to get into Rust, but as an Electronics Engineer I essentially only have experience coding on embedded devices along with python scripting for test automation and data processing (fuck MATLAB lol)
I am not a good at coding by any stretch. Everything I find on rust focuses on rust user-level or OS-level applications. Most of those concepts I don't follow well enough in any case.
Do you know of where I can follow tutorials, find more information, and dive into HALs for embedded applications?
Rust actually has a shockingly good embedded story for some parts. ST-micro is very well covered. Espressif has first party support. Nordic parts are supported by Ferrous Systems who certify rust for ISO 26262 use. Msp430 is workable, but requires a fair bit of knowledge. The story is less good for anything else that’s not a Cortex part. RiscV is definitely getting there though.
https://doc.rust-lang.org/stable/embedded-book/
Ferrous systems knurling is actually a pretty incredible set of tools. I’d argue that they’re a better experience than most command-line c environments.
https://github.com/knurling-rs
They also have some pretty good walkthroughs for the Nordic and Espressif parts.
I would start by learning rust at a user level via the rust book to get you familiar with the language without the extra layers that embedded systems tend to add on top of things. Keep in mind that the embedded space in rust is still maturing, though it is maturing quite quickly. However one of the biggest limitations ATM is the amount of architectures available - if you need to target one not supported then you cannot use rust ATM (though there is quite a few different projects bringing in support for more architectures).
If you only need to use architectures that rust supports than once you have the basics of rust down take a look at the embedded book, the Discovery book and the Embedonomicon. Then there are various crates for different boards such as ruduino for the arduino uno, or the rp-pico for the raspberry pi pico, or various other crates for specific boards. There are also higher and lower level crates for things - like ones specific to a dev board and ones that are specific to a chipset.
Lastly, there are embedded frameworks like Embassy that are helpful for more complex applications.
If you have an avr you could just use avr-hal.
The documentation is ok and if you used to work with arduino it should be straight forward.