3 ms·
I use it exactly for this. Just use typespecs as a hint to the person looking at the code as to what is expected to be passed.
by warmwaffles 6y ago
I use it exactly for this. Just use typespecs as a hint to the person looking at the code as to what is expected to be passed.
- bcrosby95 6y agoIf you never do anything but read them... why not documentation?
- slindz 6y agoTerseness.
- devoutsalsa 6y agoYup. One could write "It takes a string as an argument & reverses it". Or one could write "String.reverse(()". For any non trivial case, such as weird options, you'll normally write documentation anyway.
- warmwaffles 6y agoI do both. All to help me in the future as much as possible when I come back scratching my head.