25 points

All those memes picturing C++ as unsafe and unstable yet the server that serves these memes is running mostly C/C++ and has an uptime of months.

permalink
report
reply
14 points

Also they’re always treating C++ like it’s some arcane enterprise variant that uses 1990s C++

Using modern C++ you can write much cleaner, more usable, and really safe code

permalink
report
parent
reply
1 point

Having a thorough process and an engineer approach in software development is also pretty handy. There weren’t many bugs in the AGC. Yet it was programmed mostly in assembly and people had no trouble trusting it with their life.

permalink
report
parent
reply
35 points

Lemmy is written in Rust. There might be bits of C at the periphery behind bindings.

permalink
report
parent
reply
22 points

And linux is written in C.

permalink
report
parent
reply
-1 points
*

They implemented some sort of OOP tho.

edit: I meant: the Linux devs implemented some sort of OOP in their C code in the kernel – is something i read forever ago.

permalink
report
parent
reply
24 points
*

Predominantly C. But even the kernel is beginning to use Rust as a way of avoiding entire classes of programming error.

permalink
report
parent
reply
6 points

well and it’s only running this well because of decades of effort and millions of effort spent on security reviews

permalink
report
parent
reply
3 points

Lemmy is written in Rust.

Wow, way to ruin my joke.

permalink
report
parent
reply
17 points

True, but that’s partly because the Linux is beyond mature, and you can ferret out a lot of bugs with millions of users over decades.

permalink
report
parent
reply
7 points

yet the server that serves these memes is running mostly C/C++

Time to rewrite it in Rust!

/ducksandruns

permalink
report
parent
reply
4 points

if i remember lemmy is written in rust

permalink
report
parent
reply
2 points

Lemmy is rust and it’s alternative sublinks is java…your comment has now power here

permalink
report
parent
reply
47 points
*

In Java, it’s not called the Crackable interface.

It’s the Nuttable interface.

permalink
report
reply
5 points

Provided your method specifies a strongly bound type you can ensure that you get your nut.

void dischargeNut(T extends Nut) { ... }
permalink
report
parent
reply
7 points

strongly bound you say?

permalink
report
parent
reply
3 points

How do I know if something is Nuttable?

permalink
report
parent
reply
42 points

Actually it’s AbstractNutAndShellsFactory

permalink
report
parent
reply
141 points
*

Rust is more like: unless you can mathematically prove to me that this is equivalent to a nut there is no ducking way I’ll ever let you compiled this.

permalink
report
reply
-16 points
*
16 points

Have you really used Rust or are you spreading FUD? I have not managed to cause even a single segfault in my 8 years of writing Rust code. Nor have I heard anyone else complaining about it, other than deliberately as proof of concept.

permalink
report
parent
reply
1 point

Refering to cve-rs but only one commenter got it

permalink
report
parent
reply
73 points

If you can make safe Rust segfault you’re doing something wrong.

permalink
report
parent
reply

IME Rust programs crash at about the same rate as other languages. “Rewrite everything in Rust” hasn’t made much of a difference for me, so far.

permalink
report
parent
reply
42 points

To be fair, you are doing something wrong if you’re app segfaults no matter what anguage you wrote it in…

permalink
report
parent
reply
21 points

It actually is possible to segfault in safe Rust, although it is considered a bug. Proofs of concept are shown in this cve-rs crate.

If you want an explanation of why this happens, I recommend this video: https://youtu.be/vfMpIsJwpjU

permalink
report
parent
reply
-1 points

Why are you getting downwoted man, getting segfaults in safe rust is on compiler not us. When you segfault in C and such it’s almost always your fault, if you manage to do that in rust it’s a bug in compiler.

permalink
report
parent
reply
2 points

Because the rust crowd spent a lot of time learning rust, and they’ll be damned if it isn’t the literal savior catch all silver bullet solution to programming.

permalink
report
parent
reply
1 point

It won’t segfault but it’ll absolutely panic over an unwrap at some point.

permalink
report
parent
reply
13 points

And hot take, but that’s good. I’m absolutely stupid enough for idiot gloves like that.

permalink
report
parent
reply
10 points
*

I just dabbled in javascript again, and that description is spot on!

console.log(‘javascript operators are b’ + ‘a’ + + ‘a’ + ‘a’);

permalink
report
reply
9 points
*

The only reason people use JS is because it’s the defacto language of browsers. As a language it’s dogshit filled with all kinds of unpleasant traps.

Here is a fun one I discovered the other day:

new Date('2022-10-9').toUTCString() === 'Sat, 08 Oct 2022 23:00:00 GMT'
new Date('2022-10-09').toUTCString() === 'Sun, 09 Oct 2022 00:00:00 GMT'

So padding a day of the month with a 0 or not changes the result by 1 hour. Every browser does the same so I assume this is a legacy thing. It’s supposed to be padded but any sane language would throw an exception if it was malformed. Not JavaScript.

permalink
report
parent
reply
3 points

I can‘t believe you’ve done this

permalink
report
parent
reply
1 point

Well, not by accident.

permalink
report
parent
reply
10 points

BaNaNa

permalink
report
parent
reply
6 points

Terracotta

permalink
report
parent
reply
3 points

Pepperoni and green peppers, mushrooms, olives, chives!

Oh wait wrong song.

permalink
report
parent
reply
119 points

Java: “Sorry, but the developers of Peanut didn’t declare it to implement the Crackable interface, even though it has all the relevant methods, so if you want to treat it like a nut your choices are write a wrapper class or call those methods using Reflections”

permalink
report
reply
20 points

Swift’s extensions system has spoiled me, and I feel the pain of this whenever I have to write Java

permalink
report
parent
reply
12 points

You should take a look at kotlin, pretty similar to swift and fully interoperable with java.

permalink
report
parent
reply
6 points
*

Ditto, but Rust’s traits. God those are so fun. It’s like duck typing a la Python but you can just slap whatever methods you want on a foreign type without worrying about breaking anything because they’re only visible to the current crate (or other crates that import the Trait)

permalink
report
parent
reply

Programmer Humor

!programmer_humor@programming.dev

Create post

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

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics

Community stats

  • 3.2K

    Monthly active users

  • 1K

    Posts

  • 37K

    Comments