r/programming • • Nov 11 '22

NSA urges orgs to use memory-safe programming languages - C/C++ on the bench, as NSA puts its trust in Rust, C#, Go, Java, Ruby and Swift

https://www.theregister.com/2022/11/11/nsa_urges_orgs_to_use/
4.2k Upvotes

799 comments sorted by

View all comments

Show parent comments

11

u/smalleconomist Nov 11 '22

You, circa 1970: “An experienced developer is perfectly capable of writing a safe program in assembly, the propaganda against assembly is getting slightly annoying lately.”

-2

u/Zeh_Matt Nov 11 '22

Your point? Assembly can be also safe, lets not ignore that all your fancy languages are compiled down to it.

7

u/smalleconomist Nov 11 '22

My point is you can write safe code in any language, but it’s much easier in some languages than others. Hence the “propaganda” against languages in which it’s hard to write safe code.

-5

u/Zeh_Matt Nov 11 '22

But it's not really hard to do that in C++, I can agree that some languages do certain things better than others, but people seem to think that C++ is inherently unsafe which is simply not true.

7

u/smalleconomist Nov 11 '22

But it’s not really hard to do that in C++

Given the large number of vulnerabilities routinely discovered in C++ code, I think many people would disagree here.

-3

u/Zeh_Matt Nov 12 '22

You mean when people write C in C++ and pretend its C++? Yeah sure, still not the fault of the language.

5

u/smalleconomist Nov 12 '22

If there are more mistakes in C++ programs than in Rust programs on average, wouldn’t you say Rust is safer? Or at least that it’s easier to code safely in Rust?

1

u/Zeh_Matt Nov 12 '22

Let me be absolutely clear, yes Rust forces much safer code as long you don't use "unsafe", I never said that is not the case. What I'm saying is that C++ is not as unsafe as people make it to be, and also yes, it could be a lot better and in my opinion we are slowly getting there. There is just no reason to immediately jump ship because people say so, just try to writer better C++ maybe?

4

u/-Redstoneboi- Nov 12 '22

The reason is people have tried and failed.

0

u/[deleted] Nov 12 '22

[deleted]

1

u/Zeh_Matt Nov 12 '22

Proof for what? Also "scrutiny"? What are you even saying.

→ More replies (0)

0

u/[deleted] Nov 12 '22

[deleted]

2

u/Zeh_Matt Nov 12 '22

Ever heard about static analyzers? There's also stuff like ASAN/UBSAN, just compiling the code with different compilers can reveal lots of issues. We also have something called code reviews and the list choices we have goes on and on. And let me say this once again, I have absolutely no problem with different languages like Rust, if you use Rust that's perfectly fine. Calling C++ unsafe because people write stupid code is my stance here.