News for hackers. Stuff that matters.
Re:Some were meant for C [pdf] by JohnFen on Thursday June 22, 2023 @10:42AM (#36432880)
> being forced to do so because otherwise your program might die a horrible death seems hard to justify as advantageous.

The advantage is that it forces me to do the task properly, and prevents me from getting lazy and having important skills and habits atrophy.

Also, it doesn't feel like an extreme sport or anything. It's just programming, like in any other language. Not any more or less stressful.

Re:Some were meant for C [pdf] by antonvs on Thursday June 22, 2023 @11:52AM (#36434075)
It may not be stressful for you, but it ends up being stressful for anyone who has to rely on the resulting programs. When they have a security issue due to a buffer overflow, or a crash due to a null pointer error, etc.

The "just trust me bro" school of programming is not suitable for delivering serious systems.

Re:Some were meant for C [pdf] by JohnFen on Thursday June 22, 2023 @12:32PM (#36434695)
> it ends up being stressful for anyone who has to rely on the resulting programs.

Only if you're writing bad programs. The idea that it's impossible to write good, solid programs in any given language is ridiculous.

> The "just trust me bro" school of programming is not suitable for delivering serious systems.

No one is advocating that. Your choice of language doesn't change the need for processes that ensure quality.

Re:Some were meant for C [pdf] by antonvs on Friday June 23, 2023 @05:21PM (#36452315)
> The idea that it's impossible to write good, solid programs in any given language is ridiculous.

The data disagrees. There's plenty of evidence that the severity of bugs and the number and severity of security bugs is far higher in languages like C or C++ than in memory-safe languages.

> Only if you're writing bad programs.

This is precisely the "just trust me bro" mentality I was referring to.

"I write good programs, I swear!"

But you're human, and you really don't. You make mistakes. Empirically, you make roughly as many mistakes per line as programmers in other languages, but the consequences of those mistakes are worse.

You can argue with me all you want, but you're essentially arguing with reality. C has survived for legacy reasons, but almost everyone is desperate for a better, more robust alternative.

Just so you know where I'm coming from - I learned C in the early 80s, not long after learning Fortran. I later started using C++ because it seemed to offer some benefits. But now - more than forty years later, when there are so many better alternatives for any given problem except one which requires legacy integration - it's astonishing to me that people are still staunchly defending C.

It reminds me of what Max Planck said about physics:

> “A new scientific truth does not triumph by convincing its opponents and making them see the light, but rather because its opponents die, and a new generation grows up that is familiar with it.”

Re:Some were meant for C [pdf] by fsckboy on Friday June 23, 2023 @04:00AM (#36444080)
if you can't write code without buffer overflows, how are you going to write code that is accurate on any of a number of other dimensions? You need to do things the right number of times, if you don't, you get the wrong answer. I agree that security vulns are bad bad, but correctness is also a good thing, and getting things right is not a "nice to have" skill.