this post was submitted on 21 Jul 2025
266 points (97.5% liked)

Programmer Humor

25159 readers
1282 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
all 38 comments
sorted by: hot top controversial new old
[–] ICastFist@programming.dev 4 points 19 hours ago

Zig or V could've been shown instead of Carbon (the lone C)

[–] frezik@lemmy.blahaj.zone 8 points 23 hours ago (2 children)

K&R started with BCPL as their base of inspiration. They then made B, and then C. The followup should be called P.

[–] ICastFist@programming.dev 1 points 19 hours ago (1 children)

Some people really suck at coming up with names for their programming languages. There are so many single letter languages (B, C, D, E, F, J, K, V...) that it really makes one wonder what the fuck is wrong with them

[–] frezik@lemmy.blahaj.zone 5 points 19 hours ago (2 children)

These days, search engine optimization tends to force new single letter languages into obscurity. Even Go would have issues there if Google hadn't been behind it.

[–] ZILtoid1991@lemmy.world 1 points 3 hours ago

That's why you put the "-lang" postfix if you have issues with searching for documentation of functions, etc.

[–] ICastFist@programming.dev 1 points 19 hours ago

Even in the early 2000s, those single letters would be awful as lone search terms

[–] mamg22@sh.itjust.works 60 points 1 day ago (2 children)

Has Carbon been used anywhere noticeable? Last time I heard of it was when Google announced it few years ago, haven't seen anything getting written or ported to it, though I haven't read much into it so I might have missed many news.

[–] ViatorOmnium@piefed.social 28 points 1 day ago (1 children)

It looks like a nice mix of some of the worst design choices of C++ with some of the most dubious choices of Rust.

[–] ICastFist@programming.dev 4 points 19 hours ago

Oh, so it's a contender against Brainfuck

[–] NotSteve_@piefed.ca 23 points 1 day ago

I actually completely forgot it was a thing. I haven't heard anything about it either since it was announced

[–] m_f@discuss.online 53 points 1 day ago (4 children)

Relevant comment

I don't use Rust much, but I agree with the thrust of the article. However, I do think that the borrowchecker is the only reason Rust actually caught on. In my opinion, it's really hard for a new language to succeed unless you can point to something and say "You literally can't do this in your language"

Without something like that, I think it just would have been impossible for Rust to gain enough momentum, and also attract the sort of people that made its culture what it is.

Otherwise, IMO Rust would have ended up just like D, a language that few people have ever used, but most people who have heard of it will say "apparently it's a better safer C++, but I'm not going to switch because I can technically do all that stuff in C++"

[–] ZILtoid1991@lemmy.world 29 points 1 day ago (1 children)

D has a lot of other reasons why it haven't caught on.

  • The language is way too similar to both C and C++. In fact, you can get C and C++ code working in D with minimal changes (most annoying part is int meaning different things in both languages), and nowadays I can pull the conversion off on the regular. It's like the only changes that were made to the language are making things more consistent, making things work better. etc. Rust is more like a language that is a marriage between C-style languages and OCaml. Rust is also a "functional first" language with the ability of opting out from the functional part, first when I've heard about Rust it was through this "fancy and new programming paradigm, that promises to fix everything wrong with programming", and the D team wanted to be left out from making const the default mutability.
  • The GC sounds scary for most people, who want to develop desktop applications. It's rapid fast, will be even faster soon, and there's tricks to either opt-out from it, or to get a @nogc thread going (using that for audio).
  • Marketing issues. Walter Bright, while a genius compiler developer, is not a good marketing person.
  • Formerly D was quite infamous for its toxic users, with Walter going infamous for his "let nazis code" line for a while. Allegedly, most of the toxicity moved over to openD, which made some people question why Adam D. Ruppe forked the language.
  • The whole shenanigans around moving from D1 to D2, also Tango.
[–] 6nk06@sh.itjust.works 7 points 1 day ago

moving from D1 to D2

I was learning a few different languages at the time, and it's a bit fuzzy in my head, but I remember the confusion between the 2 compilers. One was incomplete and/or obsolete, and the other one was in beta or something and you shouldn't use it anyway. I chose nothing and tried something else because it was annoying to watch. Walter, as the BDFL, should have decided on something but it never arrived, and the hype went away.

All I remember is that some Japanese guy wrote a bullet-hell library and game in D, and that was great. But the community was too confusing for me.

[–] calcopiritus@lemmy.world 25 points 1 day ago (3 children)

I kinda disagree. The reason rust caught on is because it is much safer than C++ while having the same or even better performance. And in some contexts, being garbage collected means bad performance.

Before rust you could either have a fast language (C/C++) or a memory safe language (any other language. That is, languages with garbage collector). But if you required memory safety and peak performance, there wasn't any option.

Yes, the reason that rust is both memory safe and fast is because it has a borrow checker. But the borrow checker is the means, not the end.

[–] AnyOldName3@lemmy.world 8 points 1 day ago (2 children)

Garbage collection doesn't guarantee memory safety and it's perfectly possible to create a memory-safe language without garbage collection. There are plenty of garbage collectors for C++ (and until C++23, support for garbage collection was part of the standard, although no one implemented it), and languages like C# let you interact with garbage-collected objects in unsafe blocks.

[–] Decq@lemmy.world 13 points 1 day ago (2 children)

Exactly, if garbage collection meant memory safety then why do we get null pointer exceptions about every 5 minutes in Java. Garbage collection is about memory leaks, not safety. Imho the borrow checker is a better solution than garbage collection and faster to boot.

