Accustomed to C + + Programming Mode: Edit, save, compile, run and debug after, forget there is actually another programming mode-interactive programming. Many scripting languages provide similar consoles, enter script statements directly, and perform a carriage return, and the results are immediately displayed without having to undergo a complex save and compile phase.
Interactive programming is handy for simple, experimental operations, such as testing the use of a function. Because after the input statement, you can immediately get the result, you know where the problem is, immediately can be fixed, the speed of development has been greatly improved. Think about how you can do this in languages like C + +. 1. Print out the output to the screen, to the log file, or MessageBox 2. Use the debugger to step through or set breakpoints. No matter which kind, it is more laborious, once found the problem, but also must terminate the whole process, again. If the program is loaded for a long time, or need to go through a lot of steps to reach the specified location, you are even harder-although VS2005 tools such as debugging can be implemented to modify C + + code and then run, but I use is still not much, it seems not so handy.
If you just want to implement some temporary action, such as viewing some information, the advantage of interactive programming is even more obvious. Because is the temporary operation, the randomness will be stronger, many times is sees one information only then will think to do another operation, therefore cannot think beforehand very well. At this point, like the command line, it is convenient to read and write. I think that's one of the reasons why Microsoft invented PowerShell.
And, of course, what inspired me was Ruby on Rails, it provides an application console that lets you run Rails applications interactively, rather than having to interact with the page, making it easy to develop and debug, especially in the absence of powerful remote debugging tools such as vs.