Hacker News new | ask | show | jobs
by jskulski 3864 days ago
def some_function(some_obj): ...

How does any IDE or editor know what some_function would be passed without a severe amount of inspection?

I might be wrong on my definitions, but almost by definition, there's just not enough information before runtime in dynamic systems to infer enough to do any real refactoring or smart completion.

I use PyCharm everyday, and I like it, but it's refactor menu is limited, can fail, and pales in comparison to my uses of java w/ IntelliJ or even a well hinted php app w/ PHPstorm.

2 comments

I agree. I haven't yet encountered an IDE that has any hope of doing anything more than being able to enumerate the defs in a module or the functions in an object. JavaScript is one of the worst because there is no canonical "include" semantic so you really have no idea what's going on. The corollary seems to be that many of these languages are fast to develop (and run) so excessive console.logs appears to be the "solution"
Many 'dynamically typed' languages are developed at runtime.

Check for example the typical Smalltalk or Lisp environment. The editor asks the runtime.

Since many of those languages are object-oriented, you'll know the class:

(defmethod hide ((w window)) ...)

Oh, w is a window...