r/programming • • 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

1.0k comments sorted by

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".

469

u/Jjzeng Feb 28 '24

Tldr: stop using strcpy() to take inputs

259

u/[deleted] Feb 28 '24

Don't tell me how to live my life!!!

45

u/muntoo Feb 28 '24

Continue moving forwards through time at a rate of roughly 1 second per second, relative to me.

→ More replies (7)
→ More replies (4)

94

u/falconindy Feb 28 '24

My buffer my choice!

→ More replies (1)

15

u/azswcowboy Feb 29 '24

while ( *t++ = *s++ );

Literally perfect. What could go wrong /s

→ More replies (1)

24

u/mccoyn Feb 28 '24

Why would I do that when I can sscanf()?

→ More replies (6)

86

u/CoreyTheGeek Feb 28 '24

saying to rewrite everything in Rust

message received, will spread the gospel far and wide!

80

u/all_is_love6667 Feb 28 '24

there are ways to make C++ safer... honestly if they are not forced to do it, it won't change anything

it's like building codes for house, or security standards in cars or toys, etc. if something doesn't meet norms, you cannot insure it. that's where the law comes in, but with silicon valley libertarian tech bros it has low chance of happening.

61

u/josefx Feb 28 '24

there are ways to make C++ safer.

Have anyone who uses C string handling code in 2024 drawn and quartered? Then questioned for the whereabouts of his co conspirators?

35

u/DevBen80 Feb 28 '24

I agree with the sentiment, but you might want to switch the order of execution

→ More replies (4)

20

u/KiwiDutchman Feb 28 '24

The act of using it is the punishment… you don’t use it unless you must use it

→ More replies (1)
→ More replies (3)
→ More replies (18)

17

u/Guvante Feb 28 '24

Also honestly for most projects a managed language is even better than Rust from a safety perspective.

Use after free is really hard when using a GC.

→ More replies (1)

2

u/grasshoppa_80 Feb 28 '24

Has the WH not heard of Microsoft frontpage?

s/

2

u/GravyMcBiscuits Feb 28 '24

memory safety and using static analysis

also dynamic analysis. if you're on a C/C++ project and have never heard of valgrind, you should fix that right now.

→ More replies (1)

2

u/[deleted] Feb 29 '24

 "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"

Oh no worries, I fed all the code into chatgpt to check for issues and it said we're good to go!

→ More replies (33)

1.8k

u/CanvasFanatic Feb 28 '24

Biden officially endorses Rust.

166

u/ZiKyooc Feb 28 '24

Strangely they didn't mention COBOL...

108

u/_meddlin_ Feb 28 '24

COBOL has an excellent type system, and for its intended use-case, pretty difficult to introduce memory safety hatches.

67

u/Blitzsturm Feb 28 '24

I'm one of the lucky few that learned it in college but haven't used it since. It's "kind of fun"... in a way. I'll try to explain an interesting scenario for those that have never used it:

If you have a block of first name, last name, age for example, there's no such thing as variable length strings so lets say you have first name of 20 char, last name of 40 char and age as a two byte integer. This would use a total of 62 bytes of memory allocated at start-up. If you were to set a last name of greater than 40 characters it would run into the rest of the allocated memory space, and depending on what ascii character landed in there you'd end up with a MUCH different age.

So, it's kind of easy to have memory glitches with bad code... BUT you get EXACTLY the amount of memory you allocate from the start, not one byte more or less. It's provisioned and destroyed at start/end.

→ More replies (19)

15

u/[deleted] Feb 28 '24

blessed grace hopper

23

u/G_Morgan Feb 28 '24

COBOL makes using dynamic memory management so hard you won't want to.

6

u/denzien Feb 28 '24

Obviously because we have COBOL.NET. Ever heard of C++.NET? I rest my case.

/s

7

u/koko775 Feb 28 '24

I know you’re being sarcastic but here’s some cursed knowledge: C++.NET does exist and it’s worse than you imagine (Managed C++ and C++/CLI and C++/CX and C++/WinRT)

→ More replies (9)

308

u/Ok-Kaleidoscope5627 Feb 28 '24

Biden wants us all to become furries or femboys!

