Fixing C's Biggest Mistake
rikki cattermole
rikki at cattermole.co.nz
Fri Dec 23 23:16:01 UTC 2022
On 24/12/2022 11:57 AM, Walter Bright wrote:
> On 12/23/2022 2:37 PM, rikki cattermole wrote:
>> P1: separate out known state modules (ideally good) vs unknown state.
>
> Please be more specific.
The root of the problem is we have an old code base which for all
intents and purposes is in an unknown state.
We do not understand it in its entirety. There are duplicate behaviors,
a lot of it is undocumented.
We cannot deal with it as a whole, but we can start with leafs, things
that minimally depend on others.
As long as we keep known state vs unknown state in the same directory
structure, we will never be motivated to deal with it.
>> To turn a module into known state you must severely document it,
>> including TODO's.
>
> One of my most common review comments are: "Please add ddoc comments to
> added functions." A common thing I do when working on a section of code
> is add ddoc comments to the functions.
Yeah that is a great long term strategy which I have been pleased to see
happening, but the goal here is to do entire modules at a time.
>> For good state: do the TODO's.
>
> Grepping for TODOs in the source code doesn't yield much.
Yeah, it takes concentrated efforts to add them first.
>> Sound familiar? Its packagerization of leaf modules.
>
> We've already discussed that one to death.
Unfortunately. I (and a few others) just don't see any other way to pay
off such significant debt. What we are doing now is just tinkering
around the edges of the problem and isn't taking a sledge hammer to it
which is what actually is needed.
>> Oh and on another note: WTF why do we have two ASTs? That's a massive
>> technical debt to keep paying in maintenance (which we don't do).
>
> That was a refactoring added by people other than me. I agree with you
> on that one. Finding the right refactoring is not easy.
Sounds like some refactoring to do ;)
Get the sledge hammer!
More information about the Digitalmars-d
mailing list