Re:Diminishing returns of static typing
by sacado2 on Monday October 02, 2017 @12:46PM
(#15385422)
Defining types is easy and enhances code readability until you go too far. Some type declarations in Haskell or highly templated C++ are hard to read.
[ Parent
| on HN ]
Re:Diminishing returns of static typing
by Silhouette on Monday October 02, 2017 @02:01PM
(#15386208)
While this is a valid point, it's also worth remembering that if you have a data structure of sufficient complexity that writing out its type is cumbersome, then your data is still in that structure whether you choose to be explicit about it or not. Any code reading or modifying some element within that data still needs to correctly find that element, and if writing out the types is a burden then probably finding the correct location every time is also difficult. So if anything, when you have more complicated data structures flying around, and particularly if you work with several similar but different complicated structures, that could make having the types explicit much more useful for ensuring correctness and maintainability.
Absolutely. Sometimes the type is too complex not to be explicit about it.
Re:Diminishing returns of static typing
by kronos29296 on Monday October 02, 2017 @01:15PM
(#15385759)
Highly templated C++ is the highway to hell. If you haven't heard C++ templates are turing complete and so can also have the halting problem.