They better subsidize my fur suit. I hear they're expensive.

92

u/CanvasFanatic Feb 28 '24

You’re also permitted to be the unshaven + t-shirt everyday archetype I believe.

31

u/littleliquidlight Feb 28 '24

Notably pants are missing from your description

I do love remote work

→ More replies (1)
→ More replies (9)
→ More replies (2)

52

u/k3v1n Feb 28 '24

This language has way, way more hype than jobs. Almost no company is using it relative to the amount of people learning it.

19

u/darthcoder Feb 28 '24

For a 10yo language it's adoption has been slow, and I wonder if that's just due to the entrenment of Java and typescript dominating. Moving to typescript brought huge value - you only need one type of skill to do full stack development JS/TS.

Php, python, all exploded alongside Java and even replacements to it, and Go has been singularly successful.

The inertia in Rust surprises me, but considering the rise of nodejs, it really shouldn't.

46

u/Full-Spectral Feb 28 '24

People say this, but C++ began in 1988'ish, and really didn't begin to become mainstream until the late 1990s, despite having vastly less competition than exists today.

And, sure, C++ and Rust are systems languages primarily, and the amount of code that requires that sort of language has dropped over time, which is why C++'s kingdom has shrunken massively. But there's still a lot of it and that stuff is what is most critical in terms of safety since it sits under so much other stuff.

Interest in Rust is growing quickly, hence why so many C++ people are so livid at the amount of Rust discussion and comparisons to Rust.

→ More replies (28)

30

u/G_Morgan Feb 28 '24

People spent most of that 10 years denying memory safety was even a thing and denying it was hard. I can remember people honestly arguing Valgrind was as good as using Rust.

Then MS put out a research paper that could have been titled "Rust solves all our problems" a few years back and suddenly MS and Linux are looking at adopting Rust.

It is one of those rare languages with an actual evidence base for why it is a good idea. Not that "memory bugs are everywhere in C/C++" should have been remotely controversial.

The final point in all this is Rust has been chasing sectors that just don't move all that quickly. You don't make web apps in Rust, you make operating systems. There aren't many new and exciting OSes the last 10 years.

→ More replies (1)
→ More replies (20)

15

u/CanvasFanatic Feb 28 '24 edited Feb 28 '24

I’m replacing Java services with it at work right now. We're very casually just trouncing JVM performance under load.

As long as Rust continues to have more developer enthusiasm than enterprise adoption it’s a competitive advantage for companies using it.

→ More replies (6)

14

u/coasterghost Feb 28 '24

VISUAL BASIC IS BACK BABY!

8

u/segv Feb 28 '24

On Error Resume Next tho..

→ More replies (1)
→ More replies (2)

38

u/[deleted] Feb 28 '24

Based Dark Brandon.

24

u/MogChog Feb 28 '24

Base 2 or base 16?

→ More replies (1)

2

u/netsettler Feb 29 '24

Uh, I think you meant Lisp. :)

→ More replies (63)

174

u/bobbane Feb 28 '24

Let's trade:

  • Developers will move to memory-safe languages
  • Legislators will put bills into GitHub, and all edits will be trackable to the Congresscritter/staffer/lobbyist who made them

Deal?

68

u/Randolph__ Feb 28 '24

Legislators will put bills into GitHub, and all edits will be trackable to the Congresscritter/staffer/lobbyist who made them

That's actually genius lol.

17

u/ghostfaceschiller Feb 28 '24

Bills and all proposed versions are already fully public, and amendments/changes are generally named by the congressperson who added/sponsored it

The actual text is generally written by committee, which would be a big list of people you have never heard of, and absolutely no one would pay attention to bc it would be impossible to ascribe meaning to it. Not that anyone would even take the time to read the bills anyway (again, they are already public)

The congressperson putting it forth is the one you should be caring about. They are the ones who vouch for and submit it.

→ More replies (2)

478

u/gnomeplanet Feb 28 '24

Does this mean that programming in C++ is an act of terrorism?

16

u/nemec Feb 28 '24

Crypto algorithms are classified as munitions therefore Biden is trying to take away your 2nd Amendment rights to C++! Wake up sheeple!

