Stop comparing programming languages
- Python is versatile
- JavaScript is powerful
- Ruby is elegant
- C is essential
- C++
- Java is robust
Just accept it, all languages suck
not zig
Yes, just flip binary directly to the cpu
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
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.
“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.
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.
Fortran would like a word.
Ruby is just happy to be included
There was an adjective for C++. It’s just the pointer was dropped.
C++ is a surprise CVE generator.
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:-).
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
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.
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.
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.
any sort of FFI on a modern OS will need to be done through C
Most of the Linux kernel is written in C
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?
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
Or Nim?
C++ is all of those, provided you pick any 10% of it.
You’re not supposed to cast every spell in the evil grimoire.
Well, except “robust”, unless you have very strict code standards, review processes, and static analysis.
(And arguably it’s never elegant, though that’s almost purely a matter of taste.)
When the standard for “robust” is Java–
I see where you’re coming from, but no matter how many null pointer exceptions there are in Java code, you’re almost always protected from actually wrecking your system in an unrecoverable way; usually the program will just crash, and even provide a relatively helpful error message. The JVM is effectively a safety net, albeit an imperfect one. Whereas in C++, the closest thing you have to a safety net, i.e. something to guarantee that invalid memory usage crashes your program rather than corrupting its own or another process’s memory, is segfaults, which are merely a nicety provided by common hardware, not required by the language or provided by the compiler. Even the, with modern compiler implementations, undefined behavior can cause an effectively unlimited amount of “bad stuff” even on hardware that supports segfaults.
Additionally, most languages with managed runtimes that existed when Java was introduced didn’t actually have a static type system. In particular, Perl was very popular, and its type system is…uh…well, let’s just say it gives JavaScript some serious competition.
That said, despite this grain of truth in the statement, I think the perception that Java is comparatively robust is primarily due to Java’s intense marketing (particularly in its early years), which strongly pushed the idea that Java is an “enterprise” language, whatever that means.
- PHP is old
- HTML is NOT A PROGRAMMING LANGUAGE!!!
- CSS is
︎ ︎ ︎ not alig-
︎ ︎ ︎ ned
Actual definitions (my opinion):
- HTML is website
- CSS is style
- JS is everywhere
- SQL is data
- Python is simple
- PHP is backend
- Markdown is README
- YAML is config
PHP is old
Same age as Ruby, Java and JavaScript, but younger than Python, C, and C++. 😛
I’m guessing they meant “old” as in “no one uses it anymore, it’s dead”
Don’t tell my bosses that. Or the PHP community as a whole for that matter. Then I might have to get a real job.
I’m sorry. If you exclude the millions of sites using it, it is virtually unused.
The year they both came out (1995) I was coding in Visual Basic 3. Ack.
Meanwhile PHP quietly runs 80% of the internet by being used for WordPress.
Modern php is not bad actually. Still kinda slow and dangerous, but A LOT better than it used to be :')
That said, i wouldnt build a web service with php still lol
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…
use typescript and don’t look too hard at the infrastructure
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.)
I tried, but the infrastructure collapsed on me.
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.
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…
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.
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.
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.
- C++ is fine
- Python is fine
- C# is fine
- PHP is fine
- JavaScript is fine
- C is fine
- Java is fine
I could go on
Go on…
Don’t give them ideas
PHP is fine
i will fine you
JavaScript is also not fine.
C++ apparently has a lot of footguns if you use too many parts of it. C and orthodox C++ are fine.
people say this but C is significantly more batshit than javascript
oh you used
scanf
? one of the basic functions of our language? sorry that’s got a buffer overflow vulnerability so now your application is compromisedYeah, but as far as I understand that’s not a C vulnerability. It wasn’t added. C just exposes how the underlying CPU works.
If you could avoid exposing dangerous memory quirks but still retain the same power… well, you’d have invented Rust. Rust is a better language than C, I agree with that.
exposing the machinations of the underlying CPU with no regard for safety is like, the definition of a footgun
Okay, but how do you code on a CPU without directly interfacing the CPU at some point? Python and JavaScript both rely on things written in mid-level languages. There’s a difference between a bad tool and one that just has limitations inherent to the technology.
Like, to echo the meme a bit, it’s not a totally straight comparison. They have different roles.
a footgun isn’t inherently bad, it just implies a significant amount of risk
yes, if you need the ability to code on a low level, maybe C is necessary, but the times where that is actually necessary is smol
also rust
What’s the point of having a function in the standard library if the universal recommendation is to never use it?
Is that the recommendation? This is the first time I’ve actually seen it discussed.
I’m wondering at this point if a new, different stdlib would be better. Or just use Rust.
A true programmer
Are those adjectives randomly chosen?
Yeah, JavaScript powerful? How?
good luck doing frontend development without it, but it can also do backend development
it can do everything
but it can also do backend development
The same way a rusty spoon can dig a hole, sure.
The thing it can do best is bewilder developers with it’s strange choices
i wouldn’t want to program in pure assembly either but asm is definitely powerful
I would argue that ASM isn’t “powerful”. It’s direct. You can access advanced features of a CPUs architecture with the trade off limited portability. Sometimes it’s necessary but power comes from being able to express complex control and data structures in a concise and readable amount of text.
The subjective topic of what “concise and readable” means is where the language wars come in.
That makes it versatile, not powerful.
When I hear powerful language, I think of languages that are good at intensive tasks like assembly, c, rust, Python (because of numpy, pandas, pyspark, cuda, etc.).
Python is powerful because it easily wraps C libraries that do real work! Just kidding mostly.
But yeah, js isn’t a language I would describe as powerful. Ubiquitous? More capable than you would expect given it’s history? Bloated?
Python is powerful because it easily wraps C libraries that do real work! Just kidding mostly.
Not kidding. There’s no rule against it though. It’s good at it’s niche.
Does that not put JS (node) back on the table?
I’d say it’s the low level language doing the heavy lifting, python or JS in this scenario are just front-ends.
Hell, I think FORTH has C bindings, that’s not power, that’s mental illness
Sure, but there are good and bad frontends. JavaScript has a tendency to silently fly off the handle in mysterious ways due to the crazy type system. Python will typically fail more predictably, and is famously easy to write. I know nothing about FORTH, honestly.
I exercised JavaScript out of some of my apps, and I’m happier for it.
Did they get a good workout?
if its acceptable to force javascript onto the backend and everywhere else, then why not write the frontend in rust, or anything else than can compile to wasm ?
WASM has no native ability to access most web APIs, including the DOM. JavaScript is literally unavoidable on the front end.
javascript cannot be compiled natively for the backend or desktop either…
also libraries like wasm bindgen allow a developer to write almost no javascript. and i wouldnt could a few lines of bootstrapping.
im dont advocate for wasm when its not necessary. nor do i advocate for backend js when its not necessary.
Sorry, I’m not sure what your point is. I realize that you can almost completely avoid JavaScript, but the point I’m making is merely that there is a real technical limitation that limits the choices developers can make for front-end code, and although WASM is making great strides in breaking down that barrier (something I’ve been thrilled to see happen, but which is going much more slowly than I had hoped), the limitation is still there. Conversely, such a barrier has never existed on the backend, except in the sense that C limits what all other languages can do.
my point is that languages have their places.
javascript is great for the frontend. not just because it’s the only choice, but it’s also a lot easier to write code for ui than say, C or rust.
however i do not see a reason why it needs to run on servers or desktop apps, bar a few cases. i know node is popular, but i think fullstack devs just like to have everything in the same language, even if it makes it harder to use and slower to run.
likewise C, rust, go, whatever, are great for backends, embedded etc, but they shouldnt be ran on in the browser, unless there is a specific reason like heavy computation with little dom interaction.
just because a barrier does not exist doesnt mean that we should write programs in a language not designed for the domain.
IIRC JavaScript + TypeScript is the biggest demographic of engineers in the industry if you go by GitHub stats
I suppose you could call that power in a way
JavaScript is AN UNAVOIDABLE HARDSHIP
By running everthing in a single thread obviously. Won’t get more powerful than that
C++ catchin strays
C pew pew
Stop comparing tools
- Hammer is heavy
- Wrench is elegant
- Saw is versatile
- Screwdriver
- Drill is exciting
such pointless
Java is robust haha
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.”
what about Holy C? is it only usable to people that are actually god choosen programmers?
It’s racist
Calling Terry racist is ableist. He was very much equal opportunity, applying the hard r to pale white CIA agents (imagined or otherwise).
You are right he was egalitarian in that.
I also have it on good authority that he had a black friend which gave him the N word pass.
nah, he bought the N word pass from SHV