In What You Can't See You Can't Get I mentioned in passing how frustrated I was that the state of the art in code editors and IDE has advanced so little since 2003. A number of commenters pointed out the amazing Bret Victor talk Inventing on Principle. I hadn't seen this, but thanks for mentioning it, because I definitely should have. Maybe you haven't seen it either?
It's a bit long at 54 minutes, but worth viewing in its entirety. What Bret shows here is indeed exactly the sort of thing we should be doing, but aren't.
In some ways we've actually regressed from my ancient Visual Basic 6.0 days, when you'd get dynamically notified about errors as you typed, not just when you compiled or ran unit tests. The idea that you should be able to type (or gesture, or speak) and immediately see the result of that change is simple, but extremely powerful. It's speed of iteration in the small. That's essentially the basis for my argument that showing markup and rendered output side-by-side, and dynamically updating them as you type, is vastly superior for learning and experimentation compared to any attempt at WYSIWYG.
But Bret goes further than that – why not show the effects of predicted changes, and change over time? Time is the missing element in a static display of code and rendered output; how do we show that?
Again, watch the video because it's easier to see in action than it is to explain. But maybe you'd like to play with it yourself? That's sort of the point, isn't it? As I wrote in 2007:
I yearn for the day when web pages are regularly illustrated with the kind of beautiful, dynamic visualizations that Ben Fry creates.
That day, I'm happy to report, seems to have arrived. Bret's article, Up and Down the Ladder of Abstraction is extremely interactive in plain old boring HTML 5.
Yes, it's artsy, yes these are mostly toy projects, but this isn't entirely abstract art house visualization nonsense. Designing tools that let you make rapid changes, and see the effects of those changes as soon as possible can be transformative.
Paul realized that what we needed to be solved was not, in fact, human powered flight. That was a red-herring. The problem was the process itself, and along with it the blind pursuit of a goal without a deeper understanding how to tackle deeply difficult challenges. He came up with a new problem that he set out to solve: how can you build a plane that could be rebuilt in hours not months. And he did. He built a plane with Mylar, aluminum tubing, and wire.
The first airplane didn't work. It was too flimsy. But, because the problem he set out to solve was creating a plane he could fix in hours, he was able to quickly iterate. Sometimes he would fly three or four different planes in a single day. The rebuild, retest, relearn cycle went from months and years to hours and days.
Eighteen years had passed since Henry Kremer opened his wallet for his vision. Nobody could turn that vision into an airplane. Paul MacCready got involved and changed the understanding of the problem to be solved. Half a year later later, MacCready's Gossamer Condor flew 2,172 meters to win the prize. A bit over a year after that, the Gossamer Albatross flew across the channel.
Don't get me wrong, we're failing plenty fast with our existing tools. But I can't shake the feeling that we could we fail even faster if we optimized our IDEs and code editors to better visualize the effects of our changes in real time as we make them.
| [advertisement] How are you showing off your awesome? Create a Stack Overflow Careers profile and show off all of your hard work from Stack Overflow, Github, and virtually every other coding site. Who knows, you might even get recruited for a great new position! |
I watched Bret's talk when it was mentioned in the comments of your last article. It was truly inspiring.
Of course, this isn't a new idea. His demos are just particularly well done. In 3d programming it's common to find examples with built-in control panels and sliders so that a game designer can actually fine tune parameters and see the results in real-time.
The ability to instantly view your results is awesome. It's something I've done a few times now in some of my own tools. I built regexhero.net so that everything happens in real-time to drastically speed up the process of writing regular expressions. Regex Hero certainly wasn't the first to do this. There are several regex testers that at least have the instant highlighting capability.
I also built 060calculator.com to work without a "calculate" button. I realized adding a button to the UI is completely unnecessary when it's so inexpensive to perform the calculation on the fly. It's a simple idea but many of the tools we use everyday are still lacking.
Steve Wortham on March 29, 2012 5:07 PMI'm a high school physics teacher who teaches my students to build simulations of physical situations in Python using the VPython module that allows them to create fully visual simulations of a soccer ball flying through the air with a drag force for instance, with a tiny amount of code. When I saw this video, I instantly thought it would be tremendously helpful for students who are getting started in computer science, and really wish that we could make a simple IDE for beginning students with this functionality.
Occam98 on March 29, 2012 5:50 PMVB.Net still has the old background compiler, so you still get notified about errors as you type. It's one of the reasons why I still like working in VB.Net over C#. VB.Net isn't a popular as C#, but it has almost all the same functionality, and personally, the background compiler makes it a joy to work in. I don't know why MS hasn't implemented similar functionality in C# yet.
Kibbee on March 29, 2012 6:06 PM"But I can't shake the feeling that we could we fail even faster if we optimized our..."
That sums up the real question of so many challenges that people are facing today. How can we fail faster, and better? Not just in programming, but in life in general. We really need to embrace this idea of failure more, it is such an important concept of life. It is not something to be shunned or ignored, but recognized and cherished for what it produces.
Abel Tesfay on March 29, 2012 6:47 PMNCrunch (http://www.ncrunch.net) for Visual Studio achieves something similar. It runs your unit tests after every change you make to the code and displays the status of the tests with a visual indicator along the left margin of the code being tested.
I'm honestly a little surprised at how effective it is. Writing well-tested code is easier now because I can iterate much faster. I no longer have to stop writing code, compile, run/debug tests, and then finally figure out what happened if the test didn't pass. I can just pause and let NCrunch run the tests I selected and continue.
A Facebook User on March 29, 2012 7:03 PMclang_complete for VIM provides excellent real-time compile checking and clang also has a wonderful static analyzer. It's a godsend for C, C++, and Objective-C development.
Brian Ledbetter on March 29, 2012 7:46 PMI too was amazed by that video. But then I started thinking... (I'm sure I'm just not smart enough but...)
How would the techniques shown in the video work in the real world? Showing a sort of a 5 integers is easy. How about showing the visualization of
sortTriangles(
const array points,
const array triangle_indices,
array out_sorted_triangle_indices) {
}
How would the system even have a clue that every 3 values in indices references 3 points and that those points are triangles and need to be graphed?
I think if you try to apply similar ideas to your own code you'll soon see very few functions lend themselves to easy visualization.
Now maybe this is like TDD and somehow if we had visualization we'd design our code better to be visualize-able. Or maybe it's just not has easy as he made it look.
To pick more nits. The graphic editing in the video. I know of almost no art made like that. In fact art programs have existed that were more algorithmic like Intellidraw (mid 90s) that failed miserably. Artists don't want to code, they want Illustrator. The number of people that want to code up dynamic images is arguably pretty small.
But, even assuming there was a place for that visualization so many things were glossed over. As someone who's had to provide sliders for artists, to even display a slider generally requires meta data about the range of the slider. Should it go from 0.0 to 1.0 in 0.01 increments? Or maybe it needs to go from 1000 to 100000? If I let it go to 0 will I get a divide by zero error in my code? Will a negative number break my code? If one slider is "number of leaves per branch" and another is "number of branches" and the users slides the first to 10000 and the second also to 10000 one of 2 things will likely happen. Either the system will run out of memory OR the system will go so slow that trying it set them back to reasonable values will take minutes.
Of course maybe some super smart guy will figure out the generic solutions for these types of problems. On the other hand, maybe it's really not as easy a problem as it was made to look.
gman on March 29, 2012 9:05 PMI'm working on a fork of a great project by gabriel florit called water:
http://enjalot.com/tributary/2165875/sinwaves.js
his original is here:
http://gabrielflor.it/water
It only addresses one sliver of the concepts that Bret talks about, but it's a start towards making those discoveries sharable.
Enjalot on March 30, 2012 12:02 AMInspiring.
In the linked article, the last section is about perspective: it could be interesting that, in physics, the very same concepts is called "phase state", a n-dimensional space where each point represent a particular state of the system (http://en.wikipedia.org/wiki/Phase_space), where n is the number of variables involved in the system.
Once you have mapped your system in this space, you can also use math tools to analyze the state transitions, mapping state transitions as vectors between two points of the phase space, and identify "clusters", group of related states that are "near". You can also analyize the "entropy" of your system, i.e. find "stable" and "unstable" states.
Very, very interesting stuff.
In some ways we've actually regressed from my ancient Visual Basic 6.0 days, when you'd get dynamically notified about errors as you typed
Eclipse compiles in the background & shows errors as you type - when I use Visual Studio for a project, this is the feature I miss the most!
Caspar Krieger on March 30, 2012 4:17 AMHN comments: http://news.ycombinator.com/item?id=3773626
vdm on March 30, 2012 5:23 AMResharper (visual studio plug-in) shows errors as you type...every other ide does too btw. Visual Studio is embarassing compared to other IDEs quite honestly.
fishstick_kitty on March 30, 2012 6:07 AMThanks for the light.
Visualisation is so useful and can be particularly helpful when built into frameworks or generic transaction processors.
The trick is to build them, so that they know when to get out of the way.
Mike
Mike Farrow on March 30, 2012 6:50 AMCool demos, sure. Very nice tech. Now, did anyone notice the point of the talk?
Shawn Hoover on March 30, 2012 7:11 AMMy two favorites are the Delphi IDE and NetBeans. I feel sorry for the design team at work as they are stuck in Dreamweaver.
Frank on March 30, 2012 7:23 AMIDEs for gaming industry have this problem for years. We program art. I suggest Unity3D (www.unity3d.com), because they have exactly this kind of realtime programming solution.
Massa Bruno Massa Guimarães on March 30, 2012 7:26 AMThe problem is that most of your projects are going to be an original creation, so that no simulator for it will exist. The only way to get one would be to make it... except that would take exponentially longer than just dealing with the problem. It only becomes feasible if you are going to repeat a very similar simulation many times.
Jeffrey Davis on March 30, 2012 9:58 AMJeffrey, that's what I was thinking as well. You'll notice that the real-time simulation for each of Bret's demos are different and highly optimized for the task at hand. It'd be difficult to create a general-purpose IDE with all of this built-in. Maybe a good starting point would be a series of pre-configured simulators with certain behaviors which you can use to test your code.
Steve Wortham on March 30, 2012 11:22 AMI had this idea the other day, maybe someone else has to. I thought, if we have such great source control providers such as Git/Hg, why can't an IDE be a time travel device?
Don't you think we spend a lot of effort trying to understand a codebase? Someone new on a team. A contributor to a big OSS project. Anything involving a piece of code. How was it built? What came first? What came later?
I thought, if someone made an IDE that tracked everything that happened or took "snapshots" and coupled that with a VCS, you could literally time travel through your codebase. Fast forward, play, rewind, scrub, whatever. Someone new to the project? They'll play it from the beginning, seeing what classes you made, how you structured everything.
Furthermore, I remember seeing a proof of concept where you coded by linking off of existing snippets, like bubbles. It was some IDE concept, it was pretty neat. If you tied something like that to this time travel concept, you'd be able to semantically see links between code (which means you can visualize it).
I don't think it would be incredibly difficult to do this as a standalone app built on top of a VCS. Point it at a repository which has all its history, and you can "watch" it with a playback interface. Of course, it depends on how frequent the commits and whatever, which is why an IDE or something would be way better.
I think there are many things we could be doing to our IDEs that would make them more like interactive, social applications. Someone else working on the same file you are? See what they're doing next to you in the editor, chat with them. See where your team is in the codebase, what branch, what they're doing, etc.
It seems like IDEs go out of their way to discourage communication; instead we're forced to communicate via email, IM, or TFS work items, outside the codebase unless we comment which different people do differently. Why shouldn't a "codebase" be where all that happens, with annotations, discussions, and a social context?
Overall, I think there needs to be a radical change in how we think about coding... but maybe I'm just insane. What would an IDE look like if there were no "files"? We've been thinking in files for a long, long time; maybe that's not the best way to write or think about a program. Sure, the output can be files (for the web, distribution, etc)... but maybe that's not how you write it.
Kamran Ayub on March 30, 2012 11:28 AM> I thought, if someone made an IDE that tracked everything that happened or took "snapshots" and coupled that with a VCS, you could literally time travel through your codebase.
Indeed, I believe that is what http://www.storytellersoftware.com/ is attempting to do?
Jeff Atwood on March 30, 2012 12:14 PMI think other commenters are pointing out the true problem. The presenter has produced a tremendous tool for an extremely domain specific problem.
Unfortunately, the vast majority of real programs have so many degrees of freedom that you couldn't possibly generalize a system like this in any meaningful way. Even worse, the outputs of many programs don't lend themselves to easy visualization.
When I am working on a program, a chance in code *could* effect 30-40 different output files, change the network communication of 2-3 different connections, etc. There simply isn't a way for a human to visualize that all at once.
The aphorism is "make things as simple as possible, but no simpler". The trouble with programming at any real scale is that *it isn't simple*, and nothing can make it simple.
My experience is that many general systems designed to make life easier, make simple tasks really simple, moderate tasks slightly easier, and complex tasks anywhere from a little bit to a lot harder. I've used good tools for complex problems, but they were all extremely specific to the project.
I have yet to find good global tools that make general programming fundamentally easier.
Tom West on March 30, 2012 12:21 PMThe latest xcode does on-the-fly static/error checking and the now de rigueur completion stuff -- and the first thing I do is turn it all off. Programming is creative writing, and I want a quiet place where I can think with out the system popping in and pulling me out of flow.
Certainly time-based visualization has uses in certain problem domains, but it is important this circus of capabilities be able to be put into the background and come only when called.
Perhaps this is just an implementation detail.
Of course, I've been programming professionally for 30 years, so I am an ossified old fart.
GET OFF MY LAWN!
Ward Willats on March 30, 2012 2:15 PMI build an interactive javascript learning website. http://learnjs.info
tries to help see how code runs and fails
What would be the next logical step would be to get unit tests generated as we are typing out code. Add a few code analysis tools to the mix and we have a good feature set for next version of Visual Studio.
Ashutoshm on March 31, 2012 9:35 PMUm, you were saying... http://meteor.com/screencast
Radman on April 11, 2012 7:02 AMCheck out and please back the Light Table project for JavaScript and Clojure: http://www.kickstarter.com/projects/ibdknox/light-table, which attempts to do some of what Bret was demonstrating. From the site:
Light table is based on a few guiding principles:
Hi………….. This is a great site.help with dissertations
jcbphlip on September 20, 2012 9:46 AMThe comments to this entry are closed.
|
|
Traffic Stats |