How do you navigate and refactor code written in a dynamic language?
- by Philippe Beaudoin
I love that writing Python, Ruby or Javascript requires so little boilerplate. I love simple functional constructs. I love the clean and simple syntax.
However, there are three things I'm really bad at when developing a large software in a dynamic language:
Navigating the code
Identifying the interfaces of the objects I'm using
Refactoring efficiently
I have been trying simple editors (i.e. Vim) as well as IDE (Eclipse + PyDev) but in both cases I feel like I have to commit a lot more to memory and/or to constantly "grep" and read through the code to identify the interfaces.
As for refactoring, for example changing method names, it becomes hugely dependent on the quality of my unit tests. And if I try to isolate my unit tests by "cutting them off" the rest of the application, then there is no guarantee that my stub's interface stays up to date with the object I'm stubbing.
I'm sure there are workarounds for these problems. How do you work efficiently in Python, Ruby or Javascript?