61

u/mackerelscalemask Feb 28 '24

Good for Unity’s prospects over Unreal Engine if it is!

19

u/Zinlencer Feb 28 '24

Why? The core of Unity is also written in C++, right?

→ More replies (1)

5

u/rabid_briefcase Feb 28 '24

No. It means the reporter at InfoWorld who wrote the article didn't read the press release, doesn't program, or both.

25

u/GreatTragedy Feb 28 '24

Kinda always has been, in my opinion.

3

u/Droi Feb 29 '24

Sir you're under arrest, this is your 4th memory leak this month.

3

u/strider_25 Feb 29 '24

Self terrorism. I terrorize myself everyday by the code I myself wrote.

→ More replies (4)

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

19

u/IAmRoot Feb 28 '24 edited Feb 28 '24

Yep. I work in HPC. Anyone inputting data into an application already has access to a shell and compiler toolchains. Sometimes memory safety just doesn't matter.

Unless something has changed since the last time I checked, Rust needs variadic generics and tuples before I'd consider it. I write a lot of higher order functions in C++ (programming models/frameworks) and need those all thr time.

→ More replies (3)
→ More replies (8)

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.

Recent studies from Microsoft and Google have found that about 70 percent of all security vulnerabilities are caused by memory safety issues.

1.1k

u/mariosunny Feb 28 '24

Biden wants to CANCEL C++ in favor of WOKE memory safe languages | Big Tech is FURIOUS

(thumbnail of blocky red text with screaming blue-haired woman)

87

u/BigMax Feb 28 '24

"Liberals want to come into YOUR COMPUTER and tell YOU how you should use it! Even your PC is now subject to the PC police!!!"

→ More replies (3)

214

u/hungry4pie Feb 28 '24

I’m just asking questions here, but is it true that that these woke languages are part of a bigger agenda by the blacks and the queers?

Because you just know those clowns will find a way to drop that in there

158

u/GalacticCmdr Feb 28 '24

Internal documents show Rust will rename itself to RUSTGBQ++ to be more inclusive of all programmers and programming languages.

→ More replies (26)
→ More replies (5)

55

u/geodebug Feb 28 '24

You joke but geez, this is so easily how it could go down. Especially this year.

→ More replies (2)

8

u/F3nix123 Feb 28 '24

Elon will subsequently drop a C - {woke} language to protect developers god given right to write vulnerable code.

14

u/tooManyHeadshots Feb 28 '24

I’m sure it just coincidence that “cuck” starts with C

7

u/[deleted] Feb 28 '24

Your average government contractor will be FEMBOY wearing THIGH-HIGH SOCKS

→ More replies (12)

121

u/ryandiy Feb 28 '24

GOP leaders announce "Make C++ Great Again" campaign to fight against Big Government overreach into tech

12

u/R3D3-1 Feb 28 '24

... only to do the thing themselves later, because their issue wasn't the matter at hand but who announced it.

6

u/creamyjoshy Feb 28 '24

We don't need a package manager folks 👌🤏👋AMERICAN C++ developers have the FREEDOM to use any kind of nonsense versioning they want

73

u/jpfed Feb 28 '24

Hopefully it won’t get politicized like everything in the US.

When predicting the future, just assume that the literal dumbest thing will happen. Now that this statement has been released, in a few years we can expect the C++onfederacy to secede.

97

u/MultiversalCrow Feb 28 '24

We all know what's really behind this. Trump is a YUGE supporter of C/C++. "We love our pointers, don't we folks? We have the best pointers", he said to the Whitehouse Press Corps back in 2017 during his yearly Hackathon.

/s

33

u/[deleted] Feb 28 '24

We need an AI Trump to keep this bit going:

Many many people have told me, "Mr. President, C is the greatest programming language ever to be made, it's been at the top for many decades, just like you". I had a Firmware Engineer run up to me, tears in his eyes, thanking me for standing up against the RADICAL left's memory safe languages that would ruin his job.

They say that Rust could replace C and go into our military tech, but a lot of people are saying this, the Rust maintainers are furries, can you believe that? Furry code in our beautiful patriot missiles?

→ More replies (3)

40

u/dontaggravation Feb 28 '24

This isn’t a new thing. I learned to code professionally in C and then C++. No matter what we’ve tried over the years it always comes back to memory safety and overruns

I’ve worked on embedded systems with software “provers” for safety critical embedded components that still, on rare occasions, encountered issues

My view is automate the parts that are error prone — it’s accepted practice and design, one fact, one place, however it’s done (garbage collection, live monitoring, registration, etc) allow a core component to handle those elements in a consistent and repeatable fashion

52

u/Visinvictus Feb 28 '24

The fact is that there are still use cases, especially in game programming and large scale simulations, where memory management is critical to performance. People like to pretend that memory doesn't matter and write code without understanding how it actually works under the hood, but there are still plenty of situations where it absolutely matters.

17

u/dontaggravation Feb 28 '24

Didn’t mean to imply there wasn’t, sorry if it came across that way. There are cases, I’m Just saying we need to push for those situations to be the edge cases and to develop tooling to “automate” such management in a repeatable and guaranteed fashion.

I’ve worked with formal theorem provers on RISC based systems, where memory management is critical. Even there, we had extensive methods for verifying and “proving” the code and interactions. Obviously there are limitations to such approaches but I really feel we need to push manual memory management further and further to the edge cases

→ More replies (4)
→ More replies (1)

10

u/zack0falltrad3s Feb 28 '24

Garbage collection just takes too long

31

u/dontaggravation Feb 28 '24

Performance is all about measure, measure, measure. Yes. Garbage collection can be inefficient and long running. There are first past collector approaches and other strategies that can help

But I go back to measurement. Have we proven that garbage collection is the only slow part of the system. A lot of times the big offenders are in other areas of the software.

Anecdotal example. I promise to keep it short. I worked with a gentleman one time who refused to use for each loops. He was convinced that for loops were so much more efficient. Do you really think the compiler cares/differentiates such syntactic sugar? He would go out of his way to change for each to for everywhere he looked. When we analyzed the code, the biggest bottleneck and slowness in the system was as that it would waste file handles like water and not even properly cleanup such resources. We centralized all file interactions (and there were a LOT) into one class, replaced the usage and saw both a significant memory improvement and performance gain.

That’s where we should spend the time, identifying (measuring) the hot spots and focusing our efforts there. I would be hard pressed to say that the most egregious offender in most systems is the garbage collector

→ More replies (3)
→ More replies (1)

12

u/geodebug Feb 28 '24

I do find Rust’s solution compelling. Forcing the dev to handle it correctly so that a GC isn’t required. But Rust isn’t the only solution we’ll need.

→ More replies (7)

7

u/st4rdr0id Feb 28 '24

I’ve worked on embedded systems with software “provers” for safety critical embedded components that still, on rare occasions, encountered issues

In embedded programming it is not rare to disallow dynamic memory allocation entirely, and in case of C++, to use just a sane subset. I think this way of programming is pretty safe. Linters can highlight those calls that are deemed unsafe, or non compliant with, e.g. MISRA.

→ More replies (1)

7

u/voidstarcpp Feb 28 '24

Recent studies from Microsoft and Google have found that about 70 percent of all security vulnerabilities are caused by memory safety issues.

This is kinda misleading because that same Microsoft study said 98% of "vulnerabilities" were never exploited, even by proof of concept, just bugs identified and submitted to a database. There has been an explosion of CVE reporting and memory issues are easily detected even if they would have been hard to realistically exploit.

In the same year people cited the NSA as reblogging that report advising more memory-safe languages, they issued another report called "Top 15 Routinely Exploited Vulnerabilities" (2021). You had to get out of the top 10 to find a single memory safety bug. This is because the way most hacks actually happen -- feeding unsanitized client input into "eval" type mechanisms to facilitate remote code execution -- is always "memory safe".

5

u/geodebug Feb 28 '24

Good points.

I think the actual report is pretty even-handed:

However, even if every known vulnerability were to be fixed, the prevalence of undiscovered vulnerabilities across the software ecosystem would still present additional risk. A proactive approach that focuses on eliminating entire classes of vulnerabilities reduces the potential attack surface and results in more reliable code, less downtime, and more predictable systems.

