r/programming • u/bambin0 • Feb 28 '24
White House urges developers to dump C and C++
https://www.infoworld.com/article/3713203/white-house-urges-developers-to-dump-c-and-c.html
2.9k
Upvotes
r/programming • u/bambin0 • Feb 28 '24
1.4k
u/KingStannis2020 Feb 28 '24 edited Feb 28 '24
The headline is a bit of a misrepresentation of the report. They ask people to prefer memory-safe languages for new projects, and use best practices if you do use an unsafe language like C or C++, which includes putting some thought into the subject of memory safety and using static analysis.
The White House isn't saying to rewrite everything in Rust, they're saying "this is a problem, industry pretty please try to address that problem, here are some ways to do that, and by the way proving that you've at least thought about this problem will become part of our procurement guidelines eventually".
1.8k
u/CanvasFanatic Feb 28 '24
Biden officially endorses Rust.
174
u/bobbane Feb 28 '24
Let's trade:
Deal?
478
u/gnomeplanet Feb 28 '24
Does this mean that programming in C++ is an act of terrorism?
103
u/ominous_anonymous Feb 28 '24 edited 28d ago
The original post content no longer exists here. The author used Redact to remove it, exercising their right to control their data & privacy.
Raindrop deer price wild physical fear license coated resolute aromatic
674
u/geodebug Feb 28 '24
It’s a wakeup call that we’ve known was a problem. Hopefully it won’t get politicized like everything in the US.
49
u/litheon Feb 28 '24
Too bad there isn’t a C++++
102
u/Affectionate_Fly_764 Feb 28 '24
That’s like asking Banks to drop Cobol.
21
u/[deleted] Feb 28 '24
Security is sooooo sloppy at 80% of companies. Nobody wants to pay for specialists. For some reason executives think it’s cheaper to deal with breaches than prevent them.
31
u/Ibeepboobarpincsharp Feb 28 '24
You use memory safe programming languages for security. I use memory safe programming languages because I'm lazy. We are not the same.
95
u/jarebeardamemelord Feb 28 '24
I like to live life on the edge, plus I have a power trip and want memory to be de-allocated when I tell it to de-allocate. I don't want some ai garbage collector replacing my job.
13
u/artnoi43 Feb 28 '24
Meanwhile, Trump has started to support C and C++ programmers, as well assembly, saying “the right to memory management” is a fundamental right for all American programmers.
21
u/steauengeglase Feb 28 '24
The White House vastly underestimates my ability to write breakable code, regardless of the language.
34
u/NatureBoyJ1 Feb 28 '24
Ada forever!
7
u/jykke Feb 28 '24
Nooo! I wanna code my own ASN.1 parser in C...
19
u/[deleted] Feb 28 '24
The moment when even the government realized that a good programmer is rare, and a good C programmer is a very expensive rarity that cannot be replaced by a finite number of students.
10
u/Economy_Bedroom3902 Feb 28 '24
This article feels so weird to read. It feels like a report written by someone with very little tech experience being reported on by someone with even less tech experience intended for mostly non-technical readers.
The vast majority of people coding in C and C++ aren't doing so for shits and giggles, they're not spinning up new databases or web servers using C backends and just not giving a shit about the memory overflow issue. They either need the extreme optimization capabilities of those language, are maintaining an older system using one of those languages, or are working in a systems environment where running an interpreted language isn't realistic.
Some of those use cases could be replaced by Rust, but in a lot of the cases where this is true, memory overflows are just not a substantial issue. C++ and C also aren't just innately memory unsafe, you can relatively easily mitigate a memory overflow in both languages.
I'd like to see the whitehouse's data on how many memory overflow vulnerabilities created within the last 5 years are causing fiscal damage in the real world. I'd bet my left nut that it's almost entirely a problem because smaller older businesses are still running 20 year old software, not because people are still coding in C and C++.
14
u/dm-me-your-bugs Feb 28 '24
They're just trying to push uwu languages onto us so they can publish a uwu-do-stuff library on the uwu package manager and distribute an engineered vuln across the industry. Can't have that in you don't have a package manager 😌
4
u/FloydATC Feb 29 '24
They're trying to take away our footguns!
4
u/UnableAd1043 Feb 29 '24
Also, stop driving cars with combustion engines as they might explode 🙄
7
u/Darklord98999 Feb 28 '24
C is only unsafe because it trusts the user that they know what they are doing and grants them full control over the program. This prevents fighting with the compiler like you have to do in rust. People also seem to forget about compiler headers which can be used to make safety recommendations.
3
u/kakamaka7 Feb 28 '24
Let’s go back to Pascal then
3
u/DrRedacto Feb 28 '24 edited Feb 28 '24
How do you think these studies would classify one of the common exploit patterns, such as when $protocol_implementation forgets to check actual buffer size and trusts value it reads over the wire? I bet they classify that as "memory safety issue" because on the surface it looks like a buffer overflow, when a much deeper issue is clearly the cause of TRUSTING DATA ON ON WIRE/AIR. It should be a category like a type error, but will be counted as memory safety issue? Worst part is this pattern is found in firmware and companies refuse to disclose source code.
edit: ALSO, is this just "vulnerabilities" like fully bonafide official CVE reports? Because there are MUCH more bugs to consider if you want the real number.
3
u/Joe_Early_MD Feb 28 '24
Linus sounding like Milhouse: “ok, I’ll rewrite the kernel in Java”
3
u/Kevin_Jim Feb 28 '24
For those who don’t read the article, it’s nothing new. They just say that most vulnerabilities originated from some kind of memory safety issues.
The NSA released a similar note in 2022.
USA orgs are very consistent on this message.
If you do need to use a C/C++, then NASA urges to use the “The Power of 10: Rules for Developing Safety-Critical Code”.
3
u/[deleted] Feb 28 '24
Nature will take care of the C developers as their hands become unable to type from arthritis (myself included).
3
u/Seref15 Feb 29 '24
I would appreciate if they urged our product manager to prioritize dumping all our Angular code
3
u/brodoyouevenscript Feb 29 '24
I'M GONNA USE C EVEN HARDER
3
u/Brigapes Feb 29 '24
"Humans driving cars leads to accidents"
Hmmm, you know what, instead of making sure the driver is a good one, let's ask automakers to make better safety features! Surely this is the way to go!
3
u/[deleted] Mar 01 '24
No sense here! Dump microsoft and the problem is fixed - ass clowns!
3
u/GEM592 Mar 01 '24
'Unlearn to code'
3
u/GEM592 Mar 01 '24
'Learn to uncode'
3
u/Dan13l_N Mar 02 '24
If the US Government is saying so, people around the world will surely accept an opinion of such a benevolent institution
3
u/Stunning-Emphasis-50 Mar 27 '24
Boundary checking is for dweebs.
5
u/p1-o2 Feb 28 '24
Well, Biden has my vote then. C++ is so miserable I contemplated never working another software job again afterward.
8
u/Oswald_Hydrabot Feb 28 '24
How about you urge corporations to stop laying people off and causing vulnerabilities by being cheapasses? How about instead of blaming workers you blame the source of the problem?
4
u/Efficient-Cat-1591 Feb 28 '24
Yes… time to ditch Communist and Communist++ languages.
7
u/daveprogrammer Feb 28 '24
Uncle Bob warned us that one day, politicians would want to regulate which languages we could use.
2
u/painefultruth76 Feb 28 '24
MS AI Bot?
2
u/LoopVariant Feb 28 '24
"I cannot believe the federal government wants to interfere with my C garbage collection." /S
2
u/Dull_Cucumber_3908 Feb 28 '24
Ummm..... so windows 12 will be written in what language? /s
2
u/xRVAx Feb 28 '24
Interesting that the article mentions JavaScript but doesn't list it as one of the memory safe languages.
Is JavaScript safe or no?
2
u/Meme_Burner Feb 29 '24
Is there a mass market Operating System that is not written in C, C++, or a C derivative?
2
u/Equivalent_Stop4226 Feb 29 '24
Mr. Stroustrup would like a word..
2
u/The_Heck_Reaction Feb 29 '24
I should’ve listened to this senior Rust dev!
2
u/[deleted] Feb 29 '24
Government advice "Stop c++" - C++ Here am I !!!!
2
u/allnamesareregistred Feb 29 '24
* Skeptical ASM voices *
2
u/dissonant_one Feb 29 '24
Ctrl+f+u won't do what you tell me
2
u/Electrical-Ad5881 Mar 04 '24
There is very good alternatives here Nim for example.
Nim generates native dependency-free executables, not dependent on a virtual machine, which are small and allow easy redistribution.
Support for various backends: it compiles to C, C++ or JavaScript so that Nim can be used for all backend and frontend needs.
As son as programmers get the possibility to allocate/free memory you get disasters. Same for threads when there is no implementation by the language itself.
Robust programming tools..Cobol and PL/1.
2
u/johneeng Mar 26 '24
Maybe if they used C++ from a recent decade they might not hate it as much. Modern C++ is much safer than older versions. However, the programmer can always do stupid things.
12
u/MrGruntsworthy Feb 28 '24
Is it because the president can't do memory management?
4
u/Affectionate-Tart558 Feb 28 '24
Beginner programmer here. I’m wondering which languages can substitute these in terms of speed. It’s my understanding these two are the fastest. I know that at least companies like Honeywell still use C as I have a friend working there.
3
u/randymysteries Feb 28 '24
Python and Java forever!
3
u/scubascratch Feb 29 '24
Jokes on them I’m using Fortran
5
u/Sunscratch Feb 28 '24
Another attack from White House liberals on freedom! Usage of memory unsafe languages is guaranteed by second amendment. Vote for Trump if you want to make C++ great again. /s
11
u/anunakiesque Feb 28 '24
No they don't
7
u/efplaya Feb 28 '24
For some things, it is not reasonable to ditch c. For example embedded development. C allows you to know exactly what is going on bare metal. This would be a pain if not impossible with rust. Also Rust has its own issues. It's compile time is one of the slowest in modern programming. It's syntax is more complicated than even c++. It has a dependency on llvm which is like bringing the kitchen sink when developing.
Also, when every OS is written on C, it is easier to do os centric things in c. Rust has a FFI but it is kind of annoying to use and makes the code unsafe anyways.
3
u/BackupDatas Feb 28 '24
When has anyone in the White House made a good decision?!
3
u/d36williams Feb 28 '24
Is Rust that performant? Can it run video games? If you want a big workforce of SWE to know Rust, can Rust be used to make games that are performant?
2
u/[deleted] Feb 28 '24
lmao defense will never do this
2
u/MaxwellzDaemon Feb 28 '24
It's amusing that they would make such a recommendation and heartening to have a White House that is even aware of these issues.
2
u/dcoolidge Feb 28 '24
They want developers not so close to the hardware so they could abstract back doors for govt better.
2
u/sir-mivond Feb 28 '24
Damn, Rust is now Woke?
1
u/seyoit Mar 08 '24
Fuxk c
1
u/MiddleTelephone7579 Mar 09 '24
Saul Goodman in defining what pointer of pointer is :
**t = I know a guy who knows a guys
1
u/[deleted] Mar 10 '24
I wonder (possibly naively) if a large-scale push to update and secure the entire software ecosystem will lead to the developer job market getting better. So, considering the bumpy road we've been on recently, could this actually be a good thing?
1
u/antdude1234567890 Mar 24 '24
from what I see on the internet, people do not like Rust. I don't know a whole lot about it. I have simply been using HTML and CSS and other web developing languages. What is rust?
1
u/[deleted] May 01 '24
would this mean i likely wouldn't encounter C/C++ in a job setting as much? damn
1
u/bustingcaps May 21 '24
c and c++ are the foundation on which any aspiring programmer can build their knowledge base. It is the stick by which all other languages are measured. All this article does is make me want to abandon everything I know about game engines and go back to writing c++ in Notepad.
1
u/dr_jarm Jul 29 '24
For those asking why, the answer is simple. Essentially, the U.S. uses C/C++ as the primary language for developing its electronic programs, whether for defense or offensive purposes. Let's be realistic; you can't create hacking tools for government servers like Iran using Python or any modern languages. They simply don't want too many people learning C/C++ because a large number of C/C++ programmers might pose a risk. For example, if techniques for defending against attacks that use C/C++ were widely taught, it would be a significant issue for the government. Alternatively, the government might want more C/C++ programmers, but if this was made public, other countries would take precautions. Therefore, the government might be stirring controversy around C/C++ to increase its learning within the U.S. only, without letting it spread outside. In the end, these are just personal predictions and analyses from me as a software engineering professor. There are no sources to document my claims, but I am at least somewhat sure of them.
1
u/Simple_Plum_3977 Jun 24 '25
https://vm.tiktok.com/ZMSHGy2ES/
1
u/BitterNumber3375 Feb 28 '24
switches to assembly
1
u/TheGeneral Feb 28 '24 edited Feb 28 '24
WinRT C++ is managed and conforms to the C++ standard.
1
u/hugthemachines Feb 28 '24
I like how they listed the memory safe languages in alfabetical order.
I think it is a tiny bit interesting that they mentioned Ruby as a memory safe language in the context of getting rid of C and C++. Also, they did not mention Python.
It doesn't matter much, since those are just examples, I just think it is a little bit strange.
1
u/hugthemachines Feb 28 '24
Do you guys consider
https://www.statista.com/statistics/793628/worldwide-developer-survey-most-used-languages/
to be a trustworthy index?
1
u/leandroabaurre Feb 28 '24
Did I bet right on Rust, then??