Hacker News new | ask | show | jobs
by bryze 5132 days ago
I have my own ideas about how to do this, and I'm glad someone is moving in this direction, but I must ask, is this a stepping stone in a grander vision? Enemies of software development today are:

1. Code Comprehension: Can new people quickly understand a complex code base enough to implement significant features. 2. Fault Diagnosis: When is the last time you spent less than 50% of a project's time on debugging? 3. Code Transformation: Have you ever actually tried to factor a mega-function into separate functions? How about creating a set of concrete classes when you realize that your hierarchy abstraction breaks down under new requirements. Now do all that without introducing new bugs.

These are the hard problems, and it excites me that people are thinking about how to solve them. This tool will not solve all those problems, and maybe one tool shouldn't, but nevertheless I hope people will start thinking about the entire development process and how to improve all the tools of our industry.

3 comments

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.

> 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.
I completely agree with the above. I spent my PhD building prototypes and tools for the above. Check out what we have done at: http://www.architexa.com.

Would love to hear your thoughts (see my profile for my email address). And feel free to get in touch for a free license of our software.

I'm with you on the 'I'm glad someone is moving in this direction' vein, but to me the "Enemies of software development today" are much broader than you suggest. I am pretty strongly of the view that the fundamental line between 'developer' and 'user' (aka. 'programming' and 'program') needs to be broken down.
This sounds nice in theory but I don’t think it’s an interesting goal. I’ll go further: it’s been the goal all along but doesn’t have traction.

SQL was designed as a “business” language, for end users (what we now call information workers). Didn’t happen. There have been many promises of “visual” languages, just drag and drop components and you have an app.

The issue is not tools, but the fact that programming is a logical business. The best programmers are logicians – they have a robust mental model of a problem to be solved. The coding (and the tools) help, but they ain’t the thing.

Basically, being capable of manipulating Illustrator does not an artist make.

In fact, programming has been moving in the other direction: more people I know use Ruby on a command line than Visual Studio’s design surfaces.

The frontier is in end-user UI. Progress is when we allow users to be more ambiguous, less logical, and still give them what they want.

Thanks for the response. After your first sentence I was looking for something to disagree with. But actually I agree with you on pretty much every point you make here - I am just slightly unsure how this disagrees with what I said previously.

My guess (from your second last para. especially) is that you think I am advocating more 'dumbed down' high-level visual languages/ides/etc. which I really don't mean to - at least not like the ones of the past. To me these tend to really fail at what I want because they tend to: (1) have a very limited scope of functions (2) have pretty fixed interfaces which simplify certain tasks, but also make others much more complex than a simple command line or similar (3) not make it easy for you to transition to other environments [to learn something with different or lower-level functions].

To me, many of the subtleties of implementation (such as the points I just made above) often actually matter a lot more than the big words (like 'visual programming', 'IDE', 'UI' etc.) that are bandied about far more often.

I guess its my fault for trying to be terse. I think it is very difficult to discuss these things in message-board format because different words mean very different things to different people. In the end I think we are probably looking at the same goal from different directions.