The question: Is it considered better practice to use derived types/subtypes or to use conditions and exception-handling to restrict the acceptable inputs for a subprogram in Ada? I understand that in Ada2012 you can use contracts, but what about for previous versions like Ada95?
The context: I want to make a series of procedures which can read/write specific fields in a packet (represented by a private unsigned byte array) to be broadcasted from an embedded device to an ASIC. A lot of the fields are different sizes and don't line up with the byte boundaries, so using standard types would allow a program using these procedures to enter illegal values if unchecked.
Extra notes: Outside of manipulating the packet contents via these subprograms, these types would not be used elsewhere. Also, if it makes a difference, this code would be used in a safety critical system.