this post was submitted on 25 Mar 2024
14 points (69.4% liked)

C Programming Language

1173 readers
3 users here now

Welcome to the C community!

C is quirky, flawed, and an enormous success.
... When I read commentary about suggestions for where C should go, I often think back and give thanks that it wasn't developed under the advice of a worldwide crowd.
... The only way to learn a new programming language is by writing programs in it.

© Dennis Ritchie

🌐 https://en.cppreference.com/w/c

founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] snowe@programming.dev 8 points 1 year ago (6 children)

Forking is a foolish idea. The core principle of computer-science is that we need to live with legacy, not abandon it.

what a crazy thing to say. The core principle of computer-science is to continue moving forward with tech, and to leave behind the stuff that doesn't work. You don't see people still using fortran by choice, you see them living with it because they're completely unable to move off of it. If you're able to abandon bad tech then the proper decision is to do so. OP keeps linking Joel, but Joel doesn't say to not rewrite stuff, he says to not rewrite stuff for large scale commercial applications that currently work. C clearly isn't working for a lot of memory safe applications. The logic doesn't apply there. It also clearly doesn't apply when you can write stuff in a memory safe language alongside existing C code without rewriting any C code at all.

And there's no need. Modern C compilers already have the ability to be memory-safe, we just need to make minor -- and compatible -- changes to turn it on. Instead of a hard-fork that abandons legacy system, this would be a soft-fork that enables memory-safety for new systems.

this has nothing to do with the compiler, this has to do with writing 'better' code, which has proved impossible over and over again. The problem is the programmers and that's never going to change. Using a language that doesn't need this knowledge is the better choice 100% of the time.

C devs have been claiming 'the language can do this, we just need to implement it' for decades now. At this point it's literally easier to slowly port to a better language than it is to try and 'fix' C/C++.

[–] lysdexic@programming.dev -5 points 1 year ago (3 children)

The core principle of computer-science is to continue moving forward with tech, and to leave behind the stuff that doesn’t work.

I'm not sure you realize you're proving OP's point.

Rewriting projects from scratch by definition represent big step backwards because you're wasting resources to deliver barely working projects that have a fraction of the features that the legacy production code already delivered and reached a stable state.

And you are yet to present a single upside, if there is even one.

At this point it’s literally easier to slowly port to a better language than it is to try and ‘fix’ C/C++.

You are just showing the world you failed to read the article.

Also, it's telling that you opt to frame the problem as "a project is written in C instead of instead of actually secure and harden existing projects.

[–] tatterdemalion@programming.dev 6 points 1 year ago* (last edited 1 year ago) (1 children)

And you are yet to present a single upside, if there is even one.

This is a flippant statement, honestly, as it disregards the premise of the discussion. It's memory safety. That's the upside. The author even linked to memory safety bugs in OpenSSL. They might still exist elsewhere. (I realize there is a narrow class of memory bugs that C compilers understand, but it's just that, a narrow class). We have scant way of knowing whether or not they exist without significant testing effort that is not likely to happen. And it would be fighting a losing battle anyway, because someone is writing new C code to maintain these legacy systems.

load more comments (1 replies)
load more comments (3 replies)