Classes and Interfaces
In Targo, class is best understood as a Go-first structure-and-methods tool, not a JavaScript inheritance system.
Core ideas
classis close to a Go struct with reference semanticsinterfaceis a Go-style behavior contract- composition is preferred over inheritance
constructoris supported, but that does not make Targo a JS class runtime
Practical advice
- use
classfor domain structures and stateful behavior - use
interfacefor boundaries and substitution - use
#fieldfor private fields - use composition or embedding instead of trying to recreate
extends