Stop comparing programming languages
- Python is versatile
- JavaScript is powerful
- Ruby is elegant
- C is essential
- C++
- Java is robust
Ruby is just happy to be included
There is another That you might say is a little rusty
This meme only works if you don’t include any example that is better than others in every regard.
I keep seeing people talk about Rust, and to be honest I never thought much about it because I’ve never had a reason to use it.
But when so many people in a programmer meme sub are saying “actually no joke Rust is amazing” that makes me pay attention.
So I looked into it and found this: https://github.blog/2023-08-30-why-rust-is-the-most-admired-language-among-developers/
C++ is focused on getting a strong degree of root control over the hardware of lots of systems. Which is part of why it’s difficult.
Only a part. A lot of the complexity is completely unnecessary.
Sorry, Undefined Behavior Everywhere was yelling way too loud to hear you clearly.
Were you talking about strong controlling anything with C++?
I mean, if you’re talking about CVEs permitting attackers to get control of the hardware of lots of systems, then yes, I agree
C++ EXISTS
- Rust has safety and efficiency close to C
- Perl is processing most of your healthcare records
- Ada is doing space stuff
- Go is going places
There was an adjective for C++. It’s just the pointer was dropped.
C++ is… I got nothing.
C++ is inferior to Rust and should be used in no new projects unless it is absolutely necessary
What is C essential for anymore these days? Genuine question btw.
I thought C++ was essential for microprocessor control, but that it depends and sometimes I gather people use C instead, but not always.
Use the language that the company hires you to know:-).
The thing with C is that it’s almost always going to be the fastest high-ish level language and it has an extremely stable ABI. Self contained code written 30 years ago will likely compile with only minor (and sometimes no) tweaks today. You’re lucky to go 3 years on C++ without something fairly big breaking due to changes in the underlying language and ABI.
Pretty much all of the command line coreutils programs I use daily are in C; cd, ls, pwd, touch, rm, etc. If I want to write some small utility I’ll usually reach for a scripting language first like bash python ruby etc, but if it needs to be small and fast I’ll use C instead.
Genuine question: if you’re writing a new CLI utility, why not Rust? This is arguably where Rust has most excelled, most famously with ripgrep.
I don’t have anything against Rust, I’m just not very familiar with it
This is a really good post about why C is so difficult to seriously consider replacing, or even to avoid by using a different language for certain projects: https://faultlore.com/blah/c-isnt-a-language/
It isn’t just a language, but it is a language - as it eventually gets around to saying, but it starts off by saying that it isn’t, then later corrects itself to say that it is, etc. I feel like the focus of this ignores the historical context of what C was written to be for - at the time there was like Assembly, BASIC, Fortran (?), other long-dead languages like was it A and/or A* or whatever, there was a B language too! (developed by Bell Labs, if Google can be trusted these days), etc. - and C was developed to be better than those. So saying that like it lacks type conversions is very much missing the point - those were not invented yet. A lawn mower also lacks those, but it’s okay bc it doesn’t need them:-) I am probably nit-picking far too many points, I suppose to illustrate that the style of the article became a hindrance to me to read it b/c of those reasons. But thank you for sharing regardless.
I don’t really like the title either, but the article does demonstrate how unfortunate it is that we’re effectively locked in to using the ABI at some level of nearly every piece of software.
That said, there definitely were languages with better type systems prior to the invention of C. Pascal is a frequently-cited example.
Most of the Linux kernel is written in C
any sort of FFI on a modern OS will need to be done through C
Used to be embedded systems mostly. Microwaves and the like. Although with the advance of the smart home I don’t know I’d that’s still true.
The majority of microwaves, fridges, etc. Still don’t connect to WiFi. It’s mostly the high end ones which do.
I do embedded. Its all C. You can’t replace it.
Inertia is a mofo. I did embedded programming for industrial automation almost thirty years ago, building upon and expanding an existing nightmare of C code… and I bet there’s still some of mine running something out there to this day.
You can’t replace it.
Zig?
Or Nim?
Wait, that’s like C with
extrafewer stepsAnd I think they rewrote a bunch of C libraries in order to have a better cross-platform compiler for C and zig. Or something along those lines
The only reason I use C++ is because that’s what all the main audio plugin tools use. It’s warty and annoying, although I’m confused why Java would rank higher
So we just ignore JavaScript being on that list at sll?
I shit on JavaScript for years… but Deno (built around Rust) is honestly one of the most pleasant tools I’ve used for development, and you get all the completion in VS Code.
My main experience using C++ was because I got stuck modifying an app written with Qt Creator, an utterly insane cross-platform framework that used (still uses? I dunno, only people in Finland ever used it in the first place) C++ for the under-the-hood processing and Javascript for the UI. For good measure, the application developers had modified all the C++ stuff with macros to the point where it was barely even recognizable as C++. Fortunately, it mattered not at all because the app’s customers were ISPs who just wanted a Skype clone so they could say they had one even though none of their customers ever used the damn thing.
Oh, trust me, Qt is still primarily C++. It’s effectively a massive set of C++ libraries.
Stop comparing tools
- Hammer is heavy
- Wrench is elegant
- Saw is versatile
- Screwdriver
- Drill is exciting
such pointless
C++ is a surprise CVE generator.
Just accept it, all languages suck
not zig
Writing raw byte binaries ftw!
(Jokes aside, all programming languages have their good and bad things. Some just have more bad than good. And i say that as a C/C#/typescript/asm developer :p
“There are only two kinds of languages: the ones people complain about and the ones nobody uses.”
That’s why Haskell is so loved. Nobody uses it.
Fortran would like a word.
I love how after a decade pandoc is still Haskell’s “killer app”. smh
I mean to be fair, that’s a pretty useful tool.
Yes, just flip binary directly to the cpu
Not Scala and Rust. They are my beloved, my sweethearts, my knights in shining armor.
Ok Rust does have some major issues, but not Scala…
Oof, slow compile times to target, of all things, the JVM? Implicit methods?
Some(null)
? Function call syntax where the difference between a tuple argument and a sequence of non-tuple arguments can be determined by whether or not there’s a space before the parentheses?There are definitely some major issues with Scala.
They also thought the best thing to take from Python is that version 3 should not be backwards compatible with version 2
I think that’s good when the objective is to improve the language. One key thing that holds many languages back is that they’re stuck with historical baggage, and it can be pretty difficult to replace/remove “outdated” stuff without breaking everything.
I do not want to be stuck using Python 2, or Scala 2 (although there exist people who use Scala 2 instead of Scala 3).
I agree that the slow compile times are pretty bad (maybe even deal-breakingly for large projects). I think it’s kind of necessary for a language with as powerful of a syntax as Scala though, it’s pretty absurd how expressive you can get. Maybe if it didn’t target the JVM, it’d be able to achieve way faster compile times – I don’t really see a point of even targeting JVM other than for library access (not to say that that isn’t a huge benefit), especially when it has relatively poor compatibility with other JVM languages and it’s nearly impossible to use for Android (don’t try this at home).
Even more so, I think that null handling isn’t nice – I wish it were more similar to Kotlin’s. One thing I’m really confused as to why Scala didn’t go all-in on is Either/Result like in Rust. Types like that exist, but Scala seems to mostly just encourages you to use exceptions for error propogation/handling rather than returning a Monad.
A more minor grudge I have is just the high-level primitive types in general – it’s pretty annoying not being able to specify unsigned integers or certain byte-width types by default, but if it really is an issue than it can be worked around. Also things like mutable pointers/references – I don’t actually know if you can do those in Scala… I’ve had many situations where it’d be useful to have such a thing. But that’s mostly because I was probably using Scala for things it’s not as cut out to do.
With the tuple arguments point, I get it but I haven’t found it much of an issue. I do wish it wasn’t that way and it consistently distinguished between a tuple and an argument list though, either that or make functions take arguments without tuples like in other functional languages or CLI languages (but that’d probably screw a lot of stuff up and make compile times even LONGER). I saw someone on r/ProgrammingLanguages a while back express how their language used commas/delimiters without any brackets to express an argument list.
I think an actually “perfect” language to me would basically just be Rust but with a bunch of the features that Scala adds – of course the significant functional aspect that Scala has (and the clearly superior lambda syntax), but also the significantly more powerful traits and OOP/OOP-like polymorphism. Scala is the only language that I can say I don’t feel anxious liberally using inheritance in, in fact I use inheritance in it constantly and I enjoy it. Scala’s “enum”/variant inheritance pattern is like Rust enums, but on crack. Obviously, Rust would never get inheritance, but I’ve found myself in multiple situations where I’m thinking “damn, it’s annoying that I have to treat <X trait> and <Y trait> as almost completely serparate”. It would especially be nice in certain situations with const generic traits that are basically variants of each other.
Plus, I’ve always personally liked function overloading and default arguments and variadics/variadic generics and stuff, but the Rust community generally seems to be against the former 2. I just really hate there being a hundred functions, all a sea of underscores and adjectives, that are basically the same thing but take different numbers of arguments or slightly different arguments.
The custom operators are a double-edged sword, I love them and always use them, but at the same time it can be unclear as to what they do without digging into documentation. I guess Haskell has a similar problem though, but I don’t think Scala allows you to specify operator precedence like Haskell does and it just relies on the first character’s precedence. I would still want them though.
How it goes now, though, is I use Scala 3 for project design/prototyping, scripting, and less performance-sensitive projects, and Rust for pretty much everything else (and anything involving graphics or web). Scala has good linear algebra tooling, but honestly I’ll usually use C++ or Python for that most of the time because they have better tooling (and possibly better performance). I would say R too, but matplotlib has completely replaced it for literally everything regarding math for me.
JavaScript is powerful
Old joke (yes, you can tell):
“JavaScript: You shoot yourself in the foot. If using Netscape, your arm falls off. If using Internet Explorer, your head explodes.”
Mfw Rustaceans don’t exist :(
Also, JavaScript…why are you the way you are? Does anyone have advice for learning it so it makes sense? I can’t even get tutorial projects to run properly…
I like Douglas Crockford’s talks about the “good parts” of JavaScript. They’re old and probably a bit outdated, but he explain quite well the history and why JavaScript is the way like it is.
It clicked for me when I saw them the first time. Still hate JavaScript though.
What Crockford did was enable a lot of devs to realize there was a viable development platform built into the most prolific and open network client in the world. For that he should be commended but it should have never been taken as “this is a viable general purpose language”.
He also showed that JavaScript has more resemblance to functional programming languages rather than object oriented ones. If you try to treat it as an object oriented language like Java (like the seem to imply), you will have a bad time.
This has changed with TypeScript though.
The mantra that got me through JavaScript was “almost nothing we do here is able to be synchronous”.
Everything about the language makes more sense, with that context.
This meme is older than rust.
actually it says 8h meaning it’s only 8 hours old
It will be 8 hours old forever.
Forever young…
Can it even make sense tho? To me JS is an example of a not too good thing that people started too eagerly so now they’re trying to make it make sense.
use typescript and don’t look too hard at the infrastructure
I tried, but the infrastructure collapsed on me.
Lol any
Last company I worked at used Typescript, but used
any
for everything… I have no idea why. I never got an actual answer.Because they didn’t want to train their JS developers and didn’t want to cause friction for new projects. They get to say they’re using TS, with basically none of the real advantages. (Apart from general rational error checking.)
Start simple.
And that probably requires not going with a tutorial. Because the JS ecosystem scorns at “simple”. Just make some HTML scaffold and use MDN to understand the DOM.
Java is robust haha