After years, and many languages, I still have to say Ada. Kotlin, Rust, Julia, and Nim are my current contenders to overtake, but here's what Ada does well enough to still be my preferred tool when appropriate:
There are some situation where Ada shows its age:
func
/proc
(Nim) vs fun
(Kotlin) vs fn
(Rust) doesn't make much difference to me, but function X returns Y
/procedure X
starts to add a lot of visual noise to a file.Here's when I use the alternatives, and their biggest weaknesses:
Thank you for attending my TED talk :P. Any questions?
That's a great opinion piece you've written there. You could with a little editing and restructuring turn it into an article.
I've never used Ada (I've heard great things, though), and I've only used Rust and Kotlin a little bit, but I can at least vouch that Julia and Nim are both supremely lovely languages.
I learned Ada in the early 90s before being plunged into a world of C/C++. I haven't heard much about it since, but I'm glad to hear it's alive and kicking. I'll have to have another look, see if I recognize any of it!
I'm a big fan of Rust.
cargo
) just works, the compiler's error messaging is simply unmatched and the IDE story is excellent thanks to rust-analyzer
.Result
and you have to explicitly handle the possibility that something went wrong. There's no forgetting a null check and slamming face-first into a NullReferenceException
or segfault in some other part of your code.Obviously it's not all perfect, however.
rustc
is always getting faster, of course, but it'll probably never be as fast as Go or JVM/NET.)And much time is saved from debugging. It makes a lot of sense that we let the computer/compiler keep an eye on lifetimes, allocations and access so the code is much more correct once it compiles.
I feel like my old colleagues and I have spent a far too large part of the last 20 years chasing memory issues in C++. We are all fallible, let the compiler do more.
I like the way the compiler doesn't just tell you there's a problem, but also gives you advice on ways you may be able to fix it. That's a smart compiler.
And I like the way I can write something that runs fast but not feel faintly anxious all the time I'm doing it.
I'm an embedded systems C programmer with passing familiarity with Python. To me it seems ridiculous that a language relies on whitespace for blocking. Is that true?
It only requires consistent indentation inside blocks, which is what any good code does anyway for readability. So the main difference then is just that you no longer need the redundant curly braces.
Yes, unfortunately. There is a lot of tooling around it but it still feels bizarre after years of using it.
I'm anal about curly braces in C. I never code without them because I don't like being ambiguous.
I never do
if(i=0) return 0;
or worse
if(i=0) return 0;
I do
if(i=0) { return(0); }
I had to use Python for a bit at work and it was confusing
pipenv, venv, virtualenv, poetry...wtf is all this shit
a.b
vs a['b']
vs a.get('b')
...wtf is a KeyError
What happens in other languages you use when you try to access a non-existing key for a hash/map/dict?
What language do you use that accessing an object attribute is the same that accessing a dict key?
What knowledge do you have (or not) that KeyError is a mistery to you?
What language do you use that accessing an object attribute is the same that accessing a dict key?
Javascript / Typescript.
Well, yeah, I thought about later. Lua does the same.
The other questions are still valid, though.
Return undefined.
Typescript.
Why error? Just return undefined. Simple, no try/catch needed.
Because that's prone to errors. And the Zen of Python includes "explicit is better than implicit" and "Errors should never pass silently". Languages that do otherwise create bad habits.
By versatility, I'm also including the ecosystem. Julia doesn't seem to be anywhere near python on that.
However, I've heard good things, it's on my to-do list.
Go. It's high level enough in terms of syntax that it's easy to build complex apps in, and low level enough that I'm able to control pointers, manually run the garbage collector, and benefit from the runtime performance.
It's the best of python and JS.
Hell yea. Can't forget those compile times and that parallelism handling. I can't think of a language that has a better dev cycle to performance ratio.
I think the stuff with the foundation is kinda overblown by the Internet drama machine. That's not to say they haven't made mistakes, but hopefully the leadership council will fix things up.
Plus, Rust has come into widespread use, so it'll be very hard to kill.
Ah, I do not think it's really overblown... It's really a mistake that needs to be fixed up and people screaming to let them know. That is what we should do and it is great!
Agree by the way, its really hard to kill but i think can be killed if same mistakes happens over and over. Rust is an awesome language, I do not want foundation to overrun it. We should be talking about awesome crates, not an idiot decision made by foundation...
C#. Strong core, a lot of convenience extensions, extensive ecosystem, great docs, great IDE (VS) with suggestions, refacs, lingers, etc.
Typescript with all strict checks turned on. You get all the good parts of JS with types, and (almost) none of the bad ones.
It's quite an expressive language with tons of quality of life features that I constantly miss from other languages.
Honestly for web/backend dev in 2023: Typescript for 90% of things, Go or Rust for anything else that needs to eek out that extra bit of performance.
I occasionally write the odd bash script, but really that's just a novelty way to mix things up half the time
Python
It's real easy to just launch it and get a script going, no need to wait for and ide or a compiler, there's alot of nice modules, and it's really API friendly
I've spent more time in the blender python API than I'd like to admit
PHP.
It picked a niche and fits exactly into it. It's a language for server side web pages. It's not a general purpose language shoehorned into the task, so it wisely sets boundaries. PHP could avoid a lot of async/await/promise hell because you can work in the mindset of HTTP requests-- terms of short lived requests that are compiled elsewhere. You don't have fragile runtime environments (see: server-side JS), since it just plugs into Apache or Nginx, which are at least battle tested and known quantities to operate.
It's batteries included. Hell, it's the entire Duracell company included. The standard library is rich and centrally documented, including decades of community nitpicks, even before you go into composer repos.
It's non judgmental. You can write procedural code, or object-oriented code, based on preference and fit to task.
It makes ad-hoc easy and formal possible-- If I need an array of [227, "Steve" => "meow", 953 => new FreightLocomotive()] I can get it, or I can enforce types where it's relevant and mitigates risk.
PHP really is such a forgiving language and easy to understand and get in to. My favorite part is that every time I have a seemingly very niche and specific use-case, there is a function that just does that thing perfectly and is already included in the base library.
You said it and I'll reaffirm: the documentation and online library of SO questions/answers is absolutely priceless. Most of the older versions are still compatible with the latest version, so upgrading is simple and usually just means there are more features you can use now.
Haskel, It's kind of hard to do some stuff which are easy in other languages but if you find a good problem to solve with it, it's amazing how expressive you can be and how short your code gets compared to all the boilerplate code you have to write with other languages.
Kotlin. I like how versatile its features can be and how much more it adds compared to Java. I also think it’s cool how Kotlin can be used to write native apps and web apps too.
I would like to learn Rust. I heard nothing but good things about it. I however don’t have the need or enough motivation to do so.
Python. It's the only one I know :(
I've been trying to learn C# too but object-oriented programming just slides right off my smooth brain lol.
object-oriented programming just slides right off my smooth brain lol
Don't worry, although it's good to learn, IMO it's still on the wrong side of overused and overrated and could stand to be applied more selectively than it tends to be.
Nothings stopping you from writing object oriented code in python too, or function oriented code in C#.
Been learning python for selenium and I love it. I know some C# and Javascript but I enjoy Python a lot more as a newb.
You ask a carpenter what his favorite tool is? I like languages that are fit for purpose, and I enjoy using them for that purpose.
I used bin/bash when I automated the backups at work and happy doing it. I was pulling my teeth out when I had to write code for communicating with Bluetooth devices in /bin/sh because that was what was available from factory on the router.
I picked Python for when I needed to scrape a Romanian phone book (to win an argument on the internet about something completely unrelated to programming). I once tried doing parallel programming and threads, it did not work out very well and I switched to some other language before I got too deep into it.
My guilty pleasure is the voodoo magic of C. I don't really have a use for it in my job so I never get around to really do anything with it.
Python. I'm a data engineer by trade and the ability to just lay out functionality between different systems and move content fast is great. I know you can do that with many languages but python does scripting very well. And since by default I am working with remote/parallelized/containerized systems I never really lament pythons lack of speed.
Obviously python is not the only language in my workweek.
Probably the most unpopular opinion here but PowerShell.
My main reason is that it's extremely easy to learn and is a good intro to object orientated programming.
People bash it but it's extremely easy to inspect objects, get any properties and methods associated with that object or class, walk through all the properties of the object and transform that into whatever you need.
It has a very fast turnaround time when developing code as you can run tiny snippets at a time and understand their outputs before moving to the next bit.
I'm not a Dev and end up having to write python from time to time and I hate it. At one point I just needed to understand an object in a variable and I couldn't do it, the command dir
exists but it didn't give me any of the info I needed. There's a function in PowerShell called Get-Member
(alias: gm
) that you can pipe anything to and it will show you all those details of the object.
It helped me tremendously when I was just starting out.
Its super powerful, it can do anything C# can do because it's built on it, you can also run inline C, C# and C++ code with on the fly compilation.
It's also OSS and cross platform.
Oh Jesus no.
But I knew there must be someone who likes it.
In python you may have wanted the repr command to see how an object looks like.
I write code in C# but I love PowerShell. it's just elegant even if the syntax can be a bit clunky
The syntax is often terrible (how it handles escape characters, for instance) but there's usually a well-meaning backwards compatibility reason for that. It's also flawed in many many other ways (classes, package management, variable scoping just to name a few).
But god damn if I can't bash (no pun intended, har har) out code to do most things very quickly in it. It's a fantastically accessible language, and it's a lot more powerful than it gets credit for.
I'm a developer with 30 years experience in lots of languages and honestly PowerShell one of my favorite. Of course anything is an improvement over batch file scripting but it's so much better than bash. An object-oriented command line is amazing - such a huge improvment over having to use text-processing tools to parse output. Built-in support for virtually every text file format, easy access to web and rest services, and now that it's cross-platform and open-source I'm using it consistently on Linux and Macs. I've been using it for almost 15 years and it's sad how few people outside of the Windows eco-system are familiar with it, and even more resistant just because it's from MS.
Yep, the disparaging comments you get on anything where you mention PowerShell are a sign of some deep rooted prejudices and the unwillingness to learn something new because of them. They'll rather scoff and pretend that they're morally superior because hurry durr Microsoft.
I'm glad that there are people who appreciate it for everything it can and does do. I cringe every time I have to use bash because of just how bad and cumbersome it is to use.
I've never been happier and more productive than when I was working in Perl. It's a language that, at its apex, had a community of incredibly smart and creative people evolving it and its ecosystem. It's a practical, powerful, multi-paradigm language that let me get work done with a minimum of fuss.
Perl was a language that felt like an extension of my thoughts, like it was working with me and for me. Most other languages feel like I am working for the compiler rather than the other way around. Or at the very least, spending unnecessary effort satisfying some language designer's personal pet peeve, which constantly takes me out of the flow of the job I'm trying to do.
I still use Perl for everything I do. Using anything else just feels too much of a struggle trying to get it to do what I'm telling it to do.
But maybe that's the 25+ years of using it talking.
I started a job a while back where Perl was heavily used and I hadn't had much exposure to it. I spent some time just doing the same thing in Perl and Python and I really enjoyed working with Perl for the reasons you listed. I was just somehow very easy to use and be productive.
I haven't touched it since I left and Perl is completely unused and almost alien where I am now.
Lisp.
It just feels extremely natural to me, so it's difficult to pinpoint specific features I like. But two such features stand out: the parantheses-based syntax and the extreme interactivity.