Re:Type hints – a mediocre programmer's reaction (2015)
by z3t4 on Thursday March 17, 2016 @05:11PM
(#11307644)
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".
[ Parent
| on HN ]
There are no comments on this comment yet.