Skip to content

Improve names of ConstraintVariable, etc. #413

Open
@mattmccutchen-cci

Description

@mattmccutchen-cci

I previously wrote:

Based on my experience developing the canWrite constraints PR (#391) as a newcomer, I'm starting to think some things in our code are very poorly named. For example, I would expect the term ConstraintVariable to refer to what we actually call a VarAtom. Perhaps what we now call a ConstraintVariable should be renamed to something like AnnotatableObject, since it may contain any number of VarAtoms and constraining the variables is just a means to the end of applying Checked C annotations to the object. Then PointerVariableConstraint (which is neither a variable nor a constraint) would become AnnotatablePointerType, and FunctionVariableConstraint would become AnnotatableFunctionSignature. (Probably some of the less prominent things should be renamed too; I haven't gone through all of them yet.)

(Addendum: My original proposal was ConstrainableObject, etc.; AnnotatableObject was a new idea this morning. Then I realized that one way in which ConstrainableObject is superior is that there are some things we annotate that don't have their own constraint variables, such as checked regions. There might be a compromise such as SolvableObject, or maybe that's too unwieldy and we should go with ConstrainableObject.)

John added:

Also, I've been thinking we should split those classes out into separate files. ConstraintsVariable.cpp is almost 2k lines which makes it a pain to edit.

I plan to work on this after our upcoming PR to Microsoft. I'm starting this issue thread so we can discuss the new names we want before I start a draft PR; it seems awkward to start the draft PR and then discuss the names there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions