captainepoch's log

I like C

Oh, no… Another Segmentation fault running a C code you’re doing because, well, you put a bigger index than your array is going to handle, ooops!

It’s true that C is an old language. It’s like a cranky old guy who doesn’t want to be bothered by your crap, complaining at every step you take in order to keep running your program, handling everything because that guy wants to have always the control of everything.

But you know what? That’s the beauty of it. And yes, C is hard.

Handling the threads correctly to not get a race condition. Handling the memory to do the allocation and freeing after using it. Handling descriptors, because you need to open devices and use them. Handling the signals to not get killed by the OS.

A lot of things you don’t have to handle in other programming languages. And I think it’s a pitty to ignore that kind of knowledge. Sure, you take more time in order to get the software running, you have to be very careful with the memory overflow and the stack overflow (because you can get vulnerabilities).

And sure, if you’re using Go or Python you can learn how they work and how they handle that kind of stuff, but it’s not the same as learning with a programming language that force you to do so.

I’m not a professional with any programming language nor a prolific programmer, but everytime I write some code in another language that is not C, I miss that kind of stuff. I appreciate some comodities sometimes, I admit that, but not always.


If you have some comments, let’s have a discussion! Post an email in my inbox by sending a mail to ~captainepoch/blog_inbox@lists.sr.ht [mailing list ettiquete].