3 ms·
You should fire yourself. Seriously. Understanding which object parameters to a function are inputs and which ones are modified is key information about the be
by will4274 7y ago
You should fire yourself. Seriously.
Understanding which object parameters to a function are inputs and which ones are modified is key information about the behavior of a function. It's omission requires devs to divine the intent from the name and hope that every previous dev was a good citizen w.r.t keeping function names accurate to intent.
Finding and replace const with empty is the moral equivalent of replacing all the types of parameters with void*. After all, types are viral and ugly too.
I really hope that intern found a better place to work than your company.
- stephc_int13 7y agoI strongly disagree, obviously. Using const to document code might seems like a good idea in some organizations, with extremely large codebase, I don't know. But first, when you're an intern, you have to follow the local codestyle, even if you think it's not ideal. Second, I think there are much better rules than spamming const to attain the same objective, but you might need more experience to really appreciate that.
- will4274 7y ago> Second, I think there are much better rules than spamming const to attain the same objective Like? > you might need more experience to really appreciate that. Practically a picture perfect appeal to authority.
- icedchai 7y agoWith "const" you still need to rely on devs being good citizens since const can be trivially casted away. I've been programming in C for 25+ years. const is clutter.
- marcinjachymiak 7y agoDon't let consts get "trivially" casted away in code review. If something is no longer const than remove the keyword, or find another way to solve your problem
- will4274 7y ago> const can be trivially casted away. Yes, types can be trivially casted away too. That's not a reason to use void* everywhere.