[–] calcopiritus@lemmy.world 10 points 1 day ago

Null safety and memory safety are different features.

Null safety means that you cannot access a struct's fields without first checking if the pointer to that struct isn't null. And this must be a compile-time check.

Memory safety means that you cannot read or write to/from memory that has been free-ed. Without leaks ofc, otherwise it would be very easy.

[–] zea_64@lemmy.blahaj.zone 4 points 1 day ago

A null pointer exception is technically memory safe, you can get equivalent behavior with .unwrap() on an Option in Rust.

[–] calcopiritus@lemmy.world 1 points 1 day ago (1 children)

How can you not have memory-safety while also having a garbage collector?

Garbage collection means that all objects live as long as you have a reference to it. Which means that you can only dereference a pointer to invalid memory if you willingly create an invalid pointer, or reinterpret the type of one pointer into another. Going out of bounds of an array counts as the first case.

If a language has garbage collection but no compiler/interpreter supports it, then the language doesn't have garbage collection.

[–] AnyOldName3@lemmy.world 1 points 1 day ago (1 children)

For a start, having a garbage collector doesn't mean its use is mandatory, but even in a language where the garbage collector is mandatory, keeping an array alive as long as any references to it exist doesn't stop you doing things like getting muddled about its length and reading/writing past the end. Mandatory garbage collection only prevents temporal memory bugs like use-after-free, not spatial memory safety bugs like buffer overruns, which need to be prevented by other mechanisms like bounds checks.

[–] calcopiritus@lemmy.world 1 points 1 day ago (2 children)

As I said, I don't consider going out of bounds of a buffer a memory safety issue. Forcing the programmer to handle an out-of-bounds case every time there is an array access can be incredibly tedious. So much that not even rust forces you to do so. And if that language has iterators, it's even less of an issue.

I consider out-of-bounds array access to same as casting a pointer to another type. Just because a language lets you do it, it doesn't mean that it is not memory safe. It is a performance feature, since checking the bounds every time is always possible (and incredibly easy to implement), but also with too big of an impact when you could just check the length once per loop instead of per loop iteration.

[–] sus@programming.dev 3 points 1 day ago* (last edited 1 day ago)

buffer overflows are critical for memory safety since they can cause silent data corruption (bad) and remote code execution (very bad). Compared to those a "clean" unhandled runtime error is far preferable in most cases.

[–] AnyOldName3@lemmy.world 0 points 22 hours ago (1 children)

If you're going to change the definition of words, it's pretty easy to show that garbage collection on its own is sufficient, but it's not possible to have a useful conversation if someone's using their own personal definition of the terms being discussed. The generally accepted definition of memory safety includes deeming out-of-bounds accesses and other spatial memory safety issues unsafe.

[–] calcopiritus@lemmy.world 1 points 21 hours ago (1 children)

With your definition this conversation doesn't make sense though. Since rust's direct array access doesn't perform bounds checks when building in release mode. And it doesn't require using unsafe.

[–] AnyOldName3@lemmy.world 1 points 20 hours ago

That's not what Rust's documentation says. It does a compile-time bounds check if it can prove what the index might be during compilation, and a runtime bounds check if it can't. In release mode, it tries harder to prove the maximum index is below the minimum length, but it still falls back to a runtime bounds check if it can't unless you use get_unchecked, which is unsafe.

[–] Phen@lemmy.eco.br 3 points 1 day ago

At one point long ago (just for a short while), I thought Delphi was destined to take that place. It was much higher level while still letting you go as low level as you wanted- it didn't have garbage collection but it made it pretty easy to keep track of what is or isn't allocated, on top of having good tools to find leaks on runtime. But it had too many problems too: the Pascal base and the association with drag and drop coders being some of the first ones, followed by a series of bad decisions by whatever company was responsible for it at any given week.

[–] ZILtoid1991@lemmy.world 0 points 1 day ago

The "better" performance is due to the built-in multi-threading support, and that functional programming makes it relatively safer to pull off. Otherwise single-threaded Rust is very hard to optimize.

[–] CanadaPlus@lemmy.sdf.org 5 points 1 day ago* (last edited 1 day ago)

Yep, and that's not a bad thing. Switching has a cost, and using the old standby is probably the way to go if there's a bunch of new things, none of which are definitely, inarguably better than it.

[–] soc@programming.dev 7 points 1 day ago

“apparently it’s a better safer C++, but I’m not going to switch because I can technically do all that stuff in C++”

The main difference between C++ and D was that (for most of the time in the past) D required garbage collector.

So, D was a language with similar Algol-style syntax targeting a completely different niche from C++.

Trying to correct your quote, it should read something like "I’m not going to switch because I can't technically do all that stuff in D that I'm doing in C++" for it to make any sense.

[–] napkin2020@sh.itjust.works 5 points 1 day ago (1 children)
[–] lime@feddit.nu 7 points 1 day ago (1 children)

that was the stated goal, at first. to replace C for writing os services.

[–] napkin2020@sh.itjust.works 9 points 1 day ago (1 children)
[–] lime@feddit.nu 1 points 1 day ago (1 children)
[–] napkin2020@sh.itjust.works 4 points 1 day ago

Maybe. But Go is much more closer to C than to Cpp.

[–] tonytins@pawb.social 5 points 1 day ago* (last edited 1 day ago) (2 children)

I tried programming in D a little. Wasn't bad. Just up against industry giants.

[–] ZILtoid1991@lemmy.world 3 points 1 day ago

That's the best part, it's not made for industry specs!