Re:Are dynamic languages going to replace static languages? ...
by belorn on Wednesday August 04, 2021 @05:49PM
(#28066842)
Unfortunately right before that an SQL function was called that wiped the database, just before calling the banking function that used an corrupt pointer to send a large sum of money to a random tax account which then happened to have a major tax debt, and as matter of tax law one can't demand money back from the government if paid to such account.
[ Parent
| on HN ]
Re:Are dynamic languages going to replace static languages? ...
by adwn on Thursday August 05, 2021 @02:21AM
(#28070483)
You've completely missed the point: A powerful static type system helps prevent many types of logic bugs.
No, it won't prevent every conceivable bug or error, but nobody claimed it does. Automatically ruling out a large class of bugs at compile-time is still very valuable. Don't let the perfect be the enemy of the good.
Re:Are dynamic languages going to replace static languages? ...
by belorn on Thursday August 05, 2021 @06:02AM
(#28071703)
In almost 20 years of writing programs I have yet to write a delete function that dynamically call delete based on the object type. Having a delete_supplier() function that assumes Supplier object is a pattern that has direct security issue baked in.
The closest I would ever have gotten to the above scenario would be the time when I wrote an array of function pointers to be called in a parallel process. A bit of rather complex C code, and if I recall a bunch of void pointers.
If you intend to provide examples or bugs being caught with type checking, it would be useful if those examples actually occurred and were caught by the type checking.
Re:Are dynamic languages going to replace static languages? ...
by scrollaway on Thursday August 05, 2021 @10:19AM
(#28074076)
You sure seem to be thinking about types a lot for somebody who claims to not have to think about types. Which is the entire point everybody is trying to make you understand.