I've been looking into Arduino (and Teensy) programming recently and tried to write a sketch which might be used on both. What I stumbled upon was how to do the debug output (or generally speaking: serial communication). For the Arduino I would use the Serial class, while the default Serial object for the Teensy is the HardwareSerial class. If I want to do serial communication using TX/RX pins there are the SoftwareSerial and NewSoftwareSerial classes.
Currently I am using some crude #ifdef logic to switch between different approaches.
Design-wise I would prefer a concept which uses an interface or virtual base class for all Serial like communication implementations.
Would it be a reasonable request to change the core class Serial so that it is based an such a virtual base class, which could be used by other projects (e.g. such as NewSoftwareSerial)?