News for hackers. Stuff that matters.
Re:Const and Optimization in C by jjnoakes on Monday July 25, 2016 @12:56PM (#12159936)
I feel like this is analogous to throwing the baby out with the bath water.

I think writing const-correct code where you can is useful. It helps document your code (for yourself and for others), it CAN catch issues (even if Casey Muratori claims it never helped), and it really isn't that hard to do (C routines don't need to be duplicated if you want to return non-const, like strstr, for example).

So what if you have to cast-away-const for interfacing to libraries which aren't const-correct? It still has benefits for your own code.

There are no comments on this comment yet.