by vivekseth · 7y ago · 0 comments
For example, let's say you have a class `Dog` that you want to rename to be more generic so you now call it `Animal`.
In Python you can test out snippets of code with `Animal` without necessarily having to worry about other pieces of code still referring to `Dog`. You would just need to make sure that the code you want to run happens before later pieces that might use `Dog`.
In C/C++ you'd have to change all the references to `Dog` in your codebase, comment them all out, or add a new target to your project to build a subset of files which do not include an invalid reference to `Dog`.
This extra friction can make rapid prototyping a little harder in static typed languages.
IDK if any language supports this today, but ideally I'd like to be able to run a language without compile-time type checking for prototyping and be able to progressively turn on type checking as I'm nearing the final stages of iteration on a project/feature.
* Have cursor on 'Dog' * Ctrl-R-R * Type 'Animal' * Press Enter
Done. And your code won't be littered with 'old' types and other garbage.
https://downloads.haskell.org/~ghc/7.8.4/docs/html/users_gui...
Also, having worked extensively with Java, changing types is not as nearly as cumbersome as you describe. In an IDE, you can replace all usages of a type in a project or subdirectory with 3 clicks. Large, statically typed codebases are almost always navigated in an IDE.