Re:Are dynamic languages going to replace static languages? ...
by mpweiher on Sunday August 15, 2021 @05:04PM
(#28192526)
> Python3 program which hasn't crashed at some point due to me mixing-up string/bytes
Not sure what that even is, but I'd point out that dynamically-typed ≠ Python. In particular, the "hash languages" (Python, Ruby, JavaScript) seem to make it particularly easy to make a hash of things, but not due to the dynamic typing.
I've never had that problem with NSString and NSData. They are quite distinct.
> Python3 ... crunching numbers ... map instead of list
??
Why would you output a map when you are crunching numbers?
To get a "list", for example, I'd use an NSArray. It seems tricky to get an NSDictionary instead, since you have to explicitly ask for an NSDictionary in order to get one.
The libraries seem pretty reliable; but I'm not (exactly the same as in the SQL example, BTW).
For example, I don't think I've ever managed to write a Python3 program which hasn't crashed at some point due to me mixing-up string/bytes; of course, testing doesn't usually find such problems, even with Hypothesis, since I make exactly the same mistakes when I'm writing the tests. I've also written a whole bunch of Python3 programs which spend ages crunching numbers, only to output '<map object at 0x10199c2e0>' instead of printing a list.
I make exactly the same mistakes when writing Haskell and Scala; but the computer tells me that I've made a mistake, and how to fix it, before the program ever gets a chance to run.
> You don't seem to understand what I meant with "You are not going to statically type check your users".
That might be the case. I can't elaborate on what you meant (since I may have misunderstood)