Hacker News new | ask | show | jobs
by cageface 5133 days ago
Java + a good modern IDE like IntelliJ are far from the last word on all these questions, of course, but they're much better than you might guess if you have't worked in that world for a while. I was astonished at how powerful the combination of a simple, statically typed language and a good IDE can be. You can almost completely stop thinking of code as a bunch of text and start thinking about it as an organically evolving structure.

The tooling around dynamic languages is almost laughably primitive and limited in comparison.

4 comments

> The tooling around dynamic languages is almost laughably primitive and limited in comparison.

Around most dynamic languages, there are exceptions like Smalltalk which has excellent tooling including the automated refactoring and the best development environment around. Let's not forget, tools such as automated refactoring and xUnit type test tools originated in Smalltalk.

Also, Eclipse can trace it's roots directly to VisualAge, IBM's Smalltalk based IDE platform (Eclipse began as a rewrite of VisualAge in Java).
> The tooling around dynamic languages is almost laughably primitive and limited in comparison.

Somethings just can't be done.

    class Foo:
        def foo():
            pass

    def bar(f):
        f.foo
If you re-factor Foo.foo to Foo.renamed, there is no way to know if the call in bar should be re-named as well.
Sure there is. You just need code tracing and full test coverage. You can't do it from the source alone, sure, but that doesn't mean it can't be done.
> Sure there is. You just need code tracing and full test coverage. You can't do it from the source alone, sure, but that doesn't mean it can't be done.

The analog would be driving to New York from Bangalore. Sure it can be done if I arrange a car; have money for the fuel, food and stay; have all the papers etc etc. But that doesn't mean it is in any way comparable to flying to New York while watching a movie and sipping wine.

Renaming a method in the public interface is always a pain - your test coverage and code tracing can numb down it a bit, but it's going to be there. Some of it is because public interfaces are a constant for all practical intent and purpose; most of it is because of the case I listed above.

I think I might not have made myself clear - given an execution trace of a test suite with full coverage (or just something which exercises every code path - it doesn't have to be a test suite, but you've already got one of those so you might as well use it, right?), you could build a tool to make a rename refactoring fully automatic in a dynamic language. At the point of use, it would be identical to a static language rename, it would just work in a different way. It's a fairly obvious idea, so I presume this has been done in the past, but I don't know of any examples offhand.

The only gotcha is where you're eval'ing a string, but that's going to be nasty however you cut it.

Clippy could ask at least, right?

Joking aside, your example brought the nature of the issue to life; thanks.

I have the same feeling working with C# and Visual Studio with ReSharper. It's impressive how easily I can navigate the code base, refactor with confidence and learn APIs as I go.
The developer of Smalltalk Agents called it while C# and dotnet still were new. Smalltalk lost as a language, but as set of expectations for dev environments, has been winning. LightTable looks to complete this.
I always loved the amount of power in java IDEs (Eclipse, for me) for refactoring code...made things so much easier.
Where do you put the brains on though? In the IDE/programmer or in the language?
> Where do you put the brains on though? In the IDE/programmer or in the language?

Dynamic languages aren't conductive to re-factoring, and static languages are.

http://news.ycombinator.com/item?id=4057593

I don't see how it is a question of where to put the brains.

Dynamic languages aren't conductive to re-factoring

How come they invented it, then?

http://st-www.cs.illinois.edu/users/brant/Refactory/Refactor...

Let me rephrase. Dynamic languages aren't conductive to a subset of re-factoring - the cases which involve renaming identifiers or changing types throughout the project.
They invented those too. Indeed they're listed at the link I provided.

It seems strange to argue that what gave rise to a thing isn't "conducive" to it. Actually, it's more than strange, it's a contradiction in terms: http://dictionary.reference.com/browse/conducive.