...And God help you if the classes actually need each other. For example, suppose I'm modelling the grammar of a language that has recursive operations, e.g.
X -> (X + X)
X -> (X + Y)
X -> (Y + X)
Y -> (X + X)
Y -> (X + Z)
...etc.
If I define X and Y as distinct classes in separate files, then X will need to reference Y and Y will need to reference X. I can't think of a non-hacky way to do this.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
...And God help you if the classes actually need each other. For example, suppose I'm modelling the grammar of a language that has recursive operations, e.g.
X -> (X + X)
X -> (X + Y)
X -> (Y + X)
Y -> (X + X)
Y -> (X + Z)
...etc.
If I define X and Y as distinct classes in separate files, then X will need to reference Y and Y will need to reference X. I can't think of a non-hacky way to do this.