One prong of a many pronged approach toward better security is to think hard about the building blocks developers choose.

TL;DR - a move toward security first thinking, not reacting to security problems later.

27

u/auronedge Feb 28 '24

is it because 70% of the code is already written in c++?

49

u/frenchtoaster Feb 28 '24

The stat is 70% of issues are memory safety bugs not that 70% of issues are found in C++ code.

Imagine 100% of code was written in C++, and 70% of issues were memory safety issues. What would that tell you?

→ More replies (11)
→ More replies (27)

12

u/fzammetti Feb 28 '24

You can have my C/C++ when you pry it from my cold, dead hands!

12

u/geodebug Feb 28 '24

Chinese hackers love this one trick!

6

u/NCRider Feb 28 '24

Who is going to protect the memory border?! Every time there’s a memory leak or buffer overflow, these bits and bytes are coming over illegally! And they are sending the worst ones. These aren’t the good bytes.

2

u/PaperMartin Feb 28 '24

"Rust is woke"

→ More replies (8)

102

u/Affectionate_Fly_764 Feb 28 '24

That’s like asking Banks to drop Cobol.

33

u/hobbykitjr Feb 28 '24

Worked for United Health care and they still used COBOL... they were trying to recruit and teach 20yo college drop outs since all their programmers were retiring.

17

u/Affectionate_Fly_764 Feb 28 '24

lmao I might apply to that as a side gig

→ More replies (3)
→ More replies (8)

19

u/soft-wear Feb 28 '24

Nah, it's telling Government contractors use something memory safe for new shit or you won't get the contract. Also, document how you're preventing memory problems in existing C/C++ code.

Banks have zero motivation for changing because tech is a "cost center". Contractors now have a very good reason.

3

u/[deleted] Feb 28 '24

“I’m making a bomb here— the memory management is built in”

→ More replies (3)

3

u/kilmantas Feb 28 '24

Banks are slowly abandoning COBOL. Barclays has already migrated all its systems from COBOL. The bank where I work is planning to reduce COBOL usage by 80% by 2028.

→ More replies (2)

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.

7

u/Rockfest2112 Feb 28 '24

Its a disaster national waiting to pop

→ More replies (2)

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.

2

u/Viking-Mage Feb 29 '24

Funny, I am the same about Type Safe languages. If I didn't use them, my variables would change more wildly in type than the Dons or Biden’s memories. (attempt to be funny, ironic, and an equal presidential candidate offender).

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. 

38

u/eerilyweird Feb 28 '24

Using C is like driving stick, apparently.

30

u/jarebeardamemelord Feb 28 '24

