Apparently I have a controversial belief about the modern software industry. I don’t think it should be controversial.
The belief is this: writing new code in C in 2023 is like installing plumbing in a new house using lead pipes.
Apparently I have a controversial belief about the modern software industry. I don’t think it should be controversial.
The belief is this: writing new code in C in 2023 is like installing plumbing in a new house using lead pipes.
@sylesej no. C is not fine once running.
The biggest problem with C is that pretty much nothing gets checked, and even that it’s not actually possible to check it. If you code perfectly and defend yourself against all possible rogue input, you MIGHT be OK. If something goes wrong, chances are it won’t even be caught until several billion CPU cycles later when the damage it’s done has crashed around in memory like an alpha particle in DNA.
It is common, for example, to write functions which handle multiple types of data. In C, since it doesn’t really have a type system to speak of, you pass the package and then tell it what sort of data you have passed.
It doesn’t check. It can’t check. The only validation that you’ve passed a Spong and not a Wibble is you saying, “this is a Spong, scout’s honour”.
So then you execute Spong handling code and, oops, you actually passed a Wibble, and it goes and corrupts something.
But the something it corrupts isn’t even necessarily just the stuff you passed it. It essentially starts randomly firing a machine gun into the crowd. And the crowd is the rest of your program’s data.
If you’re lucky, it fires a bullet somewhere the operating system cares about enough to use the memory management unit to protect and the operating system immediately kills the process. If not, something randomly gets corrupted, and you find out … later by … some means.
@goatsarah not a software person, but isn't lead piping easy to put in but bad for everyone using and touching it ever after, while software in C is devilish for the original programmer but quite fine once running?
@goatsarah “Well, you asked for ‘plumbing’! How was I supposed to know you actually wanted pexing and coppering?”
GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.
All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.