3 ms·
In for example JavaScript or other high level programming language: Instead of implementing type check/hints, your functions should validate the input data and
by z3t4 11y ago
In for example JavaScript or other high level programming language: Instead of implementing type check/hints, your functions should validate the input data and throw an error if it doesn't meet the requirements. The compiler/VM should chose the optimal type. Types are for low level systems programming. In high level programming, think form design and validation instead of types. Example: Argument "yearBorn" should take a numeric value of two or four numbers. Not a "unsigned short int".