If you tell C to add two characters, it will add two characters. If you tell C to allocate memory over system 32, it will(I don't know if that is possible). There are no rules, there is no order, you are the rules, you are the order. Biden doesn't want us to become Gods of our CPU clearly.

73

u/ahoy_butternuts Feb 28 '24

We are humble farmers, simply tending to our memory allocations

11

u/steauengeglase Feb 28 '24

I'm an electron rancher.

→ More replies (2)

10

u/RonaldoNazario Feb 28 '24

It ain’t much, but it’s honest work

7

u/crozone Feb 29 '24

You don't need a GC to be memory safe.

3

u/MyButtholeIsTight Feb 28 '24

Borrow checker has entered the chat

→ More replies (1)

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.

→ More replies (1)

34

u/NatureBoyJ1 Feb 28 '24

Ada forever!

15

u/SHFTD_RLTY Feb 28 '24

Ada: The best language for academia and terminal guidance

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++.

→ More replies (1)

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 😌

  • Takes off tinfoil hat *
→ More replies (1)

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.

→ More replies (6)

3

u/kakamaka7 Feb 28 '24

Let’s go back to Pascal then

→ More replies (1)

3

u/DrRedacto Feb 28 '24 edited Feb 28 '24

Recent studies from Microsoft and Google have found that about 70 percent of all security vulnerabilities are caused by memory safety issues.

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!

2

u/_Pantom_ Apr 17 '24

best comment

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.

→ More replies (1)

2

u/painefultruth76 Feb 28 '24

MS AI Bot?

2

u/Viking-Mage Feb 29 '24

You act as if all written reports aren't either ChatGPT or by some other government’s psyops group. We live in a day and age where the majority of written articles are just Machine Learning programs.

→ More replies (1)

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/Viking-Mage Feb 29 '24

On top of the same slop it always is.

2

u/steveklabnik1 Feb 29 '24

Windows 11 already has some Rust in the kernel. Obviously that doesn't mean everything is being re-written overnight, but Microsoft is actively supportive of the White House here.

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?

3

u/steveklabnik1 Feb 29 '24

Yes, it is. The lists are not intended to be comprehensive.

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/NekoiNemo Feb 29 '24

Call back in about 10-15 years, and maybe Linux kernel will be mostly in Rust by then. Mostly.

→ More replies (1)

2

u/Equivalent_Stop4226 Feb 29 '24

Mr. Stroustrup would like a word..

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.

13

u/bayovak Feb 28 '24

C, C++, and Rust are all called "zero-overhead" languages, as they are all close enough to the metal that with relative ease you can make your code produce the exact CPU instructions you wish.

So they are all "maximum performance".

→ More replies (9)

3

u/randymysteries Feb 28 '24

Python and Java forever!

2

u/Viking-Mage Feb 29 '24

If only Python Repos (and Repos in general) didn't introduce their own security concerns.

→ More replies (2)

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

92

u/Smallpaul Feb 28 '24

They sort of do:

Memory safety vulnerabilities are a class of vulnerability affecting how memory can be accessed, written, allocated, or deallocated in unintended ways. Experts have identified a few programming languages that both lack traits associated with memory safety and also have high proliferation across critical systems, such as C and C++. Choosing to use memory safe programming languages at the outset, as recommended by the Cybersecurity and Infrastructure Security Agency’s (CISA) Open-Source Software Security Roadmap is one example of developing software in a secure-by- design manner.

...

The highest leverage method to reduce memory safety vulnerabilities is to secure one of the building blocks of cyberspace: the programming language. Using memory safe programming languages can eliminate most memory safety errors. While in some distinct situations, using a memory safe language may not be feasible – this report examines space systems as a unique edge case and identifies memory safe hardware and formal methods as complementary ways to achieve a similar outcome – in most cases, using a memory safe programming language is the most efficient way to substantially improve software security.

11

u/StrayStep Feb 28 '24

I have to agree with you. Because most coding projects are rushed every time, leaving very little time to analyze and perform memory leak tests.

I understand why projects are rushed, but QA testing and coders usually overlook memory out-of-bounds. Because coding projects are so focused on making it work as expected, rather than testing for the unexpected.

I still love C/C++ coding though.

23

u/loudandclear11 Feb 28 '24

What do you mean? Is the headline wrong?

32

u/anunakiesque Feb 28 '24 edited Feb 28 '24

The White House recommends memory-safer languages and practices, particularly in hardware dev. There's people pushing for Rust, and politicians in tech committees are listening, just looking for solutions, but no one other than "tech bros" are outright calling for dumping C and C++.

38

u/loudandclear11 Feb 28 '24 edited Feb 28 '24

You can't really call C and C++ safer, can you?

From the report:

Experts have identified a few programming languages that both lack traits associated with memory safety and also have high proliferation across critical systems, such as C and C++. Choosing to use memory safe programming languages at the outset, as recommended by the Cybersecurity and Infrastructure Security Agency’s (CISA) Open-Source Software Security Roadmap is one example of developing software in a secure-by-design manner.

→ More replies (12)

7

u/BigMax Feb 28 '24

Uh, yeah, they do...? Did you read it? Sure, they didn't say "dump", that's a bit of click bait, but they absolutely recommend people use other languages.

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.

32

u/justADeni Feb 28 '24

Rust can absolutely do the same thing with unsafe on bare metal/embedded.

→ More replies (1)

31

u/shizzy0 Feb 28 '24

Rust is awesome for embedded development.

6

u/hpxvzhjfgb Feb 28 '24

rust's syntax is far, far simpler than c++.

26

u/juanfnavarror Feb 28 '24

Syntax more complicated than C++? I would rather say that Rust is very expressive. It lets you convey more with less. In C++ you will always get extremely verbose when you use generics/modern features like smart pointers, iterators and containers.

Also, how can you be worried about compile times in baremetal development? These are not large desktop applications, you are thinking seconds build times, and builds are incremental in rust (think CMake + ninja but out of the box).

Dependency on LLVM is an issue? Its pretty standard development tooling, just install it. At least you dont need CMake, Ninja, meson (any build system), you dont need special compilers for each target, as you get backends for most MCUs easily with LLVM. Also Clang builds C, C++ faster and with more optimizations and warnings than GCC most of the time, so you probably should be using LLVM anyways.

→ More replies (1)

14

u/UncleMeat11 Feb 28 '24

C allows you to know exactly what is going on bare metal.

It does not. For example, cache friendliness is an extremely core component of modern performant code, yet C does not expose any understanding of caching to the user. It exposes a flat memory that isn't remotely like what the machine is actually doing.

29

u/geodebug Feb 28 '24

This comment describes the existing friction that will make change difficult, but doesn’t eliminate the responsibility for engineers to start thinking about change.

If “Rust doesn’t do X” then industry must develop a solution to solve for X that isn’t the status quo.

8

u/wellings Feb 28 '24

That's not where the friction is at all. The friction is that enormous, several million line, products are written nearly entirely in C and C++ and there is absolutely no feasible way to rewrite them.

→ More replies (5)

28

u/pyroman1324 Feb 28 '24

Please explain why Rust would not allow you to know what is going on in bare metal but C would.

If you really want to know what is going on, wouldn’t you look at the assembly?

7

u/Thatdudewhoisstupid Feb 28 '24

Apparently the OP never heard of -O3, or compiler optimizations, for that matter

18

u/IAMARedPanda Feb 28 '24

It's always reasonable to ditch C. There are very few good arguments for using C in embedded imo. C's strength seems to be because of its defacto spot as the ffi and abi standard. There are almost no reasons you can't use Rust or modern C++ in an embedded context.

Windows has C++ in the kernel and serenityos is fully written in C++. https://github.com/SerenityOS/serenity

→ More replies (2)

5

u/Wonderful_Truck_2544 Feb 28 '24

I think you are ill informed

→ More replies (5)

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?

10

u/StrayStep Feb 28 '24

This request to drop C/C+ isn't about games. It's about cybersecurity essentials(firewall, web gateways, AV, etc.).

But I guess we could consider, cyber security essential services games to hackers. 'Find programming loopholes and buffer overruns? Pass go, collect $$$'

8

u/jl2352 Feb 28 '24

Idiomatic Rust using LLVM is on par with idiomatic C++ using LLVM. Lots of benchmarks show it. This also makes sense when you look at the memory model and language semantics.

The main issue is that C++ has great support with other compilers (namely GCC and Intel). There is growing Rust support using GCC. It’s no where near as mature.

The other issue is the lack of maturity in mature libraries for parts of game development. This is in the open source world, but especially when you look at bespoke libraries at companies. A lot of that isn’t as mature in the Rust world. However there are examples of libraries migrated from C++ to Rust, and the Rust versions are on par in terms of speed.

Rust is a straight up fast language.

→ More replies (1)

6

u/LordBreadcat Feb 28 '24

I'm not a Rust guy myself and am mostly ignorant about it's ecosystem but I've been hearing about Bevy making the rounds in game dev circles. Rust itself is high performance and it's an ECS based engine so it too should boast excellent performance.

It hasn't even reached a whole version yet though so I'd assume the engine itself is far from fully featured. Certainly something to keep an eye on but nothing more than a novelty at the present time.

7

u/Kronikarz Feb 28 '24

In terms of performance Rust is perfectly performant for video games and other soft real-time apps. It's a young languages, so the performance and amount of third-party libraries is not as good as C++ quite yet but it's only a matter of time.

→ More replies (7)
→ More replies (20)

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.

→ More replies (1)

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/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/leandroabaurre Feb 28 '24

Did I bet right on Rust, then??