3 ms·
The auto-completion is purely Python's dynamic-dispatch problem though. Lisp has symbol-based auto-completion which doesn't suffer from the same issue (search i
by ywei3410 6y ago
The auto-completion is purely Python's dynamic-dispatch problem though. Lisp has symbol-based auto-completion which doesn't suffer from the same issue (search is a different story!).
This sounds terribly controversial, but I would love to know /when/ the static-typing pays off compared to a looser approach like sound-gradual typing (where you basically export types at a boundary and make sure that you don't violate those).
I do wonder whether a better approach is to prove your code in some other language (say Z3, Agda, Coq) - then implement it in something else, making sure you can prove isomorphism. This has quite a few benefits; you're not tied to a constructive proof on the type-level ala Haskell, Rust, Go etc... and you can automate a large part of trivial proofs.
- yawaramin 6y ago> I would love to know /when/ the static-typing pays off compared to a looser approach like sound-gradual typing (where you basically export types at a boundary and make sure that you don't violate those). When you are in a codebase where you don't know which modules have been soundly typed, and which ones are still in the 'gradual' phase.
- blackrock 6y agoThe fascinating thing about Python is the ability to write functions where the parameter can intake multiple data types. I haven’t quite seen another language handle it this elegantly as Python does. Then, inside the function, you can check the parameter’s data type, and handle it appropriately. And error out immediately if the wrong type is passed in. This allows you to operate on the data at a more logical level (what it implies), as opposed to just at the technical level (what data type it is). For example, you can pass in a single string, or a list of strings. And your function can check the type and handle it appropriately. In C++ and Java, because of the rigidity of the function declaration, in order to do something like this, then you would need to create multiple functions to handle each of the different types that you want to allow. Then you’d need to create a wrapper function to dispatch it to its appropriate sub function. That becomes a complete mess after a while.
- Gibbon1 6y agoC# has an is operator as well. I found it useful with generics.