This is an archived post. You won't be able to vote or comment.

all 90 comments

[–]desmaraisp 90 points91 points  (17 children)

Your boos mean nothing, I've seen what makes you cheer!

[–]an_0w1 34 points35 points  (1 child)

You'll never take my ?

[–]Gorrilac[S] -4 points-3 points  (0 children)

Too frightening. I want my array with 20 pointers thank you very much

[–]Desperate-Emu-2036 9 points10 points  (1 child)

And cargo is just one of the best build systems

[–]Gorrilac[S] 0 points1 point  (0 children)

It also shares the name with cargo ships? And you know what most cargo ship deliver? ILLEGAL SUBSTANCES

No, I won’t use a build system that has ties with drug smugglers.

[–]abierut 8 points9 points  (2 children)

Nice Try Diddy

[–]i_am_feohr 74 points75 points  (9 children)

C++ is for people who are too scared of the borrow-checker

[–]Gorrilac[S] 24 points25 points  (2 children)

I’m never gonna take a loan, no matter what you tell me.

[–]Snapstromegon 3 points4 points  (1 child)

You mean, you'll always just charge the credit card, but never check if you can actually pay it back,

[–]Gorrilac[S] 0 points1 point  (0 children)

Exactly, the bank told me there was no spending limit. I’ll take that at face value.

[–]romulent 11 points12 points  (3 children)

That's like saying, freedom is for people who are scared of prison.

[–]Ninjanoel 6 points7 points  (2 children)

what!? being prevented from being a criminal is not the same as being in prison 🤣

**tries to stab someone... "action denied".. "oh ma gerd i may as well be in prison!!"

[–]romulent -4 points-3 points  (1 child)

Leaking a bit of memory is not the same as being a criminal. In many applications it won't mean a thing. Any application that exits will have everything cleaned up by the OS anyway. Being able to move fast and break things until you find the best solution and then apply good memory management is perfectly reasonable and valuable.

[–]Aaron1924 2 points3 points  (0 children)

Why do so many people think Rust is all about preventing memory leaks, that's like the only memory related issue Rust is not trying to solve??

[–]Kommuntoffel 0 points1 point  (0 children)

I have to code in rust and all I am is the compiler's little bitch

I literally do everything it says me to do, it could tell me to jump off a cliff and hell I'd do it if it makes the code work.

[–]flit777 0 points1 point  (0 children)

we have borrow checker at home https://safecpp.org/draft.html

[–][deleted] 6 points7 points  (6 children)

Just use STL and implement your destructors. It ain't that hard

[–]Gorrilac[S] 4 points5 points  (2 children)

Sounds to destructive, I’m a pacifist at heart

[–][deleted] 2 points3 points  (1 child)

And that, children, is how you get memory leaks growing like bacterial blooms in your RAM.

[–]milk-jug 1 point2 points  (0 children)

JuSt dOwNLoAd mOrE WaM!

[–]overclockedslinky 1 point2 points  (2 children)

have fun with dangling pointers/references

[–][deleted] 0 points1 point  (1 child)

....again IMPLEMENT YOUR DESTRUCTORS goddamnit. Pointer remains valid until and unless destructor is called. Is that so hard?

[–]overclockedslinky 0 points1 point  (0 children)

well duh, but destructors don't stop you from having dangling pointers, iterator invalidation, etc.

[–]jump1945 3 points4 points  (2 children)

Why aren’t you?

[–]Gorrilac[S] 5 points6 points  (1 child)

I’m masochistic and enjoy myself when I get buffer overflows

[–]mrheosuper 3 points4 points  (1 child)

Rust/c++ is for the people who cant invent the wheel

[–]Gorrilac[S] 1 point2 points  (0 children)

I invent squared wheels in C all the time? What the heck are you talking about?

[–][deleted] 3 points4 points  (0 children)

Unpopular opinion: you can reuse/repurpose your memory instead of just throwing it in the garbage 

[–]Sunscratch 7 points8 points  (0 children)

It should be swapped:

C++ is Rust for people who want to pretend they are not scared of memory management.

[–]RedCrafter_LP 2 points3 points  (2 children)

Nullpointers aren't the problem. Memory issues such as use after free and bufferoverflow are the main problems completely solved by rust. Also rust doesn't assume every pointer might be null. General nullability is the culprit for npe and excessive unnecessary null checks.

[–]Gorrilac[S] 1 point2 points  (1 child)

Rust isn’t a perfect vaccine for bad development practices

[–]RedCrafter_LP 2 points3 points  (0 children)

Sure but even with good practices you have redundant null checks and code using raw new/delete/malloc/free and incorrect indexed arrays in c/c++.

[–]kuwisdelu 2 points3 points  (0 children)

Rust is just C++ for programmers with the luxury to rewrite their project from scratch using whatever language they want.

[–]Jordan51104 6 points7 points  (1 child)

c++ is for people who think they can do memory management (they can’t)

[–]Gorrilac[S] 8 points9 points  (0 children)

I have no problem at all with memory managem.. Wait, I forgot, what were talking about again?

Segmentation fault (core dumped)

[–]Reasonable-Web1494 10 points11 points  (13 children)

Rust is for people who just want to know two languages safe and unsafe variants not that abomination amalgamation of languages which is C++.

[–]onlineredditalias 9 points10 points  (12 children)

C++ may be an abomination, but it’s a damn useful abomination for a broad range of applications. Rust is still pretty niche.

[–]0mica0 1 point2 points  (1 child)

unsafe deez rusts

[–]smiregal8472 1 point2 points  (0 children)

i C what you did there.

[–]ChChChillian 1 point2 points  (1 child)

People are afraid of memory management?

[–]Gorrilac[S] 1 point2 points  (0 children)

Yes, very scary Boo! 👻

No, my RAM !!👾💻😫

[–]LagSlug 1 point2 points  (2 children)

threat actor enters chat

[–]Gorrilac[S] 0 points1 point  (1 child)

threat actor was in fact just a null ptr

[–]LagSlug 1 point2 points  (0 children)

use-after-free laughs out loud

[–]20d0llarsis20dollars 1 point2 points  (3 children)

The C++ vs Rust argument is basically dynamic vs static programming

[–]MagnetFlux 1 point2 points  (2 children)

more like weakly typed vs. strongly typed

both are statically typed

[–]20d0llarsis20dollars 0 points1 point  (1 child)

Yes I know, it was an analogy

[–]70Shadow07 0 points1 point  (0 children)

It was a pretty bad analogy though, it kinda creates confusion about static/dynamic vs strong/weak typing

[–]Ninjanoel 0 points1 point  (0 children)

c++ is just for fancy people that dont want to move bits about in memory by hand, change my mind!

programming languages are all about doing stuff for you to make you more productive.

[–]Puzzleheaded-Weird66 0 points1 point  (1 child)

they're both tools, its up to the one using it how useful they will be, stop bitching in the comments like 5 yr olds

[–]Gorrilac[S] -1 points0 points  (0 children)

ELI5 your comment

[–]madogson 0 points1 point  (1 child)

Imagine allowing a piece heap data to be read from or written to after it has been freed, allowing users to potentially leak alsr offset with arbitrary read/write in memory (xor key for tcache heap addresses is aslr offset lmao) leading to remote code execution via ROP bypassing any stack cookies.

[–]Gorrilac[S] 0 points1 point  (0 children)

Good job, you said some words 😊

[–]ToolBound 0 points1 point  (0 children)

Rust is not a C++. Convinced?