* Posts by Keybounce.two

1 publicly visible post • joined 10 Nov 2024

The US government wants developers to stop using C and C++

Keybounce.two

First Fortran, then C, then ...

Lets see. You want us to stop using language X that is fully understood now, and has a massive library out there, in favor of Y, that is not yet fully understood, and does not have that library?

Tell you what. You tell me how many years after "Stop using Fortran/Cobol" before those languages actually stopped being used. That is how long it will take for C/C++ to be done.

And if you really want it to be changed? Well, tell you what. Write a replacement for the Linux kernel in your language of choice. When that is functional and stable, then we can get programmers to use it.

Be sure to also replace all of Git, as that is required to manage a group project of that size.

Get all of the libraries and support code replaced? Ok, then we can talk.

=====

There is no such thing as a safe/unsafe language.

** The libraries are far more important **

C's standard libraries were never designed for memory safety, thread safety, etc.

Heck, at least one -- gets() -- was never designed in the first place. The manual flat out says,

SYNOPSIS

#include <stdio.h>

[[deprecated]] char *gets(char *s);

DESCRIPTION

**Never use this function.**

This is a function that, from day 1, was never memory safe.

You have all the tools you need in C to write memory safe code. You just have to put in the effort.

Apple went to a great deal of work to make Objective C memory safe. 95% of memory issues are handled automatically. (automatic reference counting and smart copy of data for instance variables).

But languages like Java can leak memory because no one ever cleans things up. "The language automatically tosses garbage, I don't have to worry". Well, thinking like that can kill the Objective C memory stuff as well.

And the rest of the claim that "newer designs are better"?

Cobol and Fortran are still around, because migrating those databases is harder than migrating the code base.