Writing Classes: init & new clarification needed

The problem is that *new is a class method and therefore it can’t do anything with instance variables except through getter/setter methods, or calling super.newCopyArgs. So if you are e.g. subclassing a class that already has some instance variables populated via newCopyArgs, I don’t know of any way to populate any extra instance variables except to use an init method.

Here’s an example from one of my classes whose superclass populates a common set of instance variables with newCopyArgs

  *new { |startTime, duration, offset = 0, color, name, defName = 'default', args, target, addAction = 'addToHead', mute = false, func, doPlayFunc = false|
    args = args ?? [];
    func = func ? defaultFunc;
    ^super.new(startTime, duration, offset, color, name, mute: mute).init(defName, args, target, addAction, func, doPlayFunc);
  }

  init { |argDefName, argArgs, argTarget, argAddAction, argFunc, argDoPlayFunc, argBus|
    defName = argDefName;
    args = argArgs;
    target = argTarget;
    addAction = argAddAction;
    func = argFunc;
    doPlayFunc = argDoPlayFunc;
  }

I still think Jordan’s advice is still sound – this should be avoided if possible, and is a good reason to avoid complicated class hierarchy (the canonical way seems to be to then add differently named init methods in further subclasses)