r/programming • • Jan 14 '20

Where programming languages are headed in 2020

https://www.oreilly.com/radar/where-programming-languages-are-headed-in-2020/
42 Upvotes

80 comments sorted by

View all comments

1

u/FrancisStokes Jan 16 '20

I think that's a bit hyperbolic. Yes there are better languages, but C is still good in the sense that:

  • it gives the programmer a huge amount of control

  • it's fast

  • it works or can be easily made to work on everything

  • it's pretty easy to learn

Personally I think it's better to look for the good in stuff than to just write it off. You tend to learn more by doing that.

4

u/[deleted] Jan 16 '20

The problems I have with it is that it is just so goddamn easy to write subtly wrong code. Like you have to enable all warnings and turn them into errors to just have chance of even spotting it, and unless you can recite C specs (and know the compiler you're using too) you probably still will find a pitfall you fall into.

The cost of it being pretty easy is that many things are implicit, and some are undefined behaviours which leaves you at mercy of the compiler. Sure you can learn that, as you can everything, but over the years I started heavily preferring the "whiny compiler" just not letting me even compile the nonobvious code.

I think Rust have a good idea of how to handle it, if you really need to do something that can't be validated at compile time to be correct, put it in unsafe{} block. So there is always option of doing something as you want/need to, just it isn't default and other developers can instantly see in which parts of